MDL-38952 behat: Adding no-JS compatibility
This step is widely used by JS scenarios, with Javascript disabled this step fails tests as tree nodes al already expanded; we can reuse JS scenarios for no-JS tests skiping this step in no-JS mode.
This commit is contained in:
@@ -46,6 +46,13 @@ class behat_navigation extends behat_base {
|
||||
*/
|
||||
public function i_expand_node($nodetext) {
|
||||
|
||||
// This step is useless with Javascript disabled as Moodle auto expands
|
||||
// all of tree's nodes; adding this because of scenarios that shares the
|
||||
// same steps with and without Javascript enabled.
|
||||
if (!$this->running_javascript()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$xpath = "//ul[contains(concat(' ', normalize-space(@class), ' '), ' block_tree ')]
|
||||
/child::li
|
||||
/child::p[contains(concat(' ', normalize-space(@class), ' '), ' branch')]
|
||||
|
||||
Reference in New Issue
Block a user