summaryrefslogtreecommitdiff
path: root/tests/browser/features/support
diff options
context:
space:
mode:
Diffstat (limited to 'tests/browser/features/support')
-rw-r--r--tests/browser/features/support/env.rb2
-rw-r--r--tests/browser/features/support/hooks.rb2
-rw-r--r--tests/browser/features/support/modules/url_module.rb10
-rw-r--r--tests/browser/features/support/pages/create_account_page.rb19
-rw-r--r--tests/browser/features/support/pages/edit_page.rb8
-rw-r--r--tests/browser/features/support/pages/file_does_not_exist_page.rb19
-rw-r--r--tests/browser/features/support/pages/login_error_page.rb5
-rw-r--r--tests/browser/features/support/pages/main_page.rb19
-rw-r--r--tests/browser/features/support/pages/preferences_appearance_page.rb41
-rw-r--r--tests/browser/features/support/pages/preferences_editing_page.rb28
-rw-r--r--tests/browser/features/support/pages/preferences_page.rb22
-rw-r--r--tests/browser/features/support/pages/preferences_user_profile_page.rb28
-rw-r--r--tests/browser/features/support/pages/view_history_page.rb7
-rw-r--r--tests/browser/features/support/pages/ztargetpage.rb7
14 files changed, 217 insertions, 0 deletions
diff --git a/tests/browser/features/support/env.rb b/tests/browser/features/support/env.rb
new file mode 100644
index 00000000..7c122366
--- /dev/null
+++ b/tests/browser/features/support/env.rb
@@ -0,0 +1,2 @@
+require "mediawiki_api"
+require "mediawiki_selenium"
diff --git a/tests/browser/features/support/hooks.rb b/tests/browser/features/support/hooks.rb
new file mode 100644
index 00000000..85309f39
--- /dev/null
+++ b/tests/browser/features/support/hooks.rb
@@ -0,0 +1,2 @@
+# Needed for cucumber --dry-run -f stepdefs
+require 'page-object'
diff --git a/tests/browser/features/support/modules/url_module.rb b/tests/browser/features/support/modules/url_module.rb
new file mode 100644
index 00000000..6c329e87
--- /dev/null
+++ b/tests/browser/features/support/modules/url_module.rb
@@ -0,0 +1,10 @@
+module URL
+ def self.url(name)
+ if ENV["MEDIAWIKI_URL"]
+ mediawiki_url = ENV["MEDIAWIKI_URL"]
+ else
+ mediawiki_url = "http://127.0.0.1:80/w/index.php"
+ end
+ "#{mediawiki_url}#{name}"
+ end
+end
diff --git a/tests/browser/features/support/pages/create_account_page.rb b/tests/browser/features/support/pages/create_account_page.rb
new file mode 100644
index 00000000..380bccbc
--- /dev/null
+++ b/tests/browser/features/support/pages/create_account_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 CreateAccountPage
+ include PageObject
+
+ include URL
+ page_url URL.url("<%=params[:page_title]%>")
+
+ button(:create_account, id: "wpCreateaccount")
+end
diff --git a/tests/browser/features/support/pages/edit_page.rb b/tests/browser/features/support/pages/edit_page.rb
new file mode 100644
index 00000000..b619c342
--- /dev/null
+++ b/tests/browser/features/support/pages/edit_page.rb
@@ -0,0 +1,8 @@
+class EditPage
+ include PageObject
+
+ text_area(:edit_page_content, id: "wpTextbox1")
+ button(:preview_button, id: "wpPreview")
+ button(:show_changes_button, id: "wpDiff")
+ button(:save_button, id: "wpSave")
+end \ No newline at end of file
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 00000000..c8491f3b
--- /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
diff --git a/tests/browser/features/support/pages/login_error_page.rb b/tests/browser/features/support/pages/login_error_page.rb
new file mode 100644
index 00000000..4fc9ca7f
--- /dev/null
+++ b/tests/browser/features/support/pages/login_error_page.rb
@@ -0,0 +1,5 @@
+class LoginErrorPage
+ include PageObject
+
+ div(:error_box, class: "errorbox")
+end \ No newline at end of file
diff --git a/tests/browser/features/support/pages/main_page.rb b/tests/browser/features/support/pages/main_page.rb
new file mode 100644
index 00000000..7d96c2b2
--- /dev/null
+++ b/tests/browser/features/support/pages/main_page.rb
@@ -0,0 +1,19 @@
+class MainPage
+ include PageObject
+
+ include URL
+ page_url URL.url("")
+
+ a(:edit_link, href: /action=edit/)
+ li(:help_link, id: "n-help")
+ div(:page_content, id: "content")
+ li(:page_information_link, id: "t-info")
+ li(:permanent_link_link, id: "t-permalink")
+ a(:printable_version_link, href: /printable=yes/)
+ li(:random_page_link, id: "n-randompage")
+ li(:recent_changes_link, id: "n-recentchanges")
+ li(:related_changes_link, id: "t-recentchangeslinked")
+ li(:special_pages_link, id: "t-specialpages")
+ a(:view_history_link, href: /action=history/)
+ li(:what_links_here_link, id: "t-whatlinkshere")
+end \ No newline at end of file
diff --git a/tests/browser/features/support/pages/preferences_appearance_page.rb b/tests/browser/features/support/pages/preferences_appearance_page.rb
new file mode 100644
index 00000000..c24e3862
--- /dev/null
+++ b/tests/browser/features/support/pages/preferences_appearance_page.rb
@@ -0,0 +1,41 @@
+#
+# 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 PreferencesAppearancePage
+ include PageObject
+
+ include URL
+ page_url URL.url("Special:Preferences#mw-prefsection-rendering")
+
+ checkbox(:auto_number_check, id: "mw-input-wpnumberheadings")
+ radio_button(:cologne_blue, id: "mw-input-wpskin-cologneblue")
+ radio_button(:day_mo_year_radio, id: "mw-input-wpdate-dmy")
+ checkbox(:dont_show_aft_check, id: "mw-input-wparticlefeedback-disable")
+ checkbox(:exclude_from_experiments_check, id: "mw-input-wpvector-noexperiments")
+ checkbox(:hidden_categories_check, id: "mw-input-wpshowhiddencats")
+ radio_button(:iso_8601_radio, id: "mw-input-wpdate-ISO_8601")
+ span(:local_time_span, id: "wpLocalTime")
+ radio_button(:mo_day_year_radio, id: "mw-input-wpdate-mdy")
+ radio_button(:modern, id: "mw-input-wpskin-modern")
+ radio_button(:monobook, id: "mw-input-wpskin-monobook")
+ radio_button(:no_preference_radio, id: "mw-input-wpdate-default")
+ text_field(:other_offset, id: "mw-input-wptimecorrection-other")
+ a(:restore_default_link, href: /reset/)
+ select_list(:size_select, id: "mw-input-wpimagesize")
+ select_list(:threshold_select, id: "mw-input-wpstubthreshold")
+ select_list(:time_offset_select, id: "mw-input-wptimecorrection")
+ table(:time_offset_table, id: "mw-htmlform-timeoffset")
+ select_list(:thumb_select, id: "mw-input-wpthumbsize")
+ select_list(:underline_select, id: "mw-input-wpunderline")
+ radio_button(:vector, id: "mw-input-wpskin-vector")
+ radio_button(:year_mo_day_radio, id: "mw-input-wpdate-ymd")
+end
+
diff --git a/tests/browser/features/support/pages/preferences_editing_page.rb b/tests/browser/features/support/pages/preferences_editing_page.rb
new file mode 100644
index 00000000..aed9c41d
--- /dev/null
+++ b/tests/browser/features/support/pages/preferences_editing_page.rb
@@ -0,0 +1,28 @@
+#
+# 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 PreferencesEditingPage
+ include PageObject
+
+ include URL
+ page_url URL.url("Special:Preferences#mw-prefsection-rendering")
+
+ select_list(:edit_area_font_style_select, id: "mw-input-wpeditfont")
+ checkbox(:edit_section_double_click_check, id: "mw-input-wpeditondblclick")
+ checkbox(:edit_section_edit_link, id: "mw-input-wpeditsectiononrightclick")
+ checkbox(:edit_section_right_click_check, id: "mw-input-wpeditsectiononrightclick")
+ checkbox(:forced_edit_summary_check, id: "mw-input-wpforceeditsummary")
+ checkbox(:live_preview_check, id: "mw-input-wpuselivepreview")
+ checkbox(:preview_on_first_check, id: "mw-input-wppreviewonfirst")
+ checkbox(:preview_on_top_check, id: "mw-input-wppreviewontop")
+ checkbox(:show_edit_toolbar_check, id: "mw-input-wpshowtoolbar")
+ checkbox(:unsaved_changes_check, id: "mw-input-wpuseeditwarning")
+end
diff --git a/tests/browser/features/support/pages/preferences_page.rb b/tests/browser/features/support/pages/preferences_page.rb
new file mode 100644
index 00000000..919ba27f
--- /dev/null
+++ b/tests/browser/features/support/pages/preferences_page.rb
@@ -0,0 +1,22 @@
+#
+# 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 PreferencesPage
+ include PageObject
+
+ include URL
+ page_url URL.url("Special:Preferences")
+
+ a(:appearance_link, id: "preftab-rendering")
+ a(:editing_link, id: "preftab-editing")
+ a(:user_profile_link, id: "preftab-personal")
+ button(:save_button, id: "prefcontrol")
+end
diff --git a/tests/browser/features/support/pages/preferences_user_profile_page.rb b/tests/browser/features/support/pages/preferences_user_profile_page.rb
new file mode 100644
index 00000000..28e10b97
--- /dev/null
+++ b/tests/browser/features/support/pages/preferences_user_profile_page.rb
@@ -0,0 +1,28 @@
+#
+# 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 PreferencesUserProfilePage
+ include PageObject
+
+ include URL
+ page_url URL.url("Special:Preferences#mw-prefsection-personal")
+
+ table(:basic_info_table, id: "mw-htmlform-info")
+ link(:change_password_link, text: "Change password")
+ table(:email_table, id: "mw-htmlform-email")
+ radio_button(:gender_female_radio, id: "mw-input-wpgender-male")
+ radio_button(:gender_male_radio, id: "mw-input-wpgender-female")
+ radio_button(:gender_undefined_radio, id: "mw-input-wpgender-unknown")
+ select_list(:lang_select, id: "mw-input-wplanguage")
+ checkbox(:remember_password_check, id: "mw-input-wprememberpassword")
+ text_field(:signature_field, id: "mw-input-wpnickname")
+ table(:signature_table, id: "mw-htmlform-signature")
+end
diff --git a/tests/browser/features/support/pages/view_history_page.rb b/tests/browser/features/support/pages/view_history_page.rb
new file mode 100644
index 00000000..66895986
--- /dev/null
+++ b/tests/browser/features/support/pages/view_history_page.rb
@@ -0,0 +1,7 @@
+class ViewHistoryPage
+ include PageObject
+
+ a(:view_history_link, href: /action=history/)
+ a(:old_version_link, href: /oldid=/)
+
+end \ No newline at end of file
diff --git a/tests/browser/features/support/pages/ztargetpage.rb b/tests/browser/features/support/pages/ztargetpage.rb
new file mode 100644
index 00000000..c1f46eca
--- /dev/null
+++ b/tests/browser/features/support/pages/ztargetpage.rb
@@ -0,0 +1,7 @@
+class ZtargetPage < MainPage
+ include URL
+ page_url URL.url("<%=params[:article_name]%>")
+ include PageObject
+
+ a(:link_target_page_link, text: "link to the test target page")
+end \ No newline at end of file