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