Skip to content

Commit

Permalink
MDL-69588 mod: Additional Behat step fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
junpataleta authored and Chocolate-lightning committed Aug 25, 2021
1 parent 89460a5 commit 300d0bc
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions mod/choice/tests/behat/behat_mod_choice.php
Expand Up @@ -46,7 +46,7 @@ class behat_mod_choice extends behat_base {
* @return array
*/
public function I_choose_option_from_activity($option, $choiceactivity) {
$this->execute("behat_navigation::go_to_breadcrumb_location", $this->escape($choiceactivity));
$this->execute('behat_navigation::i_am_on_page_instance', [$this->escape($choiceactivity), 'choice activity']);

$this->execute('behat_forms::i_set_the_field_to', array( $this->escape($option), 1));

Expand All @@ -68,7 +68,7 @@ public function I_choose_options_from_activity($option, $choiceactivity) {
$behatforms = behat_context_helper::get('behat_forms');

// Go to choice activity.
$this->execute("behat_navigation::go_to_breadcrumb_location", $this->escape($choiceactivity));
$this->execute("behat_navigation::i_am_on_page_instance", [$this->escape($choiceactivity), 'choice activity']);

// Wait for page to be loaded.
$this->wait_for_pending_js();
Expand Down
2 changes: 1 addition & 1 deletion mod/data/tests/behat/behat_mod_data.php
Expand Up @@ -48,7 +48,7 @@ class behat_mod_data extends behat_base {
* @param TableNode $fielddata
*/
public function i_add_a_field_to_database_and_i_fill_the_form_with($fieldtype, $activityname, TableNode $fielddata) {
$this->execute("behat_navigation::go_to_breadcrumb_location", $this->escape($activityname));
$this->execute('behat_navigation::i_am_on_page_instance', [$this->escape($activityname), 'data activity']);

// Open "Fields" tab if it is not already open.
$fieldsstr = get_string('fields', 'mod_data');
Expand Down
2 changes: 1 addition & 1 deletion mod/forum/tests/behat/behat_mod_forum.php
Expand Up @@ -474,7 +474,7 @@ protected function create_post_attachments(int $postid, int $userid, array $atta
*/
protected function add_new_discussion($forumname, TableNode $table, $buttonstr) {
// Navigate to forum.
$this->execute("behat_navigation::go_to_breadcrumb_location", $this->escape($forumname));
$this->execute('behat_navigation::i_am_on_page_instance', [$this->escape($forumname), 'forum activity']);
$this->execute('behat_general::click_link', $buttonstr);
$this->execute('behat_forms::press_button', get_string('showadvancededitor'));

Expand Down
2 changes: 1 addition & 1 deletion mod/workshop/tests/behat/behat_mod_workshop.php
Expand Up @@ -73,7 +73,7 @@ public function i_add_a_submission_in_workshop_as($workshopname, $table) {
$savechanges = $this->escape(get_string('savechanges'));
$xpath = "//div[contains(concat(' ', normalize-space(@class), ' '), ' ownsubmission ')]/descendant::*[@type='submit']";

$this->execute("behat_navigation::go_to_breadcrumb_location", $workshopname);
$this->execute("behat_navigation::i_am_on_page_instance", [$workshopname, 'workshop activity']);

$this->execute("behat_general::i_click_on", array($xpath, "xpath_element"));

Expand Down

0 comments on commit 300d0bc

Please sign in to comment.