From 8578e19affbd3e35a53facb5892e90d7eb0c8e93 Mon Sep 17 00:00:00 2001 From: Simey Lameze Date: Thu, 20 Aug 2020 07:43:18 +0800 Subject: [PATCH] MDL-66818 mod_forum: remove unnecessary behat steps --- lib/tests/behat/behat_forms.php | 20 ------------------- .../tests/behat/portfolio_export.feature | 12 +++++------ 2 files changed, 6 insertions(+), 26 deletions(-) diff --git a/lib/tests/behat/behat_forms.php b/lib/tests/behat/behat_forms.php index 25a1071f6a2..2532f943175 100644 --- a/lib/tests/behat/behat_forms.php +++ b/lib/tests/behat/behat_forms.php @@ -56,26 +56,6 @@ class behat_forms extends behat_base { $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. * diff --git a/mod/forum/tests/behat/portfolio_export.feature b/mod/forum/tests/behat/portfolio_export.feature index f6e60d27a5e..0bf6df2fea4 100644 --- a/mod/forum/tests/behat/portfolio_export.feature +++ b/mod/forum/tests/behat/portfolio_export.feature @@ -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 | @@ -25,7 +25,7 @@ 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: @@ -33,12 +33,12 @@ Feature: Ensure only users with appropriate permissions can export forum discuss | 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" -- 2.43.0