From 8fe8df4a8b902fd77ccb0876ff66833c6dc5886d Mon Sep 17 00:00:00 2001 From: Rajesh Taneja Date: Wed, 14 Jan 2015 09:33:38 +0800 Subject: [PATCH] MDL-48624 behat: Added page load check in workshop step i_allocate_submissions_in_workshop_as step sometimes fails because of server speed. Added page load check with extended timout. --- .../tests/behat/behat_workshopallocation_manual.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/mod/workshop/allocation/manual/tests/behat/behat_workshopallocation_manual.php b/mod/workshop/allocation/manual/tests/behat/behat_workshopallocation_manual.php index 18579cbf806..9d86bd4b7a0 100644 --- a/mod/workshop/allocation/manual/tests/behat/behat_workshopallocation_manual.php +++ b/mod/workshop/allocation/manual/tests/behat/behat_workshopallocation_manual.php @@ -63,7 +63,7 @@ class behat_workshopallocation_manual extends behat_base { $this->find_button(get_string('showallparticipants', 'workshopallocation_manual'))->press(); $selectnode = $this->find('xpath', $xpathselect); } - $selectid = $selectnode->getAttribute('id'); + $selectformfield = behat_field_manager::get_form_field($selectnode, $this->getSession()); $selectformfield->set_value($reviewername); @@ -72,11 +72,13 @@ class behat_workshopallocation_manual extends behat_base { $go = $this->getSession()->getSelectorsHandler()->xpathLiteral(get_string('go')); $this->find('xpath', $xpathtd."/descendant::input[@value=$go]")->click(); } else { - // With Javascript we just wait for the page to reload and the success string to appear. - $allocatedtext = $this->getSession()->getSelectorsHandler()->xpathLiteral( - get_string('allocationadded', 'workshopallocation_manual')); - $this->find('xpath', "//*[contains(.,$allocatedtext)]"); + // With Javascript we just wait for the page to reload. + $this->getSession()->wait(self::EXTENDED_TIMEOUT, self::PAGE_READY_JS); } + // Check the success string to appear. + $allocatedtext = $this->getSession()->getSelectorsHandler()->xpathLiteral( + get_string('allocationadded', 'workshopallocation_manual')); + $this->find('xpath', "//*[contains(.,$allocatedtext)]"); } /**