Zfilipin has submitted this change and it was merged.

Change subject: Adding basic 'file' feature, step defn, & class file
......................................................................


Adding basic 'file' feature, step defn, & class file

To improve the automated search testing, we'll need to
be able to check whether a particular file exists on the
target install.  Here's some bare-bones code to test MediaWiki's
behavior for when a file doesn't exist, both anon & logged-in.

Change-Id: I773483a0793b96b931e084ad74991a3a812db5b7
---
A features/file.feature
A features/step_definitions/file_steps.rb
A features/support/pages/file_does_not_exist_page.rb
3 files changed, 21 insertions(+), 0 deletions(-)

Approvals:
  Zfilipin: Verified; Looks good to me, approved



diff --git a/features/file.feature b/features/file.feature
new file mode 100644
index 0000000..b64730e
--- /dev/null
+++ b/features/file.feature
@@ -0,0 +1,11 @@
+Feature: File
+
+ Scenario: Anonymous goes to file that does not exist
+   Given I am at file that does not exist
+   Then page text should contain No file by this name exists.
+
+ @login
+ Scenario: Logged-in user goes to file that does not exist
+   Given I am logged in
+     And I am at file that does not exist
+   Then page text should contain No file by this name exists, but you can 
upload it.
diff --git a/features/step_definitions/file_steps.rb 
b/features/step_definitions/file_steps.rb
new file mode 100644
index 0000000..6702898
--- /dev/null
+++ b/features/step_definitions/file_steps.rb
@@ -0,0 +1,4 @@
+Given(/^I am at file that does not exist$/) do
+  visit FileDoesNotExistPage
+end
+
diff --git a/features/support/pages/file_does_not_exist_page.rb 
b/features/support/pages/file_does_not_exist_page.rb
new file mode 100644
index 0000000..4fdbdc9
--- /dev/null
+++ b/features/support/pages/file_does_not_exist_page.rb
@@ -0,0 +1,6 @@
+class FileDoesNotExistPage
+  include PageObject
+
+  page_url 'https://test2.wikipedia.org/wiki/File:Bleg.oggx'
+
+end

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I773483a0793b96b931e084ad74991a3a812db5b7
Gerrit-PatchSet: 1
Gerrit-Project: qa/browsertests
Gerrit-Branch: master
Gerrit-Owner: Sumanah <[email protected]>
Gerrit-Reviewer: Cmcmahon <[email protected]>
Gerrit-Reviewer: Zfilipin <[email protected]>

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

Reply via email to