diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-02 12:06:45 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-02 12:06:45 +0000 |
commit | bffcdf9bca11a4d43cc40e3f382f03088d36f7c6 (patch) | |
tree | c773436393b7a59b5f6b14388b9fa6402a9bd198 /qa | |
parent | 259c0cc0c4f8a49001b33d1bee577f4422e16d62 (diff) | |
download | gitlab-ce-bffcdf9bca11a4d43cc40e3f382f03088d36f7c6.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'qa')
-rw-r--r-- | qa/Gemfile | 4 | ||||
-rw-r--r-- | qa/Gemfile.lock | 38 | ||||
-rw-r--r-- | qa/qa/page/base.rb | 4 | ||||
-rw-r--r-- | qa/qa/page/project/pipeline/index.rb | 6 | ||||
-rw-r--r-- | qa/qa/runtime/browser.rb | 4 | ||||
-rw-r--r-- | qa/qa/specs/features/browser_ui/3_create/repository/add_file_template_spec.rb | 14 | ||||
-rw-r--r-- | qa/qa/specs/features/browser_ui/3_create/web_ide/add_file_template_spec.rb | 12 |
7 files changed, 44 insertions, 38 deletions
diff --git a/qa/Gemfile b/qa/Gemfile index 5266fc57b0a..3575ecf13e9 100644 --- a/qa/Gemfile +++ b/qa/Gemfile @@ -2,8 +2,8 @@ source 'https://rubygems.org' gem 'gitlab-qa' gem 'activesupport', '5.2.3' # This should stay in sync with the root's Gemfile -gem 'capybara', '~> 2.16.1' -gem 'capybara-screenshot', '~> 1.0.18' +gem 'capybara', '~> 3.29.0' +gem 'capybara-screenshot', '~> 1.0.23' gem 'rake', '~> 12.3.0' gem 'rspec', '~> 3.7' gem 'selenium-webdriver', '~> 3.12' diff --git a/qa/Gemfile.lock b/qa/Gemfile.lock index 91b2afb6927..a84b353170e 100644 --- a/qa/Gemfile.lock +++ b/qa/Gemfile.lock @@ -6,8 +6,8 @@ GEM i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) - addressable (2.5.2) - public_suffix (>= 2.0.2, < 4.0) + addressable (2.7.0) + public_suffix (>= 2.0.2, < 5.0) airborne (0.2.13) activesupport rack @@ -15,15 +15,16 @@ GEM rest-client (>= 1.7.3, < 3.0) rspec (~> 3.1) byebug (9.1.0) - capybara (2.16.1) + capybara (3.29.0) addressable mini_mime (>= 0.1.3) - nokogiri (>= 1.3.3) - rack (>= 1.0.0) - rack-test (>= 0.5.4) - xpath (~> 2.0) - capybara-screenshot (1.0.18) - capybara (>= 1.0, < 3) + nokogiri (~> 1.8) + rack (>= 1.6.0) + rack-test (>= 0.6.3) + regexp_parser (~> 1.5) + xpath (~> 3.2) + capybara-screenshot (1.0.23) + capybara (>= 1.0, < 4) launchy childprocess (3.0.0) coderay (1.1.2) @@ -50,7 +51,7 @@ GEM mime-types (3.1) mime-types-data (~> 3.2015) mime-types-data (3.2016.0521) - mini_mime (1.0.0) + mini_mime (1.0.2) mini_portile2 (2.4.0) minitest (5.11.3) netrc (0.11.0) @@ -65,11 +66,12 @@ GEM pry-byebug (3.5.1) byebug (~> 9.1) pry (~> 0.10) - public_suffix (3.0.1) - rack (2.0.6) - rack-test (0.8.2) + public_suffix (4.0.1) + rack (2.0.7) + rack-test (0.8.3) rack (>= 1.0, < 3) - rake (12.3.3) + rake (12.3.0) + regexp_parser (1.6.0) rest-client (2.0.2) http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 4.0) @@ -103,8 +105,8 @@ GEM unf (0.1.4) unf_ext unf_ext (0.0.7.4) - xpath (2.1.0) - nokogiri (~> 1.3) + xpath (3.2.0) + nokogiri (~> 1.8) PLATFORMS ruby @@ -112,8 +114,8 @@ PLATFORMS DEPENDENCIES activesupport (= 5.2.3) airborne (~> 0.2.13) - capybara (~> 2.16.1) - capybara-screenshot (~> 1.0.18) + capybara (~> 3.29.0) + capybara-screenshot (~> 1.0.23) debase (~> 0.2.4.1) faker (~> 1.6, >= 1.6.6) gitlab-qa diff --git a/qa/qa/page/base.rb b/qa/qa/page/base.rb index a080c4071ed..b28664b2921 100644 --- a/qa/qa/page/base.rb +++ b/qa/qa/page/base.rb @@ -141,6 +141,10 @@ module QA page.has_no_text? text end + def has_normalized_ws_text?(text, wait: Capybara.default_max_wait_time) + page.has_text?(text.gsub(/\s+/, " "), wait: wait) + end + def finished_loading? has_no_css?('.fa-spinner', wait: Capybara.default_max_wait_time) end diff --git a/qa/qa/page/project/pipeline/index.rb b/qa/qa/page/project/pipeline/index.rb index b52f3e99a36..269d4dfc411 100644 --- a/qa/qa/page/project/pipeline/index.rb +++ b/qa/qa/page/project/pipeline/index.rb @@ -14,11 +14,7 @@ module QA::Page def click_on_latest_pipeline css = '.js-pipeline-url-link' - link = wait(reload: false) do - first(css) - end - - link.click + first(css, wait: 60).click end def wait_for_latest_pipeline_success diff --git a/qa/qa/runtime/browser.rb b/qa/qa/runtime/browser.rb index 7e45e5e86ea..ea92cdbdb7f 100644 --- a/qa/qa/runtime/browser.rb +++ b/qa/qa/runtime/browser.rb @@ -132,6 +132,10 @@ module QA config.default_max_wait_time = CAPYBARA_MAX_WAIT_TIME # https://github.com/mattheworiordan/capybara-screenshot/issues/164 config.save_path = ::File.expand_path('../../tmp', __dir__) + + # Cabybara 3 does not normalize text by default, so older tests + # fail because of unexpected line breaks and other white space + config.default_normalize_ws = true end end diff --git a/qa/qa/specs/features/browser_ui/3_create/repository/add_file_template_spec.rb b/qa/qa/specs/features/browser_ui/3_create/repository/add_file_template_spec.rb index d2fd1d743fb..c119e447097 100644 --- a/qa/qa/specs/features/browser_ui/3_create/repository/add_file_template_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/repository/add_file_template_spec.rb @@ -52,16 +52,16 @@ module QA Page::Project::Show.perform(&:create_new_file!) Page::File::Form.perform do |form| form.select_template template[:file_name], template[:name] - end - expect(page).to have_content(content[0..100]) + expect(form).to have_normalized_ws_text(content[0..100]) - Page::File::Form.perform(&:commit_changes) + form.commit_changes - expect(page).to have_content('The file has been successfully created.') - expect(page).to have_content(template[:file_name]) - expect(page).to have_content('Add new file') - expect(page).to have_content(content[0..100]) + expect(form).to have_content('The file has been successfully created.') + expect(form).to have_content(template[:file_name]) + expect(form).to have_content('Add new file') + expect(form).to have_normalized_ws_text(content[0..100]) + end end end end diff --git a/qa/qa/specs/features/browser_ui/3_create/web_ide/add_file_template_spec.rb b/qa/qa/specs/features/browser_ui/3_create/web_ide/add_file_template_spec.rb index 71b9971a0af..b91f944a162 100644 --- a/qa/qa/specs/features/browser_ui/3_create/web_ide/add_file_template_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/web_ide/add_file_template_spec.rb @@ -54,15 +54,15 @@ module QA ide.create_new_file_from_template template[:file_name], template[:name] expect(ide.has_file?(template[:file_name])).to be_truthy - end - expect(page).to have_button('Undo') - expect(page).to have_content(content[0..100]) + expect(ide).to have_button('Undo') + expect(ide).to have_normalized_ws_text(content[0..100]) - Page::Project::WebIDE::Edit.perform(&:commit_changes) + ide.commit_changes - expect(page).to have_content(template[:file_name]) - expect(page).to have_content(content[0..100]) + expect(ide).to have_content(template[:file_name]) + expect(ide).to have_normalized_ws_text(content[0..100]) + end end end end |