diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2018-02-09 22:25:08 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2018-02-09 22:46:27 +0800 |
commit | 75984534f80b97d2bc7f05c24ce3e0cadb5b85a3 (patch) | |
tree | 3b0fbad163e925906590385f4eb27bf77313c5db /qa | |
parent | 578a98fb447b2c98763c09b51d38d50c895ec925 (diff) | |
download | gitlab-ce-75984534f80b97d2bc7f05c24ce3e0cadb5b85a3.tar.gz |
Cleanup codes and address feedback
Diffstat (limited to 'qa')
-rw-r--r-- | qa/qa/factory/resource/pipeline.rb | 8 | ||||
-rw-r--r-- | qa/qa/page/project/job/show.rb | 10 | ||||
-rw-r--r-- | qa/qa/page/project/pipeline/index.rb | 11 | ||||
-rw-r--r-- | qa/qa/page/project/pipeline/show.rb | 3 | ||||
-rw-r--r-- | qa/qa/page/project/show.rb | 2 | ||||
-rw-r--r-- | qa/qa/service/runner.rb | 4 | ||||
-rw-r--r-- | qa/qa/specs/features/cicd/pull_with_deploy_key_spec.rb | 15 |
7 files changed, 22 insertions, 31 deletions
diff --git a/qa/qa/factory/resource/pipeline.rb b/qa/qa/factory/resource/pipeline.rb deleted file mode 100644 index d3f1586ec5e..00000000000 --- a/qa/qa/factory/resource/pipeline.rb +++ /dev/null @@ -1,8 +0,0 @@ -module QA - module Factory - module Resource - class Pipeline < Factory::Base - end - end - end -end diff --git a/qa/qa/page/project/job/show.rb b/qa/qa/page/project/job/show.rb index 9be14812736..21bda74efb2 100644 --- a/qa/qa/page/project/job/show.rb +++ b/qa/qa/page/project/job/show.rb @@ -1,9 +1,17 @@ module QA::Page module Project::Job class Show < QA::Page::Base + view 'app/views/projects/jobs/show.html.haml' do + element :build_output, '.js-build-output' + end + def output css = '.js-build-output' - wait { has_css?(css) } + + wait(reload: false) do + has_css?(css) + end + find(css).text end end diff --git a/qa/qa/page/project/pipeline/index.rb b/qa/qa/page/project/pipeline/index.rb index 9dd65aea217..466010935b1 100644 --- a/qa/qa/page/project/pipeline/index.rb +++ b/qa/qa/page/project/pipeline/index.rb @@ -6,13 +6,14 @@ module QA::Page end def go_to_latest_pipeline - first('.js-pipeline-url-link').click - end + css = '.js-pipeline-url-link' + link = nil - def wait_for_latest_pipeline - wait do - first('.js-pipeline-url-link') + wait(reload: false) do + link = first(css) end + + link.click end end end diff --git a/qa/qa/page/project/pipeline/show.rb b/qa/qa/page/project/pipeline/show.rb index 80f8924e42c..b183552d46c 100644 --- a/qa/qa/page/project/pipeline/show.rb +++ b/qa/qa/page/project/pipeline/show.rb @@ -11,6 +11,7 @@ module QA::Page view 'app/assets/javascripts/pipelines/components/graph/job_component.vue' do element :job_component, /class.*ci-job-component.*/ + element :job_link, /class.*js-pipeline-graph-job-link.*/ end view 'app/assets/javascripts/vue_shared/components/ci_icon.vue' do @@ -34,7 +35,7 @@ module QA::Page def go_to_first_job css = '.js-pipeline-graph-job-link' - wait do + wait(reload: false) do has_css?(css) end diff --git a/qa/qa/page/project/show.rb b/qa/qa/page/project/show.rb index 1f1fede2149..93fcfe6d5e5 100644 --- a/qa/qa/page/project/show.rb +++ b/qa/qa/page/project/show.rb @@ -62,7 +62,7 @@ module QA click_link(kind) end - # Ensure git clone textbox was updated to http URI + # Ensure git clone textbox was updated repository_location.include?(detect_text) end end diff --git a/qa/qa/service/runner.rb b/qa/qa/service/runner.rb index f08507c8a4c..1362d1b1410 100644 --- a/qa/qa/service/runner.rb +++ b/qa/qa/service/runner.rb @@ -48,10 +48,6 @@ module QA 'gitlab-runner run' ] - if @executor == 'docker' - commands.unshift('apt-get install -y docker-ce') - end - commands.join(' && ') end end diff --git a/qa/qa/specs/features/cicd/pull_with_deploy_key_spec.rb b/qa/qa/specs/features/cicd/pull_with_deploy_key_spec.rb index 91ade2649ac..39c600aee87 100644 --- a/qa/qa/specs/features/cicd/pull_with_deploy_key_spec.rb +++ b/qa/qa/specs/features/cicd/pull_with_deploy_key_spec.rb @@ -8,7 +8,7 @@ module QA Service::Runner.new(runner_name).remove! end - scenario 'user pushes .gitlab-ci.yml to the repository' do + scenario 'user setup a deploy key and use it to pull from CI job' do Runtime::Browser.visit(:gitlab, Page::Main::Login) Page::Main::Login.act { sign_in_using_credentials } @@ -52,7 +52,7 @@ module QA cat-config: script: - mkdir -p ~/.ssh - - ssh-keyscan -p #{repository_uri.port} #{repository_uri.host} >> ~/.ssh/known_hosts + - ssh-keyscan -p #{repository_uri.port || 22} #{repository_uri.host} >> ~/.ssh/known_hosts - eval $(ssh-agent -s) - echo "$DEPLOY_KEY" | ssh-add - - git clone #{repository_url} @@ -73,15 +73,8 @@ module QA Page::Project::Show.act { wait_for_push } Page::Menu::Side.act { click_ci_cd_pipelines } - - Page::Project::Pipeline::Index.act do - wait_for_latest_pipeline - go_to_latest_pipeline - end - - Page::Project::Pipeline::Show.act do - go_to_first_job - end + Page::Project::Pipeline::Index.act { go_to_latest_pipeline } + Page::Project::Pipeline::Show.act { go_to_first_job } Page::Project::Job::Show.perform do |job| expect(job.output).to include(sha1sum) |