jenkins-bot has submitted this change and it was merged.
Change subject: QA: update special_history and special_contributions tests
......................................................................
QA: update special_history and special_contributions tests
* RSpec3 syntax
* remove duplicate code
* remove unused code
Change-Id: Ieb425c442611a5970a158a46600854f432ce3c5a
---
M tests/browser/features/special_contributions.feature
M tests/browser/features/special_history.feature
M tests/browser/features/step_definitions/special_contributions_steps.rb
M tests/browser/features/step_definitions/special_history_steps.rb
M tests/browser/features/support/pages/special_history_page.rb
5 files changed, 48 insertions(+), 62 deletions(-)
Approvals:
Cmcmahon: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/browser/features/special_contributions.feature
b/tests/browser/features/special_contributions.feature
index 418d43d..20e6fc8 100644
--- a/tests/browser/features/special_contributions.feature
+++ b/tests/browser/features/special_contributions.feature
@@ -3,17 +3,16 @@
Background:
Given I am logged into the mobile website
- And I am on my contributions page
+ When I am on my contributions page
Scenario: Check components in diff summary
When I click the link in the header bar
Then I am on my user profile page
Scenario: Check components in diff summary
- Then I see a list of my contributions
- And I see a summary of my last contribution
- And the last contribution summary shows the title of the page edited
- And the last contribution summary shows the edit summary
- And the last contribution summary shows the time of the last edit
- And the last contribution summary does not show the username
-
+ Then I should see a list of page contributions
+ And I should see a summary of the last contribution
+ And the last contribution summary should show the title of the page
edited
+ And the last contribution summary should show the edit summary
+ And the last contribution summary should show the time of the last edit
+ And the last contribution summary should not show the username
diff --git a/tests/browser/features/special_history.feature
b/tests/browser/features/special_history.feature
index 8ee5a5f..76cd8d9 100644
--- a/tests/browser/features/special_history.feature
+++ b/tests/browser/features/special_history.feature
@@ -8,16 +8,16 @@
When I click on the history link in the last modified bar
Scenario: Check more button exists
- Then I see a more button
+ Then I should see a more button
Scenario: Check components in diff summary
When I click the link in the header bar
Then the text of the first heading should be "Selenium diff test"
Scenario: Check components in diff summary
- Then I see a list of page contributions
- And I see a summary of the last contribution to the page
- And the last contribution summary does not show the title of the page
edited
- And the last contribution summary shows the edit summary
- And the last contribution summary shows the time of the last edit
- And the last contribution summary shows the username who made the last
edit
+ Then I should see a list of page contributions
+ And I should see a summary of the last contribution
+ And the last contribution summary should not show the title of the page
edited
+ And the last contribution summary should show the edit summary
+ And the last contribution summary should show the time of the last edit
+ And the last contribution summary should show the username who made the
last edit
diff --git
a/tests/browser/features/step_definitions/special_contributions_steps.rb
b/tests/browser/features/step_definitions/special_contributions_steps.rb
index b89ac27..136485b 100644
--- a/tests/browser/features/step_definitions/special_contributions_steps.rb
+++ b/tests/browser/features/step_definitions/special_contributions_steps.rb
@@ -2,22 +2,22 @@
visit(SpecialContributionsPage)
end
-Then(/^I see a list of my contributions$/) do
- on(SpecialContributionsPage).side_list_element.should exist
-end
-
-Then(/^I see a summary of my last contribution$/) do
- on(SpecialContributionsPage).last_contribution_element.should exist
-end
-
When(/^I click the link in the header bar$/) do
on(SpecialContributionsPage).content_header_bar_link_element.click
end
-Then(/^the last contribution summary shows the title of the page edited$/) do
- on(SpecialContributionsPage).last_contribution_title_element.should exist
+Then(/^I should see a list of page contributions$/) do
+ expect(on(SpecialContributionsPage).side_list_element).to be_visible
end
-Then(/^the last contribution summary does not show the username$/) do
- on(SpecialHistoryPage).last_contribution_username_element.should_not exist
+Then(/^I should see a summary of the last contribution$/) do
+ expect(on(SpecialContributionsPage).last_contribution_element).to be_visible
+end
+
+Then(/^the last contribution summary should not show the username$/) do
+ expect(on(SpecialHistoryPage).last_contribution_username_element).not_to
be_visible
+end
+
+Then(/^the last contribution summary should show the title of the page
edited$/) do
+ expect(on(SpecialContributionsPage).last_contribution_title_element).to
be_visible
end
diff --git a/tests/browser/features/step_definitions/special_history_steps.rb
b/tests/browser/features/step_definitions/special_history_steps.rb
index 798a115..8076ce1 100644
--- a/tests/browser/features/step_definitions/special_history_steps.rb
+++ b/tests/browser/features/step_definitions/special_history_steps.rb
@@ -1,39 +1,27 @@
-When(/^I open the latest diff$/) do
- on(SpecialHistoryPage).last_contribution_link_element.click
-end
-
-Then(/^I see a list of page contributions$/) do
- on(SpecialHistoryPage).side_list_element.should exist
-end
-
-Then(/^I see a summary of the last contribution to the page$/) do
- on(SpecialHistoryPage).last_contribution_element.should exist
-end
-
-Then(/^the last contribution summary shows the username who made the last
edit$/) do
- on(SpecialHistoryPage).last_contribution_username_element.should exist
-end
-
-Then(/^the last contribution summary does not show the title of the page
edited$/) do
- on(SpecialHistoryPage).last_contribution_title_element.should_not exist
-end
-
-Then(/^the last contribution summary shows the edit summary$/) do
- on(SpecialHistoryPage).last_contribution_edit_summary_element.should exist
-end
-
-Then(/^the last contribution summary shows the time of the last edit$/) do
- on(SpecialHistoryPage).last_contribution_timestamp_element.should exist
-end
-
-Then(/^I see a more button$/) do
- on(SpecialHistoryPage).more_link_element.should exist
-end
-
When(/^I click the more link$/) do
on(SpecialHistoryPage).more_link_element.click
end
-Then(/^I see a previous button$/) do
- on(SpecialHistoryPage).previous_link_element.should exist
+When(/^I open the latest diff$/) do
+ on(SpecialHistoryPage).last_contribution_link_element.click
+end
+
+Then(/^I should see a more button$/) do
+ on(SpecialHistoryPage).more_link_element.should exist
+end
+
+Then(/^the last contribution summary should not show the title of the page
edited$/) do
+ on(SpecialHistoryPage).last_contribution_title_element.should_not exist
+end
+
+Then(/^the last contribution summary should show the edit summary$/) do
+ on(SpecialHistoryPage).last_contribution_edit_summary_element.should exist
+end
+
+Then(/^the last contribution summary should show the time of the last edit$/)
do
+ on(SpecialHistoryPage).last_contribution_timestamp_element.should exist
+end
+
+Then(/^the last contribution summary should show the username who made the
last edit$/) do
+ on(SpecialHistoryPage).last_contribution_username_element.should exist
end
diff --git a/tests/browser/features/support/pages/special_history_page.rb
b/tests/browser/features/support/pages/special_history_page.rb
index 6d93e7b..e68f5f3 100644
--- a/tests/browser/features/support/pages/special_history_page.rb
+++ b/tests/browser/features/support/pages/special_history_page.rb
@@ -27,7 +27,6 @@
page.last_contribution_element.paragraph_element(index: 0, css:
".mw-mf-user")
end
a(:more_link, css: ".more")
- a(:previous_link, css: ".previous")
end
class SpecialContributionsPage < SpecialHistoryPage
--
To view, visit https://gerrit.wikimedia.org/r/177317
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ieb425c442611a5970a158a46600854f432ce3c5a
Gerrit-PatchSet: 2
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