jenkins-bot has submitted this change and it was merged.

Change subject: QA: Add edit collection browser tests
......................................................................


QA: Add edit collection browser tests

Bug: T93101
Change-Id: If2563fbfa06302eeef67f6ebddb38e0e3f479da4
---
A tests/browser/features/edit_collection.feature
M tests/browser/features/step_definitions/common_steps.rb
A tests/browser/features/step_definitions/edit_collection_steps.rb
M tests/browser/features/support/pages/gather_page.rb
4 files changed, 34 insertions(+), 0 deletions(-)

Approvals:
  Jhernandez: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/tests/browser/features/edit_collection.feature 
b/tests/browser/features/edit_collection.feature
new file mode 100644
index 0000000..702d27a
--- /dev/null
+++ b/tests/browser/features/edit_collection.feature
@@ -0,0 +1,15 @@
+@chrome @en.m.wikipedia.beta.wmflabs.org
+Feature: Editing collections
+
+  Background:
+    Given I am using the mobile site
+      And I am logged into the mobile website
+      And I am in alpha mode
+      And I view one of my public collections
+
+  Scenario: Edit button shown
+    Then I see edit collection button
+
+  Scenario: Clicking edit button
+    When I click the edit collection button
+    Then I see the collection editor overlay
diff --git a/tests/browser/features/step_definitions/common_steps.rb 
b/tests/browser/features/step_definitions/common_steps.rb
index 6e1e4f1..0a2f284 100644
--- a/tests/browser/features/step_definitions/common_steps.rb
+++ b/tests/browser/features/step_definitions/common_steps.rb
@@ -7,6 +7,11 @@
   end
 end
 
+Given(/^I view one of my public collections$/) do
+  visit(GatherPage)
+  on(GatherPage).my_first_public_collection_element.click
+end
+
 Given(/^I am logged into the mobile website$/) do
   step 'I am using the mobile site'
   visit(LoginPage).login_with(ENV['MEDIAWIKI_USER'], 
ENV['MEDIAWIKI_PASSWORD'], false)
diff --git a/tests/browser/features/step_definitions/edit_collection_steps.rb 
b/tests/browser/features/step_definitions/edit_collection_steps.rb
new file mode 100644
index 0000000..7345829
--- /dev/null
+++ b/tests/browser/features/step_definitions/edit_collection_steps.rb
@@ -0,0 +1,11 @@
+Then(/^I see edit collection button$/) do
+  expect(on(GatherPage).edit_element.when_present).to be_visible
+end
+
+When(/^I click the edit collection button$/) do
+  on(GatherPage).edit_element.click
+end
+
+Then(/^I see the collection editor overlay$/) do
+  expect(on(GatherPage).edit_overlay_element.when_present).to be_visible
+end
diff --git a/tests/browser/features/support/pages/gather_page.rb 
b/tests/browser/features/support/pages/gather_page.rb
index 18f40bc..5e12a37 100644
--- a/tests/browser/features/support/pages/gather_page.rb
+++ b/tests/browser/features/support/pages/gather_page.rb
@@ -3,4 +3,7 @@
   include URL
 
   page_url URL.url('Special:Gather')
+  a(:my_first_public_collection, css: '.collection-card-title a', index:1)
+  a(:edit, css: '.edit-collection')
+  div(:edit_overlay, css: '.collection-editor-overlay')
 end

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If2563fbfa06302eeef67f6ebddb38e0e3f479da4
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Gather
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
Gerrit-Reviewer: Jhernandez <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to