m19c / gulp-run

Pipe to shell commands in gulp
ISC License
151 stars 25 forks source link

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

Open rahulmr opened 7 years ago

rahulmr commented 7 years ago

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.

tifrel commented 3 years ago

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);
}