Commit e7e30637 authored by Mark Lapierre's avatar Mark Lapierre

Update quarantined test so that it runs

While working on another MR I noticed that this quarantined test had a
bug that caused it to report the wrong number of arguments when
calling `within_submenu`.

This changes fixes the test, although it stays in quarantine because
the issue for the bug in the application is still open.

This change also updates the block args so the cop doesn't have to
be disabled.
parent 9f097b59
......@@ -43,7 +43,7 @@ module QA
def go_to_template_settings
hover_element(:admin_settings_item) do
within_submenu do
within_submenu(:admin_sidebar_settings_submenu) do
click_element :admin_settings_template_item
end
end
......
......@@ -56,10 +56,10 @@ module QA
@group.visit!
Page::Group::Show.perform(&:go_to_new_project)
Page::Project::New.perform do |page| # rubocop:disable QA/AmbiguousPageObjectName
page.click_create_from_template_tab
Page::Project::New.perform do |new_page|
new_page.click_create_from_template_tab
expect(page).to have_text(built_in)
expect(new_page).to have_text(built_in)
end
create_project_using_template(project_name: 'Project using built-in project template',
......@@ -72,6 +72,7 @@ module QA
expect(page).to have_content(".ruby-version")
end
end
# Failure issue: https://gitlab.com/gitlab-org/quality/staging/issues/61
context 'instance level', :quarantine do
before do
......@@ -86,14 +87,14 @@ module QA
Page::Main::Menu.perform(&:click_admin_area)
Page::Admin::Menu.perform(&:go_to_template_settings)
Page::Admin::Settings::Templates.perform do |page| # rubocop:disable QA/AmbiguousPageObjectName
page.choose_custom_project_template("#{@template_container_group_name}")
EE::Page::Admin::Settings::Templates.perform do |templates|
templates.choose_custom_project_template("#{@template_container_group_name}")
end
Page::Admin::Menu.perform(&:go_to_template_settings)
Page::Admin::Settings::Templates.perform do |page| # rubocop:disable QA/AmbiguousPageObjectName
expect(page.current_custom_project_template).to include @template_container_group_name
EE::Page::Admin::Settings::Templates.perform do |templates|
expect(templates.current_custom_project_template).to include @template_container_group_name
end
group = Resource::Group.fabricate_via_api!
......@@ -105,9 +106,9 @@ module QA
end
it 'successfully imports the project using template' do
Page::Project::New.perform do |page| # rubocop:disable QA/AmbiguousPageObjectName
expect(page.instance_template_tab_badge_text).to eq "1"
expect(page).to have_text(@template_project.name)
Page::Project::New.perform do |new_page|
expect(new_page.instance_template_tab_badge_text).to eq "1"
expect(new_page).to have_text(@template_project.name)
end
create_project_using_template(project_name: 'Project using instance level project template',
......@@ -133,7 +134,7 @@ module QA
Page::Main::Login.perform(&:sign_in_using_credentials)
Page::Main::Menu.perform(&:go_to_groups)
Page::Dashboard::Groups.perform { |page| page.click_group(Runtime::Namespace.sandbox_name) } # rubocop:disable QA/AmbiguousPageObjectName
Page::Dashboard::Groups.perform { |groups| groups.click_group(Runtime::Namespace.sandbox_name) }
Page::Project::Menu.perform(&:click_settings)
Page::Group::Settings::General.perform do |settings|
......@@ -155,10 +156,10 @@ module QA
end
it 'successfully imports the project using template' do
Page::Project::New.perform do |page| # rubocop:disable QA/AmbiguousPageObjectName
expect(page.group_template_tab_badge_text).to eq "1"
expect(page).to have_text(@template_container_group_name)
expect(page).to have_text(@template_project.name)
Page::Project::New.perform do |new_page|
expect(new_page.group_template_tab_badge_text).to eq "1"
expect(new_page).to have_text(@template_container_group_name)
expect(new_page).to have_text(@template_project.name)
end
create_project_using_template(project_name: 'Project using group level project template',
......@@ -173,13 +174,13 @@ module QA
end
def create_project_using_template(project_name:, namespace:, template_name:)
Page::Project::New.perform do |page| # rubocop:disable QA/AmbiguousPageObjectName
page.use_template_for_project(template_name)
page.choose_namespace(namespace)
page.choose_name("#{project_name} #{SecureRandom.hex(8)}")
page.add_description("#{project_name}")
page.set_visibility('Public')
page.create_new_project
Page::Project::New.perform do |new_page|
new_page.use_template_for_project(template_name)
new_page.choose_namespace(namespace)
new_page.choose_name("#{project_name} #{SecureRandom.hex(8)}")
new_page.add_description("#{project_name}")
new_page.set_visibility('Public')
new_page.create_new_project
end
end
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