Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run a test multiple times in parallel #271

Open
engharb opened this issue Aug 8, 2017 · 6 comments
Open

run a test multiple times in parallel #271

engharb opened this issue Aug 8, 2017 · 6 comments

Comments

@engharb
Copy link

engharb commented Aug 8, 2017

Dears,
I want to execute the scenario or test twice and in parallel by opening two tabs. I need this test to check and see how that affects the created session features.

Is that possible=

I am looking to hearing from you soon.

Thank you in advance.

@aik099
Copy link
Member

aik099 commented Aug 8, 2017

You can start 2 sessions in parallel, but code in your test would be executed sequentially anyway. If test engine that calls Mink support parallel execution (does Behat or PHPUnit do this?) then it's possible. But even if possible it's unlikely that you can control which of tests run parallely with which other test.

@engharb
Copy link
Author

engharb commented Aug 8, 2017

@aik099
Thank you very much for responding on my issue. But I need to execute two tests/features/scenarios simultaneously or parallel. Is that possible or should I install an api or library beside?

regards,

@aik099
Copy link
Member

aik099 commented Aug 8, 2017

Mink can open 2 windows at same time, but ensuring that 2 particular tests run in parallel is responsibility of your test runner, e.g. Behat.

I guess you should look at Behat manual or report issue in there.

@stof
Copy link
Member

stof commented Aug 8, 2017

and as PHP itself is not threaded, it will require using 2 separate PHP processes running Behat (one running each test).

Behat itself has no feature to run tests in parallel btw. It has to be done on top of it, by calling Behat multiple times with different filters for scenarios

@stof
Copy link
Member

stof commented Aug 8, 2017

However, using 2 selenium sessions in parallel will probably using 2 different windows rather than 2 different tabs. Note sure if that's OK for your case.

@stof
Copy link
Member

stof commented Aug 8, 2017

Btw, if your test is actually about testing that changes done in one session are affecting the data displayed in the other one, you may not need to use 2 separate tests running in parallel. You could use a single test using multiple Mink sessions, and making changes and assertions in each session alternatively (so loading a page in a session, checking content, then using another session to change stuff, then assert content in first session again to see live-reloaded changes).
If this is actually your use case, writing a single test might be much easier than synchronizing 2 tests running in parallel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants