Skip to content

Commit

Permalink
MDL-66818 mod_forum: remove unnecessary behat steps
Browse files Browse the repository at this point in the history
  • Loading branch information
lameze committed Aug 20, 2020
1 parent 4224b8e commit 7235771
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 26 deletions.
20 changes: 0 additions & 20 deletions lib/tests/behat/behat_forms.php
Expand Up @@ -56,26 +56,6 @@ public function press_button($button) {
$this->execute('behat_general::i_click_on', [$button, 'button']);
}

/**
* Ensure a button exists.
* @Then the button :button exists
* @param string $button
*/
public function button_exists(string $button) {
$buttonnode = $this->find_button($button);
$this->ensure_node_is_visible($buttonnode);
}

/**
* Ensure that a button does not exist.
* @Then the button :button does not exist
* @param string $button
*/
public function button_does_not_exist(string $button) {
$general = behat_context_helper::get('behat_general');
$general->should_not_exist($button, 'button');
}

/**
* Press button with specified id|name|title|alt|value and switch to main window.
*
Expand Down
12 changes: 6 additions & 6 deletions mod/forum/tests/behat/portfolio_export.feature
Expand Up @@ -13,7 +13,7 @@ Feature: Ensure only users with appropriate permissions can export forum discuss
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
@javascript

Scenario: A teacher can export discussions to a portfolio.
Given the following "activities" exist:
| activity | name | intro | course | idnumber | groupmode |
Expand All @@ -25,20 +25,20 @@ Feature: Ensure only users with appropriate permissions can export forum discuss
And I set portfolio instance "File download" to "Enabled and visible"
And I click on "Save" "button"
And I log out
And I log in as "student1"
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test forum 1"
And I add a new discussion to "Test forum 1" forum with:
| Subject | Discussion 1 |
| Message | Test post message |
And I reload the page
And I follow "Discussion 1"
And the button "Export whole discussion to portfolio" does not exist
Then "Export whole discussion to portfolio" "button" should not exist
And I log out
And I log in as "admin"
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test forum 1"
And I follow "Discussion 1"
And the button "Export whole discussion to portfolio" exists
And "Export whole discussion to portfolio" "button" should exist
And I press "Export whole discussion to portfolio"
Then I should see "Exporting to portfolio"
And I should see "Exporting to portfolio"

0 comments on commit 7235771

Please sign in to comment.