summaryrefslogtreecommitdiff
path: root/qa
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-04-06 18:08:40 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2023-04-06 18:08:40 +0000
commit1f5e09ed6082d079dfebef92f69630c10f78c844 (patch)
tree5ef925fe6d08f2a042e47c2a9e1c40238ca8211c /qa
parent78782cd1eb5273265668ca3e438bb8cbb1344004 (diff)
downloadgitlab-ce-1f5e09ed6082d079dfebef92f69630c10f78c844.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'qa')
-rw-r--r--qa/qa/page/project/import/github.rb20
-rw-r--r--qa/qa/resource/project_imported_from_github.rb4
2 files changed, 11 insertions, 13 deletions
diff --git a/qa/qa/page/project/import/github.rb b/qa/qa/page/project/import/github.rb
index fb227209b48..6248af98a78 100644
--- a/qa/qa/page/project/import/github.rb
+++ b/qa/qa/page/project/import/github.rb
@@ -71,7 +71,11 @@ module QA
# @param [String] source_project_name
# @param [Integer] wait
# @return [Boolean]
- def has_imported_project?(gh_project_name, wait: QA::Support::WaitForRequests::DEFAULT_MAX_WAIT_TIME)
+ def has_imported_project?(
+ gh_project_name,
+ wait: QA::Support::WaitForRequests::DEFAULT_MAX_WAIT_TIME,
+ allow_partial_import: false
+ )
within_element(:project_import_row, source_project: gh_project_name, skip_finished_loading_check: true) do
wait_until(
max_duration: wait,
@@ -80,18 +84,12 @@ module QA
skip_finished_loading_check_on_refresh: true
) do
status_selector = 'import_status_indicator'
- is_partial_import = has_css?(status_selector, text: 'Partially completed')
- # Temporarily adding this for investigation purposes. This makes sure that the details section is
- # expanded when the screenshot is taken when the test fails. This can be removed or repurposed later
- # after investigation. Related: https://gitlab.com/gitlab-org/gitlab/-/issues/385252#note_1211218434
- if is_partial_import
- within_element_by_index(:import_status_indicator, 0) do
- find('button').click
- end
- end
+ return has_element?(status_selector, text: "Complete", wait: 1) unless allow_partial_import # rubocop:disable Cop/AvoidReturnFromBlocks
- has_element?(status_selector, text: "Complete")
+ ["Partially completed", "Complete"].any? do |status|
+ has_element?(status_selector, text: status, wait: 1)
+ end
end
end
end
diff --git a/qa/qa/resource/project_imported_from_github.rb b/qa/qa/resource/project_imported_from_github.rb
index 1e6b2ff620e..ed8074b1440 100644
--- a/qa/qa/resource/project_imported_from_github.rb
+++ b/qa/qa/resource/project_imported_from_github.rb
@@ -3,7 +3,7 @@
module QA
module Resource
class ProjectImportedFromGithub < Resource::Project
- attr_accessor :issue_events_import, :full_notes_import, :attachments_import
+ attr_accessor :issue_events_import, :full_notes_import, :attachments_import, :allow_partial_import
attribute :github_repo_id do
github_client.repository(github_repository_path).id
@@ -24,7 +24,7 @@ module QA
import_page.select_advanced_option(:attachments_import) if attachments_import
import_page.import!(github_repository_path, group.full_path, name)
- import_page.wait_for_success(github_repository_path, wait: 240)
+ import_page.wait_for_success(github_repository_path, wait: 240, allow_partial_import: allow_partial_import)
end
reload!