diff --git a/lib/tests/behat/behat_general.php b/lib/tests/behat/behat_general.php index 080ea24205a..deafdfc051c 100644 --- a/lib/tests/behat/behat_general.php +++ b/lib/tests/behat/behat_general.php @@ -117,6 +117,25 @@ class behat_general extends behat_base { } } + /** + * Switches to the specified iframe. + * + * @Given /^I switch to "(?P(?:[^"]|\\")*)" iframe$/ + * @param string $iframename + */ + public function switch_to_iframe($iframename) { + $this->getSession()->switchToIFrame($iframename); + } + + /** + * Switches to the main Moodle frame. + * + * @Given /^I switch to the main frame$/ + */ + public function switch_to_the_main_frame() { + $this->getSession()->switchToIFrame(); + } + /** * Switches to the specified window. Useful when interacting with popup windows. * diff --git a/mod/scorm/tests/behat/add_scorm.feature b/mod/scorm/tests/behat/add_scorm.feature index f9196b23694..91ca10d0bd9 100644 --- a/mod/scorm/tests/behat/add_scorm.feature +++ b/mod/scorm/tests/behat/add_scorm.feature @@ -35,4 +35,6 @@ Feature: Add scorm activity And I follow "Awesome SCORM package" And I should see "Normal" And I press "Enter" - And I should see "Golf Explained" + And I switch to "scorm_object" iframe + And I switch to "contentFrame" iframe + And I should see "Play of the game"