Commit c8c32481 authored by Dan Davison's avatar Dan Davison

Merge branch '335045-fix-refactor-error' into 'master'

Fix import project CE vs EE

See merge request gitlab-org/gitlab!65996
parents f8645813 7313ac8c
......@@ -4,7 +4,7 @@
.form-check.gl-mb-3
= f.check_box :mirror_trigger_builds, check_box_options.merge(class: "form-check-input")
= f.label :mirror_trigger_builds, _("Trigger pipelines for mirror updates"), class: "form-check-label", data: { qa_selector: 'mirror_trigger_builds_label' }
= f.label :mirror_trigger_builds, _("Trigger pipelines for mirror updates"), class: "form-check-label"
.form-text.text-muted
= _('Trigger pipelines when branches or tags are updated in the upstream repository. Depending on the activity of the upstream repository, this may greatly increase the load on your CI runners. Only enable this if you know they can handle the load.')
%strong= _('CI will run using the credentials assigned above.')
......
......@@ -24,16 +24,8 @@ module QA
element :updating_button
element :copy_public_key_button
end
view 'ee/app/views/shared/_mirror_trigger_builds_setting.html.haml' do
element :mirror_trigger_builds_label
end
end
end
def select_mirror_trigger_option
click_element(:mirror_trigger_builds_label)
end
end
end
end
......
......@@ -5,7 +5,11 @@ module QA
module Resource
class ImportRepoWithCiCd < QA::Resource::ProjectImportedFromGithub
def go_to_import_page
QA::Page::Project::New.perform(&:click_cicd_for_external_repo)
# Overriding CE go_to_import_page, the differences happen in BE when CI/CD option is selected vs Import option
QA::Page::Project::New.perform do |project_page|
project_page.click_cicd_for_external_repo
project_page.click_github_link
end
end
end
end
......
......@@ -16,10 +16,7 @@ module QA
Page::Main::Menu.perform(&:go_to_create_project)
Page::Project::New.perform do |project_page|
project_page.click_import_project
project_page.click_github_link
end
go_to_import_page
Page::Project::Import::Github.perform do |import_page|
import_page.add_personal_access_token(github_personal_access_token)
......@@ -28,6 +25,13 @@ module QA
end
end
def go_to_import_page
Page::Project::New.perform do |project_page|
project_page.click_import_project
project_page.click_github_link
end
end
def fabricate_via_api!
super
rescue ResourceURLMissingError
......
......@@ -53,15 +53,6 @@ module QA
end
it 'user commits to GitHub triggers CI pipeline', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/144' do
Page::Project::Menu.perform(&:go_to_repository_settings)
Page::Project::Settings::Repository.perform do |settings|
settings.expand_mirroring_repositories do |mirror_settings|
mirror_settings.repository_url = 'https://github.com/gitlab-qa-github/test-project.git'
mirror_settings.select_mirror_trigger_option
mirror_settings.mirror_repository
end
end
Page::Project::Menu.perform(&:click_ci_cd_pipelines)
Page::Project::Pipeline::Index.perform do |index|
expect(index).to have_no_pipeline, 'Expect to have NO pipeline before mirroring.'
......
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