Merge pull request #1657 from hicom150/update_spectron
Fix integration test setup Co-authored-by: null <23040076+greenkeeper[bot]@users.noreply.github.com> Co-authored-by: Feross Aboukhadijeh <feross@feross.org>
This commit is contained in:
34
package-lock.json
generated
34
package-lock.json
generated
@@ -1389,9 +1389,9 @@
|
||||
}
|
||||
},
|
||||
"buffer": {
|
||||
"version": "5.2.1",
|
||||
"resolved": "https://registry.npmjs.org/buffer/-/buffer-5.2.1.tgz",
|
||||
"integrity": "sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg==",
|
||||
"version": "5.4.0",
|
||||
"resolved": "https://registry.npmjs.org/buffer/-/buffer-5.4.0.tgz",
|
||||
"integrity": "sha512-Xpgy0IwHK2N01ncykXTy6FpCWuM+CJSHoPVBLyNqyrWxsedpLvwsYUhf0ME3WRFNUhos0dMamz9cOS/xRDtU5g==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"base64-js": "^1.0.2",
|
||||
@@ -1399,9 +1399,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"base64-js": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.0.tgz",
|
||||
"integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==",
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz",
|
||||
"integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
@@ -2601,13 +2601,13 @@
|
||||
}
|
||||
},
|
||||
"electron-chromedriver": {
|
||||
"version": "1.8.0",
|
||||
"resolved": "https://registry.npmjs.org/electron-chromedriver/-/electron-chromedriver-1.8.0.tgz",
|
||||
"integrity": "sha512-m1f3nle5MaGp94bcDTtMZZMMOgPO54+TXoPBlTbBSUjfINR5SJ46yQXLfuE79/qsFfJKslZB1UzWURDDFIRmpQ==",
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/electron-chromedriver/-/electron-chromedriver-6.0.0.tgz",
|
||||
"integrity": "sha512-UIhRl0sN5flfUjqActXsFrZQU1NmBObvlxzPnyeud8vhR67TllXCoqfvhQJmIrJAJJK+5M1DFhJ5iTGT++dvkg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"electron-download": "^4.1.0",
|
||||
"extract-zip": "^1.6.5"
|
||||
"electron-download": "^4.1.1",
|
||||
"extract-zip": "^1.6.7"
|
||||
}
|
||||
},
|
||||
"electron-download": {
|
||||
@@ -8764,16 +8764,16 @@
|
||||
"integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q=="
|
||||
},
|
||||
"spectron": {
|
||||
"version": "3.8.0",
|
||||
"resolved": "https://registry.npmjs.org/spectron/-/spectron-3.8.0.tgz",
|
||||
"integrity": "sha512-fQ7gFp6UuEaONjXFLifLeIUI022pOsm3b+NFAm696r2umUkSZ9IbnEgHwrvBX+pJ3QUDyCEs5bPHUieYU7FvaQ==",
|
||||
"version": "8.0.0",
|
||||
"resolved": "https://registry.npmjs.org/spectron/-/spectron-8.0.0.tgz",
|
||||
"integrity": "sha512-MI9+lAamDnw7S0vKaxXjU3g5qaW5KANaFLc+Hgq+QmMCkQbZLt6ukFFGfalmwIuYrmq+yWQPCD4CXgt3VSHrLA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"dev-null": "^0.1.1",
|
||||
"electron-chromedriver": "~1.8.0",
|
||||
"request": "^2.81.0",
|
||||
"electron-chromedriver": "^6.0.0",
|
||||
"request": "^2.87.0",
|
||||
"split": "^1.0.0",
|
||||
"webdriverio": "^4.8.0"
|
||||
"webdriverio": "^4.13.0"
|
||||
}
|
||||
},
|
||||
"speedometer": {
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
"plist": "^3.0.1",
|
||||
"pngjs": "^3.4.0",
|
||||
"run-series": "^1.1.8",
|
||||
"spectron": "^3.3.0",
|
||||
"spectron": "^8.0.0",
|
||||
"standard": "*",
|
||||
"tape": "^4.11.0",
|
||||
"walk-sync": "^2.0.2"
|
||||
|
||||
@@ -28,10 +28,15 @@ module.exports = {
|
||||
// Returns a promise that resolves to a Spectron Application once the app has loaded.
|
||||
// Takes a Tape test. Makes some basic assertions to verify that the app loaded correctly.
|
||||
function createApp (t) {
|
||||
const userDataDir = process.platform === 'win32'
|
||||
? path.join('C:\\Windows\\Temp', 'WebTorrentTest')
|
||||
: path.join('/tmp', 'WebTorrentTest')
|
||||
|
||||
return new Application({
|
||||
path: path.join(__dirname, '..', 'node_modules', '.bin',
|
||||
'electron' + (process.platform === 'win32' ? '.cmd' : '')),
|
||||
args: ['-r', path.join(__dirname, 'mocks.js'), path.join(__dirname, '..')],
|
||||
chromeDriverArgs: [`--user-data-dir=${userDataDir}`],
|
||||
env: { NODE_ENV: 'test' },
|
||||
waitTimeout: 10e3
|
||||
})
|
||||
@@ -78,6 +83,12 @@ function endTest (app, t, err) {
|
||||
// Otherwise, create the reference screenshot: test/screenshots/<platform>/<name>.png
|
||||
function screenshotCreateOrCompare (app, t, name) {
|
||||
const ssDir = path.join(__dirname, 'screenshots', process.platform)
|
||||
|
||||
// check that path exists otherwise create it
|
||||
if (!fs.existsSync(ssDir)) {
|
||||
fs.mkdirSync(ssDir)
|
||||
}
|
||||
|
||||
const ssPath = path.join(ssDir, name + '.png')
|
||||
let ssBuf
|
||||
|
||||
|
||||
Reference in New Issue
Block a user