jenkins-bot has submitted this change and it was merged.
Change subject: QA: refactor mainmenu_steps.rb file for Rspec etc
......................................................................
QA: refactor mainmenu_steps.rb file for Rspec etc
* also make the step that checks for link to user profile
actually do that
Change-Id: I06add3a6ce0f9a58bf9ab6883866544180bea64d
---
M tests/browser/features/mainmenu.feature
M tests/browser/features/mainmenu_loggedin.feature
M tests/browser/features/no_javascript_site.feature
M tests/browser/features/step_definitions/mainmenu_steps.rb
4 files changed, 35 insertions(+), 34 deletions(-)
Approvals:
Cmcmahon: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/browser/features/mainmenu.feature
b/tests/browser/features/mainmenu.feature
index 19c6b02..0607c3c 100644
--- a/tests/browser/features/mainmenu.feature
+++ b/tests/browser/features/mainmenu.feature
@@ -7,19 +7,19 @@
Scenario: Check links in menu
When I click on the main navigation button
- Then I see a link to the disclaimer
- And I see a link to the about page
- And I see a link to "Home" in the main navigation menu
- And I see a link to "Random" in the main navigation menu
- And I see a link to "Settings" in the main navigation menu
- And I see a link to "Watchlist" in the main navigation menu
- And I see a link to "Log in" in the main navigation menu
+ Then I should see a link to the disclaimer
+ And I should see a link to the about page
+ And I should see a link to "Home" in the main navigation menu
+ And I should see a link to "Random" in the main navigation menu
+ And I should see a link to "Settings" in the main navigation menu
+ And I should see a link to "Watchlist" in the main navigation menu
+ And I should see a link to "Log in" in the main navigation menu
@extension-geodata
Scenario: Nearby link in menu
Given at least one article with geodata exists
When I click on the main navigation button
- Then I see a link to "Nearby" in the main navigation menu
+ Then I should see a link to "Nearby" in the main navigation menu
Scenario: Watchlist URL is set correctly
When I click on "Watchlist" in the main navigation menu
diff --git a/tests/browser/features/mainmenu_loggedin.feature
b/tests/browser/features/mainmenu_loggedin.feature
index 3f68b67..4a1d009 100644
--- a/tests/browser/features/mainmenu_loggedin.feature
+++ b/tests/browser/features/mainmenu_loggedin.feature
@@ -7,17 +7,17 @@
Scenario: Check links in menu
When I click on the main navigation button
- Then I see a link to the disclaimer
- And I see a link to "Log out" in the main navigation menu
- And I see a link to my user profile page in the main navigation menu
- And I see a link to the about page
- And I see a link to "Home" in the main navigation menu
- And I see a link to "Random" in the main navigation menu
- And I see a link to "Settings" in the main navigation menu
- And I see a link to "Watchlist" in the main navigation menu
+ Then I should see a link to the disclaimer
+ And I should see a link to "Log out" in the main navigation menu
+ And I should see a link to my user profile page in the main navigation
menu
+ And I should see a link to the about page
+ And I should see a link to "Home" in the main navigation menu
+ And I should see a link to "Random" in the main navigation menu
+ And I should see a link to "Settings" in the main navigation menu
+ And I should see a link to "Watchlist" in the main navigation menu
@extension-geodata
Scenario: Nearby link in menu
Given at least one article with geodata exists
When I click on the main navigation button
- Then I see a link to "Nearby" in the main navigation menu
+ Then I should see a link to "Nearby" in the main navigation menu
diff --git a/tests/browser/features/no_javascript_site.feature
b/tests/browser/features/no_javascript_site.feature
index 737661e..ce097e4 100644
--- a/tests/browser/features/no_javascript_site.feature
+++ b/tests/browser/features/no_javascript_site.feature
@@ -18,18 +18,18 @@
Scenario: Able to access left navigation in basic non-JavaScript site
When I click on "Random" in the main navigation menu
And I click on the main navigation button
- Then I see a link to "Home" in the main navigation menu
- And I see a link to "Random" in the main navigation menu
- And I see a link to "Settings" in the main navigation menu
- And I see a link to "Watchlist" in the main navigation menu
- And I see a link to "Log in" in the main navigation menu
- And I do not see a link to "Uploads" in the main navigation menu
+ Then I should see a link to "Home" in the main navigation menu
+ And I should see a link to "Random" in the main navigation menu
+ And I should see a link to "Settings" in the main navigation menu
+ And I should see a link to "Watchlist" in the main navigation menu
+ And I should see a link to "Log in" in the main navigation menu
+ And I should not see a link to "Uploads" in the main navigation menu
@extension-geodata
Scenario: Nearby link not present in main navigation menu
When I click on "Random" in the main navigation menu
And I click on the main navigation button
- Then I do not see a link to "Nearby" in the main navigation menu
+ Then I should not see a link to "Nearby" in the main navigation menu
Scenario: Search with JavaScript disabled
Given the page "Selenium search test" exists
diff --git a/tests/browser/features/step_definitions/mainmenu_steps.rb
b/tests/browser/features/step_definitions/mainmenu_steps.rb
index 141830d..55497ca 100644
--- a/tests/browser/features/step_definitions/mainmenu_steps.rb
+++ b/tests/browser/features/step_definitions/mainmenu_steps.rb
@@ -7,22 +7,23 @@
on(ArticlePage).navigation_element.link_element(text:
text).when_visible.click
end
-Then(/^I see a link to "(.*?)" in the main navigation menu$/) do |text|
- on(ArticlePage).navigation_element.link_element(text: text).should be_visible
+Then(/^I should see a link to "(.*?)" in the main navigation menu$/) do |text|
+ expect(on(ArticlePage).navigation_element.link_element(text: text)).to
be_visible
end
-Then(/^I do not see a link to "(.*?)" in the main navigation menu$/) do |text|
- on(ArticlePage).navigation_element.link_element(text: text).should_not
be_visible
+Then(/^I should not see a link to "(.*?)" in the main navigation menu$/) do
|text|
+ expect(on(ArticlePage).navigation_element.link_element(text: text)).not_to
be_visible
end
-Then(/^I see a link to the about page$/) do
- on(ArticlePage).about_link_element.should be_visible
+Then(/^I should see a link to the about page$/) do
+ expect(on(ArticlePage).about_link_element).to be_visible
end
-Then(/^I see a link to the disclaimer$/) do
- on(ArticlePage).disclaimer_link_element.should be_visible
+Then(/^I should see a link to the disclaimer$/) do
+ expect(on(ArticlePage).disclaimer_link_element).to be_visible
end
-Then(/^I see a link to my user profile page in the main navigation menu$/) do
- on(ArticlePage).navigation_element.link_element(text:
ENV["MEDIAWIKI_USER"]).should_not be_visible
+Then(/^I should see a link to my user profile page in the main navigation
menu$/) do
+ user_link_text = ENV['MEDIAWIKI_USER'].gsub('_', ' ')
+ expect(on(ArticlePage).navigation_element.link_element(href:
/UserProfile\/#{ENV['MEDIAWIKI_USER']}/, text: user_link_text)).to be_visible
end
--
To view, visit https://gerrit.wikimedia.org/r/177243
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I06add3a6ce0f9a58bf9ab6883866544180bea64d
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Cmcmahon <[email protected]>
Gerrit-Reviewer: Awjrichards <[email protected]>
Gerrit-Reviewer: Cmcmahon <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits