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

Change subject: Porting file test from browsertests
......................................................................


Porting file test from browsertests

Testing in bare wiki, beta enwiki and hewiki

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

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



diff --git a/tests/browser/features/file.feature 
b/tests/browser/features/file.feature
new file mode 100644
index 0000000..2d3b708
--- /dev/null
+++ b/tests/browser/features/file.feature
@@ -0,0 +1,23 @@
+#
+# This file is subject to the license terms in the LICENSE file found in the
+# qa-browsertests top-level directory and at
+# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/LICENSE. No part of
+# qa-browsertests, including this file, may be copied, modified, propagated, or
+# distributed except according to the terms contained in the LICENSE file.
+#
+# Copyright 2012-2014 by the Mediawiki developers. See the CREDITS file in the
+# qa-browsertests top-level directory and at
+# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/CREDITS
+#
+@chrome @en.wikipedia.beta.wmflabs.org @firefox @internet_explorer_6 
@internet_explorer_7 @internet_explorer_8 @internet_explorer_9 
@internet_explorer_10 @phantomjs @test2.wikipedia.org
+Feature: File
+
+ Scenario: Anonymous goes to file that does not exist
+   Given I am at file that does not exist
+   Then page should show that no such file 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 should show that no such file exists
\ No newline at end of file
diff --git a/tests/browser/features/step_definitions/file_steps.rb 
b/tests/browser/features/step_definitions/file_steps.rb
new file mode 100644
index 0000000..a2ed1bf
--- /dev/null
+++ b/tests/browser/features/step_definitions/file_steps.rb
@@ -0,0 +1,18 @@
+#
+# This file is subject to the license terms in the LICENSE file found in the
+# qa-browsertests top-level directory and at
+# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/LICENSE. No part of
+# qa-browsertests, including this file, may be copied, modified, propagated, or
+# distributed except according to the terms contained in the LICENSE file.
+#
+# Copyright 2012-2014 by the Mediawiki developers. See the CREDITS file in the
+# qa-browsertests top-level directory and at
+# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/CREDITS
+#
+Given(/^I am at file that does not exist$/) do
+  visit(FileDoesNotExistPage, using_params: {page_name: @random_string})
+end
+
+Then(/^page should show that no such file exists$/) do
+  on(FileDoesNotExistPage).file_does_not_exist_message_element.should 
be_visible
+end
diff --git a/tests/browser/features/support/pages/file_does_not_exist_page.rb 
b/tests/browser/features/support/pages/file_does_not_exist_page.rb
new file mode 100644
index 0000000..c8491f3
--- /dev/null
+++ b/tests/browser/features/support/pages/file_does_not_exist_page.rb
@@ -0,0 +1,19 @@
+#
+# This file is subject to the license terms in the LICENSE file found in the
+# qa-browsertests top-level directory and at
+# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/LICENSE. No part of
+# qa-browsertests, including this file, may be copied, modified, propagated, or
+# distributed except according to the terms contained in the LICENSE file.
+#
+# Copyright 2012-2014 by the Mediawiki developers. See the CREDITS file in the
+# qa-browsertests top-level directory and at
+# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/CREDITS
+#
+class FileDoesNotExistPage
+  include PageObject
+
+  include URL
+  page_url URL.url("File:<%=params[:page_name]%>")
+
+  div(:file_does_not_exist_message, id: "mw-imagepage-nofile")
+end

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If8262a7798c19dad84f9ceb88a5e286a90cf2a39
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Cmcmahon <[email protected]>
Gerrit-Reviewer: CSteipp <[email protected]>
Gerrit-Reviewer: Dduvall <[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

Reply via email to