jenkins-bot has submitted this change and it was merged.
Change subject: QA: Add browser test for acessing private collection
......................................................................
QA: Add browser test for acessing private collection
As an anonymous user.
Change-Id: I1cd1f3cbfe02e2a39c17b90039d876c3ec5469bb
---
M tests/browser/features/anonymous.feature
M tests/browser/features/step_definitions/anonymous_steps.rb
A tests/browser/features/support/pages/not_found_page.rb
A tests/browser/features/support/pages/watchlist_collection_page.rb
4 files changed, 27 insertions(+), 1 deletion(-)
Approvals:
Zfilipin: Looks good to me, but someone else must approve
Jdlrobson: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/browser/features/anonymous.feature
b/tests/browser/features/anonymous.feature
index 0e2fd71..a0a59de 100644
--- a/tests/browser/features/anonymous.feature
+++ b/tests/browser/features/anonymous.feature
@@ -1,6 +1,13 @@
Feature: Anonymous users accessing private pages
- Scenario:
+ Background:
Given I am not logged in
+
+ Scenario:
When I visit the Gather page
Then I see the login page
+
+ Scenario:
+ When I visit a private collection page
+ Then I see the error page
+
diff --git a/tests/browser/features/step_definitions/anonymous_steps.rb
b/tests/browser/features/step_definitions/anonymous_steps.rb
index 38cb3b3..6c52a06 100644
--- a/tests/browser/features/step_definitions/anonymous_steps.rb
+++ b/tests/browser/features/step_definitions/anonymous_steps.rb
@@ -5,7 +5,15 @@
visit(GatherPage)
end
+When(/^I visit a private collection page$/) do
+ visit(WatchlistCollectionPage)
+end
+
Then(/^I see the login page$/) do
expect(@browser.url).to match(/Special\:UserLogin/)
end
+Then(/^I see the error page$/) do
+ expect(on(NotFoundPage).title_element).to exist
+end
+
diff --git a/tests/browser/features/support/pages/not_found_page.rb
b/tests/browser/features/support/pages/not_found_page.rb
new file mode 100644
index 0000000..1ca61c3
--- /dev/null
+++ b/tests/browser/features/support/pages/not_found_page.rb
@@ -0,0 +1,5 @@
+class NotFoundPage
+ include PageObject
+
+ h1(:title, text: 'Error - Page not found')
+end
diff --git a/tests/browser/features/support/pages/watchlist_collection_page.rb
b/tests/browser/features/support/pages/watchlist_collection_page.rb
new file mode 100644
index 0000000..18d1058
--- /dev/null
+++ b/tests/browser/features/support/pages/watchlist_collection_page.rb
@@ -0,0 +1,6 @@
+class WatchlistCollectionPage
+ include PageObject
+ include URL
+
+ page_url URL.url('Special:Gather/User/0')
+end
--
To view, visit https://gerrit.wikimedia.org/r/192540
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I1cd1f3cbfe02e2a39c17b90039d876c3ec5469bb
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/Gather
Gerrit-Branch: master
Gerrit-Owner: Jhernandez <[email protected]>
Gerrit-Reviewer: Cmcmahon <[email protected]>
Gerrit-Reviewer: Dduvall <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: Zfilipin <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits