From 39c5dbc94ab126a543c97d55f589f74ae8bf1e72 Mon Sep 17 00:00:00 2001 From: Jdlrobson Date: Tue, 25 Sep 2018 15:46:12 +0000 Subject: [PATCH] Revert "Remove user page CTA edit link browser test (move to MobileFrontend)" This reverts commit 6daf19dfb57d8421eceb504722e061a9b5de448b. Mobilefrontend change was reverted meaning this test should be restored here so we continue to have coverage. Change-Id: I2e8eeacaf01aa61040405501d69f329fe3a9bbd6 --- .../features/step_definitions/user_page_steps.rb | 11 +++++++++++ tests/browser/features/support/pages/user_page.rb | 4 ++++ tests/browser/features/user_page.feature | 6 ++++++ 3 files changed, 21 insertions(+) diff --git a/tests/browser/features/step_definitions/user_page_steps.rb b/tests/browser/features/step_definitions/user_page_steps.rb index a10c0cd37..936ed1063 100644 --- a/tests/browser/features/step_definitions/user_page_steps.rb +++ b/tests/browser/features/step_definitions/user_page_steps.rb @@ -22,3 +22,14 @@ end Then(/^there should be a link to my uploads$/) do expect(on(UserPage).uploads_link_element).to be_visible end + +Then(/^there should be a link to create my user page$/) do + expect(on(UserPage).edit_link_element).to be_visible +end + +When(/^I click the create my user page link$/) do + on(UserPage) do |page| + page.wait_until_rl_module_ready('skins.minerva.editor') + page.edit_link_element.click + end +end diff --git a/tests/browser/features/support/pages/user_page.rb b/tests/browser/features/support/pages/user_page.rb index 1c82d8efa..77b0803b1 100644 --- a/tests/browser/features/support/pages/user_page.rb +++ b/tests/browser/features/support/pages/user_page.rb @@ -5,6 +5,7 @@ class UserPage < ArticlePage h1(:heading, css: '#section_0') ul(:user_links, css: '.user-links') + div(:cta_holder, css: '.cta-holder') a(:talk_link) do |page| page.user_links_element.element.a(href: /User_talk:/) end @@ -14,4 +15,7 @@ class UserPage < ArticlePage a(:uploads_link) do |page| page.user_links_element.element.a(href: /Special:Uploads\//) end + a(:edit_link) do |page| + page.cta_holder_element.element.a(href: %r{#/editor/0}) + end end diff --git a/tests/browser/features/user_page.feature b/tests/browser/features/user_page.feature index 4170a9ca4..3733318b4 100644 --- a/tests/browser/features/user_page.feature +++ b/tests/browser/features/user_page.feature @@ -11,3 +11,9 @@ Feature: User: And there should be a link to my talk page And there should be a link to my contributions And there should be a link to my uploads + + Scenario: Check user page is editable + And I should be on my user page + And there should be a link to create my user page + When I click the create my user page link + Then I see the wikitext editor overlay