mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
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:
parent
1091aca74f
commit
e6d18d9d00
1 changed files with 7 additions and 0 deletions
|
@ -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')]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue