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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
56ff9e59
Commit
56ff9e59
authored
Jun 29, 2021
by
Desiree Chevalier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update browser.rb to accept mobile device name
parent
398ddd20
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
10 deletions
+35
-10
qa/qa/runtime/browser.rb
qa/qa/runtime/browser.rb
+31
-10
qa/qa/runtime/env.rb
qa/qa/runtime/env.rb
+4
-0
No files found.
qa/qa/runtime/browser.rb
View file @
56ff9e59
...
@@ -68,11 +68,12 @@ module QA
...
@@ -68,11 +68,12 @@ module QA
Capybara
.
register_driver
QA
::
Runtime
::
Env
.
browser
do
|
app
|
Capybara
.
register_driver
QA
::
Runtime
::
Env
.
browser
do
|
app
|
capabilities
=
Selenium
::
WebDriver
::
Remote
::
Capabilities
.
send
(
QA
::
Runtime
::
Env
.
browser
)
capabilities
=
Selenium
::
WebDriver
::
Remote
::
Capabilities
.
send
(
QA
::
Runtime
::
Env
.
browser
)
case
QA
::
Runtime
::
Env
.
browser
when
:chrome
if
QA
::
Runtime
::
Env
.
accept_insecure_certs?
if
QA
::
Runtime
::
Env
.
accept_insecure_certs?
capabilities
[
'acceptInsecureCerts'
]
=
true
capabilities
[
'acceptInsecureCerts'
]
=
true
end
end
if
QA
::
Runtime
::
Env
.
browser
==
:chrome
# set logging preferences
# set logging preferences
# this enables access to logs with `page.driver.manage.get_log(:browser)`
# this enables access to logs with `page.driver.manage.get_log(:browser)`
capabilities
[
'goog:loggingPrefs'
]
=
{
capabilities
[
'goog:loggingPrefs'
]
=
{
...
@@ -82,14 +83,11 @@ module QA
...
@@ -82,14 +83,11 @@ module QA
server:
'ALL'
server:
'ALL'
}
}
#
size window
#
Chrome won't work properly in a Docker container in sandbox mode
capabilities
[
'goog:chromeOptions'
]
=
{
capabilities
[
'goog:chromeOptions'
]
=
{
args:
%w[
window-size=1480,2200
]
args:
%w[
no-sandbox
]
}
}
# Chrome won't work properly in a Docker container in sandbox mode
capabilities
[
'goog:chromeOptions'
][
:args
]
<<
'no-sandbox'
# Run headless by default unless WEBDRIVER_HEADLESS is false
# Run headless by default unless WEBDRIVER_HEADLESS is false
if
QA
::
Runtime
::
Env
.
webdriver_headless?
if
QA
::
Runtime
::
Env
.
webdriver_headless?
capabilities
[
'goog:chromeOptions'
][
:args
]
<<
'headless'
capabilities
[
'goog:chromeOptions'
][
:args
]
<<
'headless'
...
@@ -105,6 +103,26 @@ module QA
...
@@ -105,6 +103,26 @@ module QA
# Specify the user-agent to allow challenges to be bypassed
# Specify the user-agent to allow challenges to be bypassed
# See https://gitlab.com/gitlab-com/gl-infra/infrastructure/-/issues/11938
# See https://gitlab.com/gitlab-com/gl-infra/infrastructure/-/issues/11938
capabilities
[
'goog:chromeOptions'
][
:args
]
<<
"user-agent=
#{
QA
::
Runtime
::
Env
.
user_agent
}
"
if
QA
::
Runtime
::
Env
.
user_agent
capabilities
[
'goog:chromeOptions'
][
:args
]
<<
"user-agent=
#{
QA
::
Runtime
::
Env
.
user_agent
}
"
if
QA
::
Runtime
::
Env
.
user_agent
if
QA
::
Runtime
::
Env
.
remote_mobile_device_name
capabilities
[
'platformName'
]
=
'Android'
capabilities
[
'appium:deviceName'
]
=
QA
::
Runtime
::
Env
.
remote_mobile_device_name
capabilities
[
'appium:platformVersion'
]
=
'latest'
else
capabilities
[
'goog:chromeOptions'
][
:args
]
<<
'window-size=1480,2200'
end
when
:safari
if
QA
::
Runtime
::
Env
.
remote_mobile_device_name
capabilities
[
'platformName'
]
=
'iOS'
capabilities
[
'appium:deviceName'
]
=
QA
::
Runtime
::
Env
.
remote_mobile_device_name
capabilities
[
'appium:platformVersion'
]
=
'latest'
end
when
:firefox
if
QA
::
Runtime
::
Env
.
accept_insecure_certs?
capabilities
[
'acceptInsecureCerts'
]
=
true
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.
...
@@ -120,7 +138,10 @@ module QA
...
@@ -120,7 +138,10 @@ module QA
capabilities:
capabilities
capabilities:
capabilities
}
}
selenium_options
[
:url
]
=
QA
::
Runtime
::
Env
.
remote_grid
if
QA
::
Runtime
::
Env
.
remote_grid
if
QA
::
Runtime
::
Env
.
remote_grid
selenium_options
[
:url
]
=
QA
::
Runtime
::
Env
.
remote_grid
capabilities
[
:browserVersion
]
=
'latest'
end
Capybara
::
Selenium
::
Driver
.
new
(
Capybara
::
Selenium
::
Driver
.
new
(
app
,
app
,
...
...
qa/qa/runtime/env.rb
View file @
56ff9e59
...
@@ -144,6 +144,10 @@ module QA
...
@@ -144,6 +144,10 @@ module QA
ENV
[
'QA_BROWSER'
].
nil?
?
:chrome
:
ENV
[
'QA_BROWSER'
].
to_sym
ENV
[
'QA_BROWSER'
].
nil?
?
:chrome
:
ENV
[
'QA_BROWSER'
].
to_sym
end
end
def
remote_mobile_device_name
ENV
[
'QA_REMOTE_MOBILE_DEVICE_NAME'
]
end
def
user_username
def
user_username
ENV
[
'GITLAB_USERNAME'
]
ENV
[
'GITLAB_USERNAME'
]
end
end
...
...
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