Skip to content

Adding info about Scenario #37

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

Closed
wants to merge 4 commits into from
Closed

Adding info about Scenario #37

wants to merge 4 commits into from

Conversation

ThomasLandauer
Copy link
Member

See Codeception/Codeception#6035

TODO: Update the anchor after Codeception/codeception.github.com#378 is online

@ThomasLandauer
Copy link
Member Author

The anchor is OK, so the above TODO is done.

@@ -293,6 +293,20 @@
* until it finally tries to find the form by XPath).
* If speed is a concern, it's recommended you stick with explicitly specifying the locator type via the array syntax.
*
* ###
*
* You can switch between browsers inside your code by injecting `\Codeception\Scenario` into your test like this:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence doesn't make sense to me.

In order to change browsers you have to use

$this->getModule('WebDriver')->_restart(['browser' => $browser]);

as documented at https://codeception.com/docs/modules/WebDriver#_restart

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea was to show some example for scenario, see Codeception/Codeception#6035 (comment) - and I couldn't think of another use case as switching the browser ;-)

I now added your line - but will $this->getModule(...) work from within a test at all? Or do I have to think of another use case...?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getModule method is not accessible in test code, it can only be used in helpers.

ThomasLandauer added a commit to ThomasLandauer/module-webdriver that referenced this pull request Mar 16, 2021
@ThomasLandauer
Copy link
Member Author

I deleted my fork, so I had to start from scratch :-) See #65

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

Successfully merging this pull request may close these issues.

2 participants