Robmoen has uploaded a new change for review.
https://gerrit.wikimedia.org/r/222479
Change subject: Add tests
......................................................................
Add tests
Change-Id: Icad09b2bc18575bf0678fec5dc0f1c7db12ed893
---
M tests/browser/features/edit_collection.feature
M tests/browser/features/step_definitions/edit_collection_steps.rb
M tests/browser/features/support/pages/gather_page.rb
3 files changed, 31 insertions(+), 3 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Gather
refs/changes/79/222479/1
diff --git a/tests/browser/features/edit_collection.feature
b/tests/browser/features/edit_collection.feature
index cdf5738..e6377d5 100644
--- a/tests/browser/features/edit_collection.feature
+++ b/tests/browser/features/edit_collection.feature
@@ -13,13 +13,25 @@
Scenario: Clicking edit button
When I click the edit collection button
Then I see the collection editor overlay
+@runme
+ Scenario: Changing name
+ When I click the edit collection button
+ And I see the collection editor overlay
+ And I click to edit name and description
+ And I enter "Things I think are cool" as the name
+ And I click to save settings
+ And I wait
+ And I click done
+ And the page has reloaded
+ Then the name of my collection is "Things I think are cool"
+ And I see "Things_I_think_are_cool" in the page url
Scenario: Changing description
When I click the edit collection button
And I see the collection editor overlay
And I click to edit name and description
And I enter "All work and no play makes Jack a dull boy" as the
description
- And I click to save description
+ And I click to save settings
And I wait
And I click done
And the page has reloaded
@@ -30,7 +42,7 @@
And I see the collection editor overlay
And I click to edit name and description
And I enter "" as the description
- And I click to save description
+ And I click to save settings
And I wait
And I click done
And the page has reloaded
diff --git a/tests/browser/features/step_definitions/edit_collection_steps.rb
b/tests/browser/features/step_definitions/edit_collection_steps.rb
index 27aae7e..f7f1c79 100644
--- a/tests/browser/features/step_definitions/edit_collection_steps.rb
+++ b/tests/browser/features/step_definitions/edit_collection_steps.rb
@@ -10,6 +10,11 @@
expect(on(GatherPage).edit_overlay_element.when_present).to be_visible
end
+Then(/^I enter "(.*?)" as the name$/) do |keys|
+ on(GatherPage).edit_overlay_title_element.when_present.clear
+ on(GatherPage).edit_overlay_title_element.when_present.send_keys(keys)
+end
+
Then(/^I enter "(.*?)" as the description$/) do |keys|
on(GatherPage).edit_overlay_description_element.when_present.clear
on(GatherPage).edit_overlay_description_element.when_present.send_keys(keys)
@@ -19,7 +24,7 @@
on(GatherPage).edit_overlay_done_element.when_present.click
end
-Then(/^I click to save description$/) do
+Then(/^I click to save settings$/) do
on(GatherPage).edit_overlay_save_desc_element.when_present.click
end
@@ -27,6 +32,15 @@
sleep 5
end
+Then(/^I see "(.*?)" in the page url$/) do |text|
+ request.request_uri.should == send("#{text.gsub(' ','_')}_path")
+ response.should be_success
+end
+
+Then(/^the name of my collection is "(.*?)"$/) do |text|
+ expect(on(GatherPage).collection_title_element.when_present.text).to eq text
+end
+
Then(/^the description of my collection is "(.*?)"$/) do |text|
expect(on(GatherPage).collection_description_element.when_present.text).to
eq text
end
diff --git a/tests/browser/features/support/pages/gather_page.rb
b/tests/browser/features/support/pages/gather_page.rb
index 4622ad8..de01127 100644
--- a/tests/browser/features/support/pages/gather_page.rb
+++ b/tests/browser/features/support/pages/gather_page.rb
@@ -5,12 +5,14 @@
a(:my_first_public_collection, css: '.collection-card-title a', index:1)
a(:edit, css: '.edit-collection')
div(:edit_overlay, css: '.collection-editor-overlay')
+ text_field(:edit_overlay_title, css: '.collection-editor-overlay .title')
textarea(:edit_overlay_description, css: '.collection-editor-overlay
.description')
button(:edit_overlay_save_desc,
css: '.collection-editor-overlay .save-description')
button(:edit_overlay_done,
css: '.collection-editor-overlay .save')
div(:collection_items, css: '.collection-cards')
+ h1(:collection_title, css: '.collection-header h1')
div(:collection_description, css: '.collection-description')
button(:edit_name_and_description, css: '.settings-action')
end
--
To view, visit https://gerrit.wikimedia.org/r/222479
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Icad09b2bc18575bf0678fec5dc0f1c7db12ed893
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Gather
Gerrit-Branch: master
Gerrit-Owner: Robmoen <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits