jenkins-bot has submitted this change and it was merged. Change subject: Hygiene: Consolidate steps for visiting pages ......................................................................
Hygiene: Consolidate steps for visiting pages Standardise on Given since this is not a user action. Nothing gets clicked. It just asserts you are on a certain page. Change-Id: I5ba3be985f2df5729e808d0152df1d8e67659821 --- M tests/browser/features/diff.feature M tests/browser/features/editor_ve.feature M tests/browser/features/footer.feature M tests/browser/features/keepgoing.feature M tests/browser/features/language.feature M tests/browser/features/language_logged_in.feature M tests/browser/features/login.feature M tests/browser/features/menu_opens_page.feature M tests/browser/features/pageactions_logged_in.feature M tests/browser/features/search.feature M tests/browser/features/step_definitions/common_steps.rb M tests/browser/features/uploads_lead.feature M tests/browser/features/uploads_lead_tutorial.feature M tests/browser/features/watchlist.feature M tests/browser/features/wikitext_editor.feature 15 files changed, 36 insertions(+), 44 deletions(-) Approvals: Kaldari: Looks good to me, approved jenkins-bot: Verified diff --git a/tests/browser/features/diff.feature b/tests/browser/features/diff.feature index e854e61..586df89 100644 --- a/tests/browser/features/diff.feature +++ b/tests/browser/features/diff.feature @@ -3,8 +3,8 @@ Scenario: Added and removed content Given I am logged into the mobile website - When I go to the "Diff test" page - And I click the edit button + And I am on the "Diff test" page + When I click the edit button And I clear the editor And I type "ABC DEF" into the editor And I click continue diff --git a/tests/browser/features/editor_ve.feature b/tests/browser/features/editor_ve.feature index 07e3ed3..6a6c63c 100644 --- a/tests/browser/features/editor_ve.feature +++ b/tests/browser/features/editor_ve.feature @@ -4,8 +4,8 @@ Scenario: Toolbar VisualEditor Given I am in alpha mode And I am logged into the mobile website - When I am on the Selenium Edit Test article - And I click the edit button + And I am on the "Selenium Edit Test" page + When I click the edit button Then I see the VisualEditor overlay And I see a toolbar in the overlay header And The VisualEditor toolbar has a bold button @@ -14,8 +14,8 @@ Scenario: I can edit a page using VisualEditor Given I am in alpha mode And I am logged into the mobile website - When I am on the Selenium Edit Test article - And I click the edit button + And I am on the "Selenium Edit Test" page + When I click the edit button And VisualEditor has loaded And I type "ABCDEFG" into VisualEditor And I click continue @@ -25,9 +25,9 @@ Scenario: Going back from save screen in VisualEditor Given I am in alpha mode And I am logged into the mobile website - When I am on the Selenium Edit Test article - And I click the edit button - And I type "ABCDEFG" into VisualEditor + And I am on the "Selenium Edit Test" page + When I click the edit button + And I type ABCDEFG into VisualEditor And I click continue And I click the escape button Then I see the VisualEditor diff --git a/tests/browser/features/footer.feature b/tests/browser/features/footer.feature index b0d6187..2ebee52 100644 --- a/tests/browser/features/footer.feature +++ b/tests/browser/features/footer.feature @@ -2,7 +2,7 @@ Feature: Footer links resolve Background: - Given I am on the home page + Given I am on the "Main Page" page Scenario: View Edit history link resolves When I click on the view edit history link diff --git a/tests/browser/features/keepgoing.feature b/tests/browser/features/keepgoing.feature index 7c4c929..b9ab39d 100644 --- a/tests/browser/features/keepgoing.feature +++ b/tests/browser/features/keepgoing.feature @@ -5,9 +5,9 @@ Scenario: I see a KeepGoing message after completing my edit Given I am in beta mode And I have just registered a new account - When I am on the Selenium Edit Test article - And I click the edit button - And I type "ABCDEFG" into the editor + And I am on the "Selenium Edit Test" page + When I click the edit button + And I type ABCDEFG into the editor And I click continue And I click submit Then I see the KeepGoing drawer prompting me to continue editing @@ -16,8 +16,8 @@ Scenario: I see a KeepGoing message after completing my VisualEditor edit Given I am in alpha mode And I have just registered a new account - When I am on the Selenium Edit Test article - And I click the edit button + And I am on the "Selenium Edit Test" page + When I click the edit button And I type ABCDEFG into VisualEditor And I click continue And I click submit diff --git a/tests/browser/features/language.feature b/tests/browser/features/language.feature index 861963a..ac2b3a4 100644 --- a/tests/browser/features/language.feature +++ b/tests/browser/features/language.feature @@ -3,7 +3,7 @@ Feature: Language selection Background: - Given I am on the home page + Given I am on the "Main Page" page When I click the language button Scenario: Opening language overlay diff --git a/tests/browser/features/language_logged_in.feature b/tests/browser/features/language_logged_in.feature index 64482f9..fbc21e1 100644 --- a/tests/browser/features/language_logged_in.feature +++ b/tests/browser/features/language_logged_in.feature @@ -3,7 +3,7 @@ Background: Given I am logged into the mobile website - And I am on the home page + And I am on the "Main Page" page Scenario: Validate Language selection availability When I click the language button diff --git a/tests/browser/features/login.feature b/tests/browser/features/login.feature index 3ac3a9b..63b76be 100644 --- a/tests/browser/features/login.feature +++ b/tests/browser/features/login.feature @@ -2,13 +2,13 @@ Feature: Login Scenario: Not logged in - Given I am not logged in - When I go to the login page + Given I am on the "Main Page" page + When I click on "Log in" in the main navigation menu Then I see a message box at the top of the login page And I do not see a message warning me I am already logged in Scenario: Already logged in Given I am logged into the mobile website - When I go to the login page + And I am on the "Special:UserLogin" page Then I do not see a message box at the top of the login page And I see a message warning me I am already logged in diff --git a/tests/browser/features/menu_opens_page.feature b/tests/browser/features/menu_opens_page.feature index 35a97a8..5276c75 100644 --- a/tests/browser/features/menu_opens_page.feature +++ b/tests/browser/features/menu_opens_page.feature @@ -2,7 +2,7 @@ Feature: Menus open correct page for anonymous users Background: - Given I am on the home page + Given I am on the "Main Page" page Scenario: Home URL is set correctly When I click on "Home" in the main navigation menu diff --git a/tests/browser/features/pageactions_logged_in.feature b/tests/browser/features/pageactions_logged_in.feature index 455e6e0..5ced0f0 100644 --- a/tests/browser/features/pageactions_logged_in.feature +++ b/tests/browser/features/pageactions_logged_in.feature @@ -3,7 +3,7 @@ Background: Given I am logged into the mobile website - And I am on the home page + And I am on the "Main Page" page Scenario: I can see the edit button on the Main Page Then I should see the edit icon diff --git a/tests/browser/features/search.feature b/tests/browser/features/search.feature index 45a1e09..78ebbbf 100644 --- a/tests/browser/features/search.feature +++ b/tests/browser/features/search.feature @@ -2,7 +2,7 @@ Feature: Search Background: - Given I am on the home page + Given I am on the "Main Page" page When I click the placeholder search box Scenario: Opening search @@ -11,12 +11,12 @@ Scenario: Closing search (overlay button) When I click the search overlay close button Then I don't see the search overlay - And I am on the home page + And the URL of of my page should contain "Main%20Page" Scenario: Closing search (browser button) When I click the browser back button Then I don't see the search overlay - And I am on the home page + And the URL of of my page should contain "Main%20Page" Scenario: Search for partial text When I type into search box "bara" diff --git a/tests/browser/features/step_definitions/common_steps.rb b/tests/browser/features/step_definitions/common_steps.rb index 593f702..9880dbb 100644 --- a/tests/browser/features/step_definitions/common_steps.rb +++ b/tests/browser/features/step_definitions/common_steps.rb @@ -38,7 +38,7 @@ page.password_field_element.when_present.send_keys(pwd) page.confirm_password_field_element.when_present.send_keys(pwd) page.sign_up_element.when_present.click - step 'I go to the "Special:UserLogout" page' + step 'I am on the "Special:UserLogout" page' visit(LoginPage) do |page| page.login_with(username, pwd) end @@ -97,16 +97,8 @@ visit(RandomPage) end -When(/^I go to the "(.+)" page$/) do |article| +Given(/^I am on the "(.+)" page$/) do |article| visit(ArticlePage, :using_params => {:article_name => article}) -end - -When /^I go to the login page$/ do - step 'I go to the "Special:Userlogin" page' -end - -When(/^I am on the home page$/) do - step 'I go to the "Main Page" page' end Then(/^the URL of of my page should contain "(.+)"$/) do |article| @@ -115,7 +107,7 @@ Given(/^I visit a protected page$/) do # FIXME: Assumes Barack Obama article is protected - step 'I am on the Barack_Obama article' + step 'I am on the "Barack_Obama" page' end When(/^I click the browser back button$/) do diff --git a/tests/browser/features/uploads_lead.feature b/tests/browser/features/uploads_lead.feature index bc34d88..ae6d1b9 100644 --- a/tests/browser/features/uploads_lead.feature +++ b/tests/browser/features/uploads_lead.feature @@ -3,8 +3,8 @@ Background: Given I am logged in as a user with a > 0 edit count - When I go to the "Nonexistent_page_abc" page - And I click the upload button to stage the image file "image.png" + And I am on the "Nonexistent_page_abc" page + When I click the upload button to stage the image file "image.png" Scenario: Opening upload preview Then I see the upload preview diff --git a/tests/browser/features/uploads_lead_tutorial.feature b/tests/browser/features/uploads_lead_tutorial.feature index 3a7c88d..05959ef 100644 --- a/tests/browser/features/uploads_lead_tutorial.feature +++ b/tests/browser/features/uploads_lead_tutorial.feature @@ -3,7 +3,7 @@ Background: Given I am logged in as a new user - When I go to the "Nonexistent_page_abc" page + And I am on the "Nonexistent_page_abc" page Scenario: There is an upload button Then There is an upload an image to this page button diff --git a/tests/browser/features/watchlist.feature b/tests/browser/features/watchlist.feature index 8cae042..84ae46f 100644 --- a/tests/browser/features/watchlist.feature +++ b/tests/browser/features/watchlist.feature @@ -10,7 +10,7 @@ Scenario: Add an article to the watchlist Given I am logged into the mobile website - When I go to the "Barack Obama" page + And I am on the "Barack Obama" page And I click the watch star Then I see a toast confirmation And I see a toast with message "Added Barack Obama to your watchlist" @@ -20,8 +20,8 @@ Given I am logged into the mobile website # FIXME: This assumes the scenario above has run and that the article is in fact watched # Add statement to ensure the Barack Obama article is already watched. - When I go to the "Barack Obama" page - And I click the watch star + And I am on the "Barack Obama" page + When I click the watch star Then I see a toast confirmation And I see a toast with message "Removed Barack Obama from your watchlist" And The watch star is not selected diff --git a/tests/browser/features/wikitext_editor.feature b/tests/browser/features/wikitext_editor.feature index a76039c..3c8708b 100644 --- a/tests/browser/features/wikitext_editor.feature +++ b/tests/browser/features/wikitext_editor.feature @@ -3,8 +3,8 @@ Background: Given I am logged into the mobile website - When I go to the "Nonexistent_page_ijewrcmhvg34773" page - And I click the edit button + And I am on the "Nonexistent_page_ijewrcmhvg34773" page + When I click the edit button Scenario: Opening editor Then I see the wikitext editor -- To view, visit https://gerrit.wikimedia.org/r/116871 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5ba3be985f2df5729e808d0152df1d8e67659821 Gerrit-PatchSet: 5 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: Jdlrobson <jrob...@wikimedia.org> Gerrit-Reviewer: Awjrichards <aricha...@wikimedia.org> Gerrit-Reviewer: Cmcmahon <cmcma...@wikimedia.org> Gerrit-Reviewer: JGonera <jgon...@wikimedia.org> Gerrit-Reviewer: Jdlrobson <jrob...@wikimedia.org> Gerrit-Reviewer: Kaldari <rkald...@wikimedia.org> Gerrit-Reviewer: Zfilipin <zfili...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits