-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
4.5.2
-
MOODLE_405_STABLE
Only in selenium/standalone-chrome:4
When you have two windows opened and you do something like this:
And I switch to a second window
|
And I switch to the main window
|
it does not actually switch back to the main window, it stays in the second window.
My solution for this:
diff --git a/lib/tests/behat/behat_general.php b/lib/tests/behat/behat_general.php
|
index f7e5e929d3d..a98416dfec4 100644
|
--- a/lib/tests/behat/behat_general.php
|
+++ b/lib/tests/behat/behat_general.php
|
@@ -258,7 +258,8 @@ class behat_general extends behat_base {
|
* @Given /^I switch to the main (window|tab)$/
|
*/
|
public function switch_to_the_main_window() {
|
- $this->switch_to_window(self::MAIN_WINDOW_NAME);
|
+ $names = $this->getSession()->getWindowNames();
|
+ $this->switch_to_window($names[0]);
|
}
|
|
/**
|
But I do not have capacity now to properly test it and submit it, and also it does not affect anything in core at the moment. We found an alternative solution in Workplace.
Second problem is that $this->getSession()->getWindowNames() returns an extra window when a PDF is opened.
Apps team had a similar problem, this is their solution
https://github.com/moodlehq/moodleapp/commit/02c29ed69e97fb261a31224cb48b017e7b4b215b
- has been marked as being related by
-
MDL-84755 Behat failures after selenium/standalone-chrome latest update
-
- Open
-