Cmcmahon has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/176063

Change subject: QA: refactor issues test
......................................................................

QA: refactor issues test

sort Scenarios, refactor steps, update for RSpec3

Change-Id: I5bf5cca4b60862b7f193a8f057fe2d06f3d96644
---
M tests/browser/features/issues.feature
M tests/browser/features/step_definitions/issues_steps.rb
2 files changed, 20 insertions(+), 21 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/63/176063/1

diff --git a/tests/browser/features/issues.feature 
b/tests/browser/features/issues.feature
index 841976d..776ef0d 100644
--- a/tests/browser/features/issues.feature
+++ b/tests/browser/features/issues.feature
@@ -4,25 +4,20 @@
   Background:
     Given I am using the mobile site
       And I am on a page which has cleanup templates
-
-  Scenario: I see the this page has issues stamp
-    Then I should see that this page has issues
+      And this page has issues
 
   Scenario: Clicking page issues opens overlay
-    Given I should see that this page has issues
     When I click the page issues stamp
-    Then I see the issues overlay
+    Then I should see the issues overlay
 
   Scenario: Closing page issues
-    Given I should see that this page has issues
-      And I click the page issues stamp
+    When I click the page issues stamp
       And I see the issues overlay
-    When I click the overlay issue close button
-    Then I don't see the issues overlay
+      And I click the overlay issue close button
+    Then I should not see the issues overlay
 
   Scenario: Closing page issues (browser back)
-    Given I should see that this page has issues
-      And I click the page issues stamp
+    When I click the page issues stamp
       And I see the issues overlay
-    When I click the browser back button
-    Then I don't see the issues overlay
+      And I click the browser back button
+    Then I should not see the issues overlay
diff --git a/tests/browser/features/step_definitions/issues_steps.rb 
b/tests/browser/features/step_definitions/issues_steps.rb
index dc08bc5..c9ed395 100644
--- a/tests/browser/features/step_definitions/issues_steps.rb
+++ b/tests/browser/features/step_definitions/issues_steps.rb
@@ -1,19 +1,23 @@
-Then(/^I should see that this page has issues$/) do
-  on(ArticlePage).issues_stamp_element.when_present.should be_visible
+When(/^I click the overlay issue close button$/) do
+  on(ArticlePage).overlay_close_button_element.when_present.click
 end
 
 When(/^I click the page issues stamp$/) do
   on(ArticlePage).issues_stamp_element.when_present.click
 end
 
-Then(/^I see the issues overlay$/) do
-  on(ArticlePage).overlay_element.when_present.should be_visible
+When(/^I see the issues overlay$/) do
+  on(ArticlePage).overlay_element.when_present
 end
 
-When(/^I click the overlay issue close button$/) do
-  on(ArticlePage).overlay_close_button_element.when_present.click
+When(/^this page has issues$/) do
+  on(ArticlePage).issues_stamp_element.when_present
 end
 
-Then(/^I don't see the issues overlay$/) do
-  on(ArticlePage).overlay_element.when_not_present(2)
+Then(/^I should not see the issues overlay$/) do
+  expect(on(ArticlePage).overlay_element).not_to be_visible
+end
+
+Then(/^I should see the issues overlay$/) do
+  expect(on(ArticlePage).overlay_element.when_present).to be_visible
 end

-- 
To view, visit https://gerrit.wikimedia.org/r/176063
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5bf5cca4b60862b7f193a8f057fe2d06f3d96644
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Cmcmahon <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to