summaryrefslogtreecommitdiff
path: root/features
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2017-12-15 17:14:26 +0800
committerLin Jen-Shin <godfat@godfat.org>2017-12-15 17:14:26 +0800
commit59ac184fcf64f1812fbfd88a00ea029ca3c1f4e7 (patch)
tree5db0594a6f568f02b4f54c6bf4eabe01229a9f95 /features
parent85be6d83be4632c76760e373da131a90afb093b9 (diff)
parent1baea77438779e74657b49ca26810d6c8f041b41 (diff)
downloadgitlab-ce-59ac184fcf64f1812fbfd88a00ea029ca3c1f4e7.tar.gz
Merge remote-tracking branch 'upstream/master' into no-ivar-in-modules
* upstream/master: (671 commits) Make rubocop happy Use guard clause Improve language Prettify Use temp branch Pass info about who started the job and which job triggered it Docs: add indexes for monitoring and performance monitoring clearer-documentation-on-inline-diffs Add docs for commit diff discussion in merge requests sorting for tags api Clear BatchLoader after each spec to prevent holding onto records longer than necessary Include project in BatchLoader key to prevent returning blobs for the wrong project moved lfs_blob_ids method into ExtractsPath module Converted JS modules into exported modules spec fixes Bump gitlab-shell version to 5.10.3 Clear caches before updating MR diffs Use new Ruby version 2.4 in GitLab QA images moved lfs blob fetch from extractspath file Update GitLab QA dependencies ...
Diffstat (limited to 'features')
-rw-r--r--features/steps/groups.rb2
-rw-r--r--features/steps/project/pages.rb4
-rw-r--r--features/steps/shared/builds.rb4
-rw-r--r--features/steps/shared/issuable.rb2
-rw-r--r--features/support/capybara.rb36
5 files changed, 34 insertions, 14 deletions
diff --git a/features/steps/groups.rb b/features/steps/groups.rb
index a2d9a0332e0..753694a5392 100644
--- a/features/steps/groups.rb
+++ b/features/steps/groups.rb
@@ -138,7 +138,7 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
private
def assigned_to_me(key)
- project.send(key).where(assignee_id: current_user.id)
+ project.send(key).assigned_to(current_user)
end
def project
diff --git a/features/steps/project/pages.rb b/features/steps/project/pages.rb
index 124a132d688..f03630e5a91 100644
--- a/features/steps/project/pages.rb
+++ b/features/steps/project/pages.rb
@@ -44,8 +44,8 @@ class Spinach::Features::ProjectPages < Spinach::FeatureSteps
project: @project,
pipeline: pipeline,
ref: 'HEAD',
- artifacts_file: fixture_file_upload(Rails.root + 'spec/fixtures/pages.zip'),
- artifacts_metadata: fixture_file_upload(Rails.root + 'spec/fixtures/pages.zip.meta')
+ legacy_artifacts_file: fixture_file_upload(Rails.root + 'spec/fixtures/pages.zip'),
+ legacy_artifacts_metadata: fixture_file_upload(Rails.root + 'spec/fixtures/pages.zip.meta')
)
result = ::Projects::UpdatePagesService.new(@project, build).execute
diff --git a/features/steps/shared/builds.rb b/features/steps/shared/builds.rb
index 3b4c98ec00d..c267195f0e8 100644
--- a/features/steps/shared/builds.rb
+++ b/features/steps/shared/builds.rb
@@ -37,13 +37,13 @@ module SharedBuilds
step 'recent build has artifacts available' do
artifacts = Rails.root + 'spec/fixtures/ci_build_artifacts.zip'
archive = fixture_file_upload(artifacts, 'application/zip')
- @build.update_attributes(artifacts_file: archive)
+ @build.update_attributes(legacy_artifacts_file: archive)
end
step 'recent build has artifacts metadata available' do
metadata = Rails.root + 'spec/fixtures/ci_build_artifacts_metadata.gz'
gzip = fixture_file_upload(metadata, 'application/x-gzip')
- @build.update_attributes(artifacts_metadata: gzip)
+ @build.update_attributes(legacy_artifacts_metadata: gzip)
end
step 'recent build has a build trace' do
diff --git a/features/steps/shared/issuable.rb b/features/steps/shared/issuable.rb
index 714985f2051..f90247c3fe8 100644
--- a/features/steps/shared/issuable.rb
+++ b/features/steps/shared/issuable.rb
@@ -2,7 +2,7 @@ module SharedIssuable
include Spinach::DSL
def edit_issuable
- find('.issuable-edit', visible: true).click
+ find('.js-issuable-edit', visible: true).click
end
step 'project "Community" has "Community issue" open issue' do
diff --git a/features/support/capybara.rb b/features/support/capybara.rb
index 3c4db8b9601..5a77b859113 100644
--- a/features/support/capybara.rb
+++ b/features/support/capybara.rb
@@ -3,21 +3,41 @@ require 'capybara-screenshot/spinach'
# Give CI some extra time
timeout = (ENV['CI'] || ENV['CI_SERVER']) ? 60 : 30
-Capybara.javascript_driver = :chrome
Capybara.register_driver :chrome do |app|
- extra_args = []
- extra_args << 'headless' unless ENV['CHROME_HEADLESS'] =~ /^(false|no|0)$/i
-
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(
- chromeOptions: {
- 'args' => %w[no-sandbox disable-gpu --window-size=1240,1400] + extra_args
+ # This enables access to logs with `page.driver.manage.get_log(:browser)`
+ loggingPrefs: {
+ browser: "ALL",
+ client: "ALL",
+ driver: "ALL",
+ server: "ALL"
}
)
- Capybara::Selenium::Driver
- .new(app, browser: :chrome, desired_capabilities: capabilities)
+ options = Selenium::WebDriver::Chrome::Options.new
+ options.add_argument("window-size=1240,1400")
+
+ # Chrome won't work properly in a Docker container in sandbox mode
+ options.add_argument("no-sandbox")
+
+ # Run headless by default unless CHROME_HEADLESS specified
+ unless ENV['CHROME_HEADLESS'] =~ /^(false|no|0)$/i
+ options.add_argument("headless")
+
+ # Chrome documentation says this flag is needed for now
+ # https://developers.google.com/web/updates/2017/04/headless-chrome#cli
+ options.add_argument("disable-gpu")
+ end
+
+ Capybara::Selenium::Driver.new(
+ app,
+ browser: :chrome,
+ desired_capabilities: capabilities,
+ options: options
+ )
end
+Capybara.javascript_driver = :chrome
Capybara.default_max_wait_time = timeout
Capybara.ignore_hidden_elements = false