gulp-run icon indicating copy to clipboard operation
gulp-run copied to clipboard

Query / Help: How to create tasks to start and stop appium server

Open rahulmr opened this issue 8 years ago • 1 comments

I have a situation in which I want to run the webdriverio tests on Android emulator. wdio-appium-service is having an issue, because of which the appium server is not getting started on windows.

Basically, I want to launch / start appium server which is can be started from ./node_modules/.bin/appium and the output should be redirected to appium.log file and once my tests are completed , the appium server should be stopped / killed.

gulp.task('start appium' ...
gulp.task('e2e', ['start appium'] ..
gulp.task('stop appium' ...

I am not expert with gulp so finding it bit difficult.

Thanks in advance.

rahulmr avatar Dec 20 '16 09:12 rahulmr

Unfortunately, gulp-run seems to be abandoned. I had the same issue, and because the return from run(...).exec(...) is just a stdout-stream, the short answer is that you can't. The slightly longer answer is that you can do it via shell commands:

const myTask = (done) => {
  run(
    "server-command\n" +
    "SRVPID=$!\n" +
    "test-command\n" +
    "kill $SRVPID\n"
  ).exec(done);
}

tifrel avatar Oct 04 '20 16:10 tifrel