-
Notifications
You must be signed in to change notification settings - Fork 25
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
Conversation
See Codeception/Codeception#6035 TODO: Update the anchor after Codeception/codeception.github.com#378 is online
Fixing anchor after Codeception/codeception.github.com#378
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: |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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...?
There was a problem hiding this comment.
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.
Follow-up of Codeception#37 I now aligned the wording more to https://codeception.com/docs/07-AdvancedUsage#Get-Scenario-Metadata
I deleted my fork, so I had to start from scratch :-) See #65 |
See Codeception/Codeception#6035
TODO: Update the anchor after Codeception/codeception.github.com#378 is online