2019-07-18 20:16:04 +00:00
|
|
|
class ArticlePage # rubocop:disable Metrics/ClassLength
|
2017-06-09 19:12:53 +00:00
|
|
|
include PageObject
|
|
|
|
|
|
|
|
page_url '<%=params[:article_name]%><%=params[:hash]%>'
|
|
|
|
|
|
|
|
# UI elements
|
|
|
|
a(:mainmenu_button, id: 'mw-mf-main-menu-button')
|
|
|
|
body(:is_authenticated, css: '.is-authenticated')
|
|
|
|
|
|
|
|
# pre-content
|
|
|
|
h1(:first_heading, id: 'section_0')
|
|
|
|
# standalone history link
|
|
|
|
a(:standalone_edit_history_link, css: '.last-modified-bar a')
|
|
|
|
# beta mode indicator
|
|
|
|
a(:beta_mode_indicator, css: '.branding-box sup')
|
|
|
|
|
|
|
|
# left nav
|
2019-02-27 13:23:15 +00:00
|
|
|
nav(:navigation, css: '#mw-mf-page-left')
|
2017-06-09 19:12:53 +00:00
|
|
|
a(:about_link) { |page| page.navigation_element.link_element(text: /^About/) }
|
|
|
|
a(:disclaimer_link) { |page| page.navigation_element.link_element(text: 'Disclaimers') }
|
|
|
|
|
|
|
|
# last modified bar
|
|
|
|
a(:last_modified_bar_history_link, href: /Special:History/)
|
|
|
|
a(:last_modified_bar_history_userpage_link, href: /User:/)
|
|
|
|
|
|
|
|
# page actions
|
|
|
|
## edit
|
|
|
|
li(:edit_button_holder, id: 'ca-edit')
|
|
|
|
a(:edit_button) do |page|
|
|
|
|
page.edit_button_holder_element.link_element(class: 'edit-page')
|
|
|
|
end
|
|
|
|
li(:upload_page_action, id: 'ca-upload')
|
|
|
|
|
|
|
|
a(:edit_link, text: 'Edit')
|
|
|
|
div(:anon_editor_warning, css: '.anon-msg')
|
|
|
|
div(:editor_overlay, class: 'editor-overlay')
|
|
|
|
button(:editor_overlay_close_button) do |page|
|
|
|
|
page.editor_overlay_element.button_element(css: '.cancel')
|
|
|
|
end
|
|
|
|
|
|
|
|
## upload
|
|
|
|
li(:upload_button, id: 'ca-upload')
|
|
|
|
file_field(:select_file, name: 'file', type: 'file')
|
|
|
|
div(:photo_overlay, class: 'photo-overlay')
|
|
|
|
button(:photo_overlay_close_button) do |page|
|
|
|
|
page.photo_overlay_element.button_element(class: 'cancel')
|
|
|
|
end
|
|
|
|
text_area(:photo_description) do |page|
|
|
|
|
page.photo_overlay_element.text_area_element(name: 'description')
|
|
|
|
end
|
|
|
|
a(:tutorial_link) do |page|
|
|
|
|
page.upload_button_element.link_element(href: '#/upload-tutorial/article')
|
|
|
|
end
|
|
|
|
|
|
|
|
## watch star
|
2019-10-29 19:48:53 +00:00
|
|
|
a(:watch_star, text: 'Watch')
|
2019-09-03 19:08:06 +00:00
|
|
|
a(:unwatch_star, text: 'Unwatch')
|
2017-06-09 19:12:53 +00:00
|
|
|
button(:watch_confirm, class: 'mw-htmlform-submit')
|
|
|
|
|
|
|
|
# search
|
|
|
|
button(:search_icon, css: '#searchIcon')
|
|
|
|
p(:search_within_pages, css: '.without-results')
|
|
|
|
div(:search_content_header, css: '.search-content')
|
|
|
|
text_field(:search_box_placeholder, name: 'search', index: 0)
|
|
|
|
text_field(:search_box2, name: 'search', index: 1)
|
|
|
|
li(:search_results, css: '.search-overlay .page-list li')
|
|
|
|
div(:search_watchstars, css: '.search-overlay .page-list li .watch-this-article')
|
2019-07-11 23:58:27 +00:00
|
|
|
div(:search_overlay, css: '.search-overlay')
|
2017-06-09 19:12:53 +00:00
|
|
|
button(:search_overlay_close_button) do |page|
|
2019-07-11 23:58:27 +00:00
|
|
|
page.search_overlay_element.button_element(css: '.header-action .cancel')
|
2017-06-09 19:12:53 +00:00
|
|
|
end
|
|
|
|
ul(:search_overlay_page_list) do |page|
|
|
|
|
page.search_overlay_element.element.ul(class: 'page-list thumbs actionable')
|
|
|
|
end
|
|
|
|
a(:search_result) do |page|
|
|
|
|
page.search_overlay_page_list_element.element.a
|
|
|
|
end
|
|
|
|
h3(:search_result_heading) do |page|
|
|
|
|
page.search_overlay_page_list_element.element.h3
|
|
|
|
end
|
|
|
|
|
2019-10-01 21:40:49 +00:00
|
|
|
div(:notifications_button, css: '#pt-notifications-alert')
|
2017-06-09 19:12:53 +00:00
|
|
|
div(:notifications_overlay, class: 'notifications-overlay')
|
|
|
|
button(:notifications_overlay_close_button) do |page|
|
|
|
|
page.notifications_overlay_element.button_element(class: 'cancel')
|
|
|
|
end
|
|
|
|
h2(:progress_header, class: 'uploading')
|
|
|
|
|
|
|
|
a(:image_link, class: 'image')
|
|
|
|
|
|
|
|
# page-actions
|
|
|
|
ul(:page_actions, id: 'page-actions')
|
|
|
|
a(:talk, css: '.talk')
|
|
|
|
a(:category, css: '.category-button')
|
|
|
|
a(:nearby_button, css: '#page-secondary-actions .nearby')
|
|
|
|
|
|
|
|
# wikidata descriptions
|
|
|
|
div(:wikidata_description, css: '.tagline')
|
|
|
|
|
|
|
|
# toc
|
2019-08-30 00:02:35 +00:00
|
|
|
div(:toc, css: '.toc')
|
2017-06-09 19:12:53 +00:00
|
|
|
|
|
|
|
# editor (common)
|
|
|
|
span(:overlay_editor_mode_switcher, css: '.editor-switcher .oo-ui-indicatorElement-indicator')
|
|
|
|
span(:source_editor_button, css: '.source-editor .oo-ui-icon-edit-source')
|
|
|
|
span(:visual_editor_button, css: '.visual-editor .oo-ui-icon-edit-ve')
|
|
|
|
|
|
|
|
# editor
|
|
|
|
textarea(:editor_textarea, class: 'wikitext-editor')
|
|
|
|
button(:escape_button, class: 'mw-ui-icon-back')
|
|
|
|
button(:continue_button, class: 'continue')
|
|
|
|
button(:submit_button, class: 'submit')
|
|
|
|
|
|
|
|
# drawer
|
|
|
|
div(:drawer, css: '.drawer.visible')
|
|
|
|
|
|
|
|
# overlay
|
|
|
|
div(:overlay, css: '.overlay')
|
|
|
|
button(:overlay_close_button) do |page|
|
|
|
|
page.overlay_element.button_element(class: 'cancel')
|
|
|
|
end
|
|
|
|
h2(:overlay_heading, css: '.overlay-title h2')
|
|
|
|
|
|
|
|
# category
|
|
|
|
li(:overlay_category_topic_item, css: '.topic-title-list li')
|
|
|
|
|
|
|
|
# visual editor
|
|
|
|
div(:overlay_ve, css: '.editor-overlay-ve')
|
|
|
|
div(:overlay_ve_header) do |page|
|
|
|
|
page.overlay_ve_element.div_element(css: '.overlay-header-container')
|
|
|
|
end
|
|
|
|
div(:overlay_ve_header_toolbar) do |page|
|
|
|
|
page.overlay_ve_header_element.div_element(css: '.oo-ui-toolbar-bar')
|
|
|
|
end
|
|
|
|
span(:overlay_ve_header_toolbar_bold_button) do |page|
|
|
|
|
page.overlay_ve_header_element.span_element(class: 'oo-ui-iconElement-icon oo-ui-icon-bold-b')
|
|
|
|
end
|
|
|
|
span(:overlay_ve_header_toolbar_italic_button) do |page|
|
|
|
|
page.overlay_ve_header_element.span_element(class: 'oo-ui-iconElement-icon oo-ui-icon-italic-i')
|
|
|
|
end
|
|
|
|
div(:editor_ve, css: '.ve-ce-documentNode')
|
|
|
|
div(:spinner_loading, class: 'spinner loading')
|
|
|
|
|
|
|
|
# toast
|
2018-08-28 14:46:15 +00:00
|
|
|
div(:notification_area, css: '.mw-notification-area')
|
2017-08-01 22:06:37 +00:00
|
|
|
div(:toast, css: '.mw-notification')
|
2017-06-09 19:12:53 +00:00
|
|
|
|
|
|
|
# loader
|
2018-08-15 23:13:02 +00:00
|
|
|
element(:content_wrapper, 'main')
|
2017-06-09 19:12:53 +00:00
|
|
|
div(:content, id: 'bodyContent')
|
2019-10-04 15:05:37 +00:00
|
|
|
a(:transparent_shield, css: '.mw-mf-page-center__mask')
|
2017-06-09 19:12:53 +00:00
|
|
|
# secondary menu
|
|
|
|
## languages
|
|
|
|
a(:switch_language_page_action, css: '#page-actions .language-selector')
|
|
|
|
a(:disabled_switch_langage_page_action, css: '#page-actions .language-selector.disabled')
|
|
|
|
# Can't use generic overlay class as this will match with the LoadingOverlay that shows before loading the language overlay
|
|
|
|
div(:overlay_languages, css: '.language-overlay')
|
|
|
|
a(:non_suggested_language_link, css: '.all-languages a', index: 0)
|
|
|
|
a(:suggested_language_link, css: '.suggested-languages a', index: 0)
|
|
|
|
|
|
|
|
# footer
|
|
|
|
a(:desktop_link, text: 'Desktop')
|
|
|
|
a(:terms_link, css: '#footer-places-terms-use')
|
|
|
|
a(:license_link, css: 'footer .license a')
|
|
|
|
a(:privacy_link, text: 'Privacy')
|
|
|
|
|
|
|
|
# pagelist
|
|
|
|
ul(:page_list, css: '.page-list')
|
|
|
|
|
|
|
|
# references
|
|
|
|
a(:reference, css: 'sup.reference a')
|
2019-05-03 19:54:11 +00:00
|
|
|
a(:nested_reference, css: '.drawer.references-drawer sup.reference a')
|
|
|
|
a(:reference_drawer, css: '.drawer.references-drawer')
|
2017-06-09 19:12:53 +00:00
|
|
|
|
|
|
|
# sections
|
|
|
|
h2(:first_section, css: '.section-heading', index: 0)
|
2019-12-19 19:32:49 +00:00
|
|
|
section(:first_section_content, id: 'content-collapsible-block-0')
|
2017-06-09 19:12:53 +00:00
|
|
|
h2(:third_section, css: '.collapsible-block', index: 2)
|
|
|
|
|
|
|
|
# issues
|
2018-11-14 00:17:49 +00:00
|
|
|
# We use 2 selectors here - the first relates to the old treatment (A) and
|
2019-01-08 19:52:36 +00:00
|
|
|
# the 2nd relates to the new treatment (.issues-group-B .ambox)
|
2018-11-14 00:17:49 +00:00
|
|
|
# see https://phabricator.wikimedia.org/T206647
|
2019-01-08 19:52:36 +00:00
|
|
|
a(:issues_stamp, css: '.mw-mf-cleanup, .issues-group-B .ambox')
|
2017-06-09 19:12:53 +00:00
|
|
|
|
|
|
|
# page info (action=info)
|
|
|
|
td(:edit_count, css: '#mw-pageinfo-edits td', index: 1)
|
|
|
|
|
|
|
|
# error and warning boxes
|
|
|
|
div(:warning_box, css: '.warning')
|
|
|
|
div(:error_message, css: '.error')
|
|
|
|
|
|
|
|
# talk overlay
|
2019-02-25 20:52:18 +00:00
|
|
|
a(:talkadd, css: '.talk-overlay .continue')
|
|
|
|
a(:talktopic_save, css: '.overlay .confirm-save')
|
2017-06-09 19:12:53 +00:00
|
|
|
p(:talk_overlay_content_header, css: '.talk-overlay .content-header')
|
|
|
|
li(:talk_overlay_first_topic_title, css: '.talk-overlay .topic-title-list li:first-child')
|
2019-03-01 17:37:53 +00:00
|
|
|
text_field(:talk_overlay_summary, css: '.talk-overlay input')
|
2019-04-29 21:24:16 +00:00
|
|
|
text_area(:talk_overlay_body, css: '.talk-overlay textarea')
|
2017-06-09 19:12:53 +00:00
|
|
|
button(:talk_overlay_save_button, css: '.talk-overlay .confirm-save')
|
|
|
|
end
|