Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Bootstrap
bootstrap
Commits
5e7a9afe
Commit
5e7a9afe
authored
7 years ago
by
XhmikosR
Committed by
GitHub
7 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Update saucelabs-unit-test.js (#24297)
Add license header and minor formatting tweaks.
parent
ef38ca1c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
build/saucelabs-unit-test.js
+22
-13
build/saucelabs-unit-test.js
with
22 additions
and
13 deletions
+22
-13
build/saucelabs-unit-test.js
+
22
-
13
View file @
5e7a9afe
/*!
* Script to run our Sauce Labs tests.
* Copyright 2017 The Bootstrap Authors
* Copyright 2017 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
/*
Docs: https://wiki.saucelabs.com/display/DOCS/Platform+Configurator
Mac Opera is not currently supported by Sauce Labs
Win Opera 15+ is not currently supported by Sauce Labs
iOS Chrome is not currently supported by Sauce Labs
*/
'
use strict
'
'
use strict
'
const
path
=
require
(
'
path
'
)
const
path
=
require
(
'
path
'
)
const
JSUnitSaucelabs
=
require
(
'
jsunitsaucelabs
'
)
const
JSUnitSaucelabs
=
require
(
'
jsunitsaucelabs
'
)
// Docs: https://wiki.saucelabs.com/display/DOCS/Platform+Configurator
// Mac Opera is not currently supported by Sauce Labs
// Win Opera 15+ is not currently supported by Sauce Labs
// iOS Chrome is not currently supported by Sauce Labs
const
jsUnitSaucelabs
=
new
JSUnitSaucelabs
({
const
jsUnitSaucelabs
=
new
JSUnitSaucelabs
({
username
:
process
.
env
.
SAUCE_USERNAME
,
username
:
process
.
env
.
SAUCE_USERNAME
,
password
:
process
.
env
.
SAUCE_ACCESS_KEY
,
password
:
process
.
env
.
SAUCE_ACCESS_KEY
,
build
:
process
.
env
.
TRAVIS_JOB_ID
build
:
process
.
env
.
TRAVIS_JOB_ID
})
})
const
testURL
=
'
http://localhost:3000/js/tests/index.html?hidepassed
'
const
testURL
=
'
http://localhost:3000/js/tests/index.html?hidepassed
'
const
browsersFile
=
require
(
path
.
resolve
(
__dirname
,
'
./sauce_browsers.json
'
))
const
browsersFile
=
require
(
path
.
resolve
(
__dirname
,
'
./sauce_browsers.json
'
))
let
jobsDone
=
0
let
jobsDone
=
0
let
jobsSucceeded
=
0
let
jobsSucceeded
=
0
const
waitingCallback
=
(
error
,
body
,
id
)
=>
{
const
waitingCallback
=
(
error
,
body
,
id
)
=>
{
if
(
error
)
{
if
(
error
)
{
...
@@ -33,8 +42,8 @@ const waitingCallback = (error, body, id) => {
...
@@ -33,8 +42,8 @@ const waitingCallback = (error, body, id) => {
})
})
},
2000
)
},
2000
)
}
else
{
}
else
{
const
test
=
body
[
'
js tests
'
][
0
]
const
test
=
body
[
'
js tests
'
][
0
]
let
passed
=
false
let
passed
=
false
let
errorStr
=
false
let
errorStr
=
false
if
(
test
.
result
!==
null
)
{
if
(
test
.
result
!==
null
)
{
...
@@ -46,9 +55,9 @@ const waitingCallback = (error, body, id) => {
...
@@ -46,9 +55,9 @@ const waitingCallback = (error, body, id) => {
}
}
console
.
log
(
`Tested
${
testURL
}
`
)
console
.
log
(
`Tested
${
testURL
}
`
)
console
.
log
(
`Platform:
${
test
.
platform
.
join
(
'
,
'
)}
`
)
console
.
log
(
`Platform:
${
test
.
platform
.
join
(
'
,
'
)}
`
)
console
.
log
(
`Passed:
${
passed
.
toString
()}
`
)
console
.
log
(
`Passed:
${
passed
.
toString
()}
`
)
console
.
log
(
`U
rl
${
test
.
url
}
\n`
)
console
.
log
(
`U
RL:
${
test
.
url
}
\n`
)
if
(
errorStr
)
{
if
(
errorStr
)
{
console
.
error
(
errorStr
)
console
.
error
(
errorStr
)
}
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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