Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
8677d408
Commit
8677d408
authored
Jan 07, 2019
by
ddavison
Committed by
Sanad Liaquat
Jan 09, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dont pass extraneous chrome variables to other browsers
Extract remote_grid_credentials
parent
2620efaf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
10 deletions
+20
-10
qa/qa/runtime/browser.rb
qa/qa/runtime/browser.rb
+12
-9
qa/qa/runtime/env.rb
qa/qa/runtime/env.rb
+8
-1
No files found.
qa/qa/runtime/browser.rb
View file @
8677d408
...
@@ -57,18 +57,21 @@ module QA
...
@@ -57,18 +57,21 @@ module QA
# QA::Runtime::Env.browser.capitalize will work for every driver type except PhantomJS.
# QA::Runtime::Env.browser.capitalize will work for every driver type except PhantomJS.
# We will have no use to use PhantomJS so this shouldn't be a problem.
# We will have no use to use PhantomJS so this shouldn't be a problem.
options
=
Selenium
::
WebDriver
.
const_get
(
QA
::
Runtime
::
Env
.
browser
.
capitalize
)
::
Options
.
new
options
=
Selenium
::
WebDriver
.
const_get
(
QA
::
Runtime
::
Env
.
browser
.
capitalize
)
::
Options
.
new
options
.
add_argument
(
"window-size=1240,1680"
)
# Chrome won't work properly in a Docker container in sandbox mod
e
if
QA
::
Runtime
::
Env
.
browser
==
:chrom
e
options
.
add_argument
(
"no-sandbox
"
)
options
.
add_argument
(
"window-size=1240,1680
"
)
# Run headless by default unless CHROME_HEADLESS is false
# Chrome won't work properly in a Docker container in sandbox mode
if
QA
::
Runtime
::
Env
.
chrome_headless?
options
.
add_argument
(
"no-sandbox"
)
options
.
add_argument
(
"headless"
)
# Chrome documentation says this flag is needed for now
# Run headless by default unless CHROME_HEADLESS is false
# https://developers.google.com/web/updates/2017/04/headless-chrome#cli
if
QA
::
Runtime
::
Env
.
chrome_headless?
options
.
add_argument
(
"disable-gpu"
)
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
end
end
# Use the same profile on QA runs if CHROME_REUSE_PROFILE is true.
# Use the same profile on QA runs if CHROME_REUSE_PROFILE is true.
...
...
qa/qa/runtime/env.rb
View file @
8677d408
...
@@ -62,7 +62,10 @@ module QA
...
@@ -62,7 +62,10 @@ module QA
# - "http://user:pass@somehost.com/wd/hub"
# - "http://user:pass@somehost.com/wd/hub"
# - "https://user:pass@somehost.com:443/wd/hub"
# - "https://user:pass@somehost.com:443/wd/hub"
# - "http://localhost:4444/wd/hub"
# - "http://localhost:4444/wd/hub"
"
#{
remote_grid_protocol
}
://
#{
"
#{
remote_grid_username
}
:
#{
remote_grid_access_key
}
@"
if
remote_grid_username
}#{
ENV
[
'QA_REMOTE_GRID'
]
}
/wd/hub"
if
ENV
[
'QA_REMOTE_GRID'
]
return
unless
ENV
[
'QA_REMOTE_GRID'
]
"
#{
remote_grid_protocol
}
://
#{
remote_grid_credentials
}#{
ENV
[
'QA_REMOTE_GRID'
]
}
/wd/hub"
end
end
def
remote_grid_username
def
remote_grid_username
...
@@ -183,6 +186,10 @@ module QA
...
@@ -183,6 +186,10 @@ module QA
private
private
def
remote_grid_credentials
remote_grid_username
?
"
#{
remote_grid_username
}
:
#{
remote_grid_access_key
}
@"
:
''
end
def
enabled?
(
value
,
default:
true
)
def
enabled?
(
value
,
default:
true
)
return
default
if
value
.
nil?
return
default
if
value
.
nil?
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment