Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
scratch-www
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
scratch-www
Commits
f15a8bd7
Commit
f15a8bd7
authored
May 31, 2018
by
BryceLTaylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make selenium-helpers.js build driver in headless mode
parent
55f72e74
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
7 deletions
+24
-7
test/integration/selenium-helpers.js
test/integration/selenium-helpers.js
+21
-4
test/integration/smoke-testing/test_project_rows.js
test/integration/smoke-testing/test_project_rows.js
+3
-3
No files found.
test/integration/selenium-helpers.js
View file @
f15a8bd7
var
webdriver
=
require
(
'
selenium-webdriver
'
);
var
webdriver
=
require
(
'
selenium-webdriver
'
);
const
driver
=
new
webdriver
.
Builder
()
const
headless
=
process
.
env
.
SMOKE_HEADLESS
||
false
;
.
forBrowser
(
'
chrome
'
)
.
build
();
const
getDriver
=
function
()
{
const
chromeCapabilities
=
webdriver
.
Capabilities
.
chrome
();
let
args
=
[];
if
(
headless
)
{
args
.
push
(
'
--headless
'
);
args
.
push
(
'
window-size=1024,1680
'
);
args
.
push
(
'
--no-sandbox
'
);
}
chromeCapabilities
.
set
(
'
chromeOptions
'
,
{
args
});
const
newDriver
=
new
webdriver
.
Builder
()
.
forBrowser
(
'
chrome
'
)
.
withCapabilities
(
chromeCapabilities
)
.
build
();
return
newDriver
;
};
const
driver
=
getDriver
();
const
{
By
,
until
}
=
webdriver
;
const
{
By
,
until
}
=
webdriver
;
...
@@ -70,5 +86,6 @@ module.exports = {
...
@@ -70,5 +86,6 @@ module.exports = {
clickButton
,
clickButton
,
findByCss
,
findByCss
,
clickCss
,
clickCss
,
getLogs
getLogs
,
getDriver
};
};
test/integration/smoke-testing/test_project_rows.js
View file @
f15a8bd7
...
@@ -12,9 +12,9 @@ var seleniumWebdriver = require('selenium-webdriver');
...
@@ -12,9 +12,9 @@ var seleniumWebdriver = require('selenium-webdriver');
// Selenium's promise driver will be deprecated, so we should not rely on it
// Selenium's promise driver will be deprecated, so we should not rely on it
seleniumWebdriver
.
SELENIUM_PROMISE_MANAGER
=
0
;
seleniumWebdriver
.
SELENIUM_PROMISE_MANAGER
=
0
;
// chrome driver
const
{
var
driver
=
new
seleniumWebdriver
.
Builder
().
withCapabilities
(
seleniumWebdriver
.
Capabilities
.
chrome
())
driver
.
build
(
);
}
=
require
(
'
../selenium-helpers.js
'
);
var
rootUrl
=
process
.
env
.
ROOT_URL
||
'
https://scratch.ly
'
;
var
rootUrl
=
process
.
env
.
ROOT_URL
||
'
https://scratch.ly
'
;
...
...
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