MDL-46641 behat: Delete activity step does not work without actions menu open

This commit is contained in:
Rex Lorenzo 2014-07-31 11:29:00 -07:00
parent d29fb4ac65
commit 84a1e50a9f
2 changed files with 6 additions and 7 deletions

View File

@ -697,12 +697,12 @@ class behat_course extends behat_base {
* @return Given[]
*/
public function i_delete_activity($activityname) {
$deletestring = get_string('delete');
$steps = array(
new Given('I click on "' . $this->escape($deletestring) . '" "link" in the "' . $this->escape($activityname) . '" activity')
);
$steps = array();
$activity = $this->escape($activityname);
if ($this->running_javascript()) {
$steps[] = new Given('I open "' . $activity . '" actions menu');
}
$steps[] = new Given('I click on "' . get_string('delete') . '" "link" in the "' . $activity . '" activity');
// JS enabled.
// Not using chain steps here because the exceptions catcher have problems detecting

View File

@ -67,7 +67,6 @@ Feature: Course activity controls works as expected
And I open "Test forum name 1" actions menu
And I click on "Hide" "link" in the "Test forum name 1" activity
And "#section-2" "css_element" <should_see_other_sections> exist
And I open "Test forum name 1" actions menu
And I delete "Test forum name 1" activity
And I should not see "Test forum name 1" in the "#region-main" "css_element"
And I duplicate "Test forum name 2" activity editing the new copy with: