Skip to content
Snippets Groups Projects
Commit 208ec9e1 authored by Tim Hunt's avatar Tim Hunt
Browse files

Fix the Behat tests for the latest filter changes.

parent 514a6023
No related branches found
No related tags found
No related merge requests found
......@@ -56,4 +56,15 @@ class behat_filter_jmol extends behat_base {
$generator->create_module('label', array('course' => $courseid, 'intro' => $link));
}
/**
* Switch to the first JMOL iframe on the page.
*
* @When /^I switch to the jmol iframe$/
*/
public function switch_to_jmol_iframe() {
$iframe = $this->find('xpath', '//iframe[starts-with(@id, "iframe") and contains(@src, "/filter/jmol/iframe.php")]');
$generalcontext = behat_context_helper::get('behat_general');
$generalcontext->switch_to_iframe($iframe->getAttribute('id'));
}
}
......@@ -17,5 +17,8 @@ Feature: Display molecules inline
@javascript
Scenario: Test the filter
When I follow "Course 1"
And I switch to the jmol iframe
And I click on "#jmolApplet0_coverdiv" "css_element"
Then "//canvas[starts-with(@id, 'jmol')]" "xpath_element" should exist
And I set the field "jmolMenu0" to "Spacefill"
And I set the field "display" to "Spacefill"
And I switch to the main frame
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment