diff options
author | Sanad Liaquat <sliaquat@gitlab.com> | 2019-01-03 12:31:35 +0500 |
---|---|---|
committer | Sanad Liaquat <sliaquat@gitlab.com> | 2019-02-12 11:26:08 +0500 |
commit | ca73c7ec4f07d117d959f5bbdca3f2688946f5fa (patch) | |
tree | bcdf7dc9c5637fc25014de48d71337b10b548b6f | |
parent | 42c7be1ec0a224a8ebfd880e911b10f4a60420a0 (diff) | |
download | gitlab-ce-qa-fix-import-github-repo-spec.tar.gz |
Fix and enable github testqa-fix-import-github-repo-spec
-rw-r--r-- | qa/qa/page/project/import/github.rb | 21 | ||||
-rw-r--r-- | qa/qa/resource/project_imported_from_github.rb | 2 | ||||
-rw-r--r-- | qa/qa/specs/features/browser_ui/1_manage/project/import_github_repo_spec.rb | 2 |
3 files changed, 19 insertions, 6 deletions
diff --git a/qa/qa/page/project/import/github.rb b/qa/qa/page/project/import/github.rb index a3cde73d3f2..f3a9b8b21f5 100644 --- a/qa/qa/page/project/import/github.rb +++ b/qa/qa/page/project/import/github.rb @@ -30,12 +30,19 @@ module QA choose_test_namespace(full_path) set_path(full_path, name) import_project(full_path) + wait_for_success end private def within_repo_path(full_path) - page.within(%Q(tr[data-qa-repo-path="#{full_path}"])) do + wait(reload: false) do + !all_elements(:project_import_row).empty? + end + + project_import_row = all_elements(:project_import_row).detect { |row| row.has_css?('a', text: full_path, wait: 1.0)} + + within(project_import_row) do yield end end @@ -45,18 +52,24 @@ module QA click_element :project_namespace_select end - select_item(Runtime::Namespace.path) + search_and_select(Runtime::Namespace.path) end def set_path(full_path, name) within_repo_path(full_path) do - fill_in 'path', with: name + fill_element(:project_path_field, name) end end def import_project(full_path) within_repo_path(full_path) do - click_button 'Import' + click_element(:import_button) + end + end + + def wait_for_success + wait(max: 60, time: 1.0, reload: false) do + page.has_content?('Done', wait: 1.0) end end end diff --git a/qa/qa/resource/project_imported_from_github.rb b/qa/qa/resource/project_imported_from_github.rb index 3f02fe885a9..0d25e7dd842 100644 --- a/qa/qa/resource/project_imported_from_github.rb +++ b/qa/qa/resource/project_imported_from_github.rb @@ -4,7 +4,7 @@ require 'securerandom' module QA module Resource - class ProjectImportedFromGithub < Project + class ProjectImportedFromGithub < Base attr_accessor :name attr_writer :personal_access_token, :github_repository_path diff --git a/qa/qa/specs/features/browser_ui/1_manage/project/import_github_repo_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/project/import_github_repo_spec.rb index 3ce48de2c25..a812e976b0e 100644 --- a/qa/qa/specs/features/browser_ui/1_manage/project/import_github_repo_spec.rb +++ b/qa/qa/specs/features/browser_ui/1_manage/project/import_github_repo_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module QA - context 'Manage', :orchestrated, :github do + context 'Manage', :github do describe 'Project import from GitHub' do let(:imported_project) do Resource::ProjectImportedFromGithub.fabricate! do |project| |