Fix e2e specs that create projects vi UI

Introduce NewExperiment page and
go_to_create_project_from_template project flow
parent f08b4a7e
......@@ -32,6 +32,7 @@ export default {
v-for="panel in panels"
:key="panel.name"
:href="`#${panel.name}`"
:data-qa-selector="`${panel.name}_link`"
class="blank-state blank-state-link experiment-new-project-page-blank-state"
@click="track('click_tab', { label: panel.name })"
>
......
......@@ -231,6 +231,7 @@ module QA
module Project
autoload :New, 'qa/page/project/new'
autoload :NewExperiment, 'qa/page/project/new_experiment'
autoload :Show, 'qa/page/project/show'
autoload :Activity, 'qa/page/project/activity'
autoload :Menu, 'qa/page/project/menu'
......
......@@ -31,12 +31,10 @@ module QA
end
def go_to_create_from_template_group_tab
click_create_from_template_tab
click_element(:group_templates_tab)
end
def go_to_create_from_template_instance_tab
click_create_from_template_tab
click_element(:instance_templates_tab)
end
......
......@@ -14,6 +14,14 @@ module QA
member_settings.add_member(username)
end
end
def go_to_create_project_from_template
if Page::Project::NewExperiment.perform(&:shown?)
Page::Project::NewExperiment.perform(&:click_create_from_template_link)
else
Page::Project::New.perform(&:click_create_from_template_tab)
end
end
end
end
end
# frozen_string_literal: true
module QA
module Page
module Project
class NewExperiment < Page::Base
view 'app/assets/javascripts/projects/experiment_new_project_creation/components/welcome.vue' do
element :blank_project_link, ':data-qa-selector="`${panel.name}_link`"' # rubocop:disable QA/ElementWithPattern
element :create_from_template_link, ':data-qa-selector="`${panel.name}_link`"' # rubocop:disable QA/ElementWithPattern
end
def shown?
has_element? :blank_project_link
end
def click_blank_project_link
click_element :blank_project_link
end
def click_create_from_template_link
click_element :create_from_template_link
end
end
end
end
end
......@@ -71,12 +71,14 @@ module QA
end
if @template_name
QA::Flow::Project.go_to_create_project_from_template
Page::Project::New.perform do |new_page|
new_page.click_create_from_template_tab
new_page.use_template_for_project(@template_name)
end
end
Page::Project::NewExperiment.perform(&:click_blank_project_link) if Page::Project::NewExperiment.perform(&:shown?)
Page::Project::New.perform do |new_page|
new_page.choose_test_namespace
new_page.choose_name(@name)
......
......@@ -47,9 +47,10 @@ module QA
@group.visit!
Page::Group::Show.perform(&:go_to_new_project)
Page::Project::New.perform do |new_page|
new_page.click_create_from_template_tab
QA::Flow::Project.go_to_create_project_from_template
Page::Project::New.perform do |new_page|
expect(new_page).to have_text(built_in)
end
......@@ -85,6 +86,8 @@ module QA
Page::Group::Show.perform(&:go_to_new_project)
QA::Flow::Project.go_to_create_project_from_template
Page::Project::New.perform(&:go_to_create_from_template_instance_tab)
end
......@@ -129,6 +132,8 @@ module QA
Page::Group::Show.perform(&:go_to_new_project)
QA::Flow::Project.go_to_create_project_from_template
Page::Project::New.perform(&:go_to_create_from_template_group_tab)
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment