xolvio / qualityfaster

An example project showing how to create robust and maintainable acceptance tests
262 stars 58 forks source link

running chimp with multiple meteor apps #44

Closed Alino closed 8 years ago

Alino commented 8 years ago

what is the best practice to run chimp with multiple meteor apps? In my case, I am running 3 different meteor apps.

simple scenario: Given that user clicks in app1 on url link to app2 Then I want to expect some things in app2.

should I rewrite start.js to run multiple meteor apps?

samhatoum commented 8 years ago

If you must have 3 meteor apps, then yes you'll need to start 3 separately. You can also use Chimp in multidriver mode, so you can use multiple browsers from one Chimp runner.

@lgandecki do we have docs for the multidriver yet?

lgandecki commented 8 years ago

There are initial docs here: https://chimp.readme.io/docs/multi-browser-testing

we wanted to have something quick for the release, but well-thought documentation with good examples would be probably much nicer.

Alino commented 8 years ago

thank you, this multi-browser support is cool. But for my case I would like to remain in single browser for now.

I would like to know what you do you think, how should I start my tests with chimp with a single command to run all 3 meteor apps. Is editing the start.js the ideal option?

I guess I would have to start multiple instances of chimp like this?

function chimpNoMirror() {
  appOptions.waitForMessage = 'App running at';
  startApp(function () {
    startChimp('--ddp=' + appOptions.env.ROOT_URL + chimpSwitches);
  });
  startApp2(function () {
    startChimp('--ddp=' + appOptions2.env.ROOT_URL + chimpSwitches);
  });
  startApp3(function () {
    startChimp('--ddp=' + appOptions3.env.ROOT_URL + chimpSwitches);
  });
}

if this is the good practice, I would just keep using npm start to run the tests

EDIT: or maybe I don't need to run chimp instance per app, basically I just need to run two other meteor apps somehow in the background so they are up for the main app. And that could be part of start.js

how would you approach this? Edit start.js, or create a gulp task or npm script...?

samhatoum commented 8 years ago

Sorry I missed this! Yes, starting multiple start.js scripts is fine as long as your computer can handle it.

I would personally put them all in one script to make it easier to start, if it's something you do regularly.

Also, you could save some RAM by starting one selenium server from your script, then get all the Chimps to connect to that server by providing --host and --port switches. I'd do the same with Mongo for Meteor.

Alino commented 8 years ago

thank you Sam, I am currently running multiple start.js