Changes in BEHAT in Moodle 3.2 (important! your existing tests will most likely start failing on Boost)

Re: Changes in BEHAT in Moodle 3.2 (important! your existing tests will most likely start failing on Boost)

de Mike Churchward -
Número de respuestas: 1
Imagen de Core developers Imagen de Plugin developers Imagen de Testers

Will the new steps, such as:

And I navigate to "Edit settings" in current page administration

also work with Clean?

En respuesta a Mike Churchward

Re: Changes in BEHAT in Moodle 3.2 (important! your existing tests will most likely start failing on Boost)

de Marina Glancy -
Imagen de Core developers Imagen de Moodle HQ Imagen de Moodle Workplace team Imagen de Peer reviewers Imagen de Plugin developers Imagen de Testers
Absolutely, on both 3.1 and 3.2

In case of non-boost theme this is what we do:
We find the first category in the Administration block (for example "Forum administraion"), get it's name and then execute step
I navigate to "Edit settings" node in "Forum administration"

This is the code:

public function i_navigate_to_in_current_page_administration($nodetext) {
$parentnodes = array_map('trim', explode('>', $nodetext));
// Find the name of the first category of the administration block tree.
$xpath = '//div[contains(@class,\'block_settings\')]//div[@id=\'settingsnav\']/ul/li[1]/p[1]/span';
$node = $this->find('xpath', $xpath);
// Add the name of the first category of the administration block tree to the path.
array_unshift($parentnodes, $node->getText());
$lastnode = array_pop($parentnodes);
// Execute the step "I navigate to ... node in the ...".
$this->select_node_in_navigation($lastnode, $parentnodes);
}




Adjunto administrationblock.png