mirror of https://github.com/BTCPrivate/copay.git
testing: cleaner e2e screenshot naming
This commit is contained in:
parent
dbb87de4ce
commit
ec15a8af8c
|
@ -29,10 +29,6 @@
|
|||
}
|
||||
},
|
||||
"lint": [
|
||||
{
|
||||
"project": "src/tsconfig.app.json",
|
||||
"exclude": "**/node_modules/**"
|
||||
},
|
||||
{
|
||||
"project": "src/tsconfig.spec.json",
|
||||
"exclude": "**/node_modules/**"
|
||||
|
|
|
@ -7,21 +7,10 @@ export async function takeScreenshot(name: string) {
|
|||
mkdirSync(dir);
|
||||
}
|
||||
const config = await browser.getProcessedConfig();
|
||||
const instance = config['capabilities']['chromeOptions'];
|
||||
const deviceName = instance['mobileEmulation']
|
||||
? instance['mobileEmulation']['deviceName'].replace(/\s+/g, '')
|
||||
: await nameFromWindowSize();
|
||||
const deviceName = config['capabilities']['name'];
|
||||
const pngData = await browser.takeScreenshot();
|
||||
const path = `${dir}/${deviceName}_${name}`;
|
||||
writeFile(path, pngData, { encoding: 'base64' }, () => {
|
||||
console.log(`File written: ${path}`);
|
||||
});
|
||||
}
|
||||
|
||||
async function nameFromWindowSize() {
|
||||
const size = await browser.driver
|
||||
.manage()
|
||||
.window()
|
||||
.getSize();
|
||||
return `${size.width}x${size.height}`;
|
||||
}
|
||||
|
|
|
@ -38,8 +38,8 @@ module.exports = function(config) {
|
|||
colors: true,
|
||||
logLevel: config.LOG_INFO,
|
||||
autoWatch: true,
|
||||
browsers: ['ChromeNoSandbox'],
|
||||
// browsers: ['ChromeNoSandboxHeadless'],
|
||||
// browsers: ['ChromeNoSandbox'],
|
||||
browsers: ['ChromeNoSandboxHeadless'],
|
||||
singleRun: false,
|
||||
junitReporter: {
|
||||
outputDir: process.env.JUNIT_REPORT_PATH,
|
||||
|
@ -48,12 +48,10 @@ module.exports = function(config) {
|
|||
},
|
||||
customLaunchers: {
|
||||
ChromeNoSandbox: {
|
||||
base: 'Chrome',
|
||||
flags: ['--no-sandbox']
|
||||
base: 'Chrome'
|
||||
},
|
||||
ChromeNoSandboxHeadless: {
|
||||
base: 'ChromeHeadless',
|
||||
flags: ['--no-sandbox']
|
||||
base: 'ChromeHeadless'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -4,6 +4,7 @@ exports.config = {
|
|||
// Available deviceNames for mobileEmulation: https://chromium.googlesource.com/chromium/src/+/master/third_party/WebKit/Source/devtools/front_end/emulated_devices/module.json
|
||||
multiCapabilities: [
|
||||
{
|
||||
name: '1024x720',
|
||||
browserName: 'chrome',
|
||||
chromeOptions: {
|
||||
args: [
|
||||
|
@ -15,6 +16,7 @@ exports.config = {
|
|||
}
|
||||
},
|
||||
{
|
||||
name: '800x600',
|
||||
browserName: 'chrome',
|
||||
chromeOptions: {
|
||||
args: [
|
||||
|
@ -26,6 +28,7 @@ exports.config = {
|
|||
}
|
||||
},
|
||||
{
|
||||
name: '1920x1080',
|
||||
browserName: 'chrome',
|
||||
chromeOptions: {
|
||||
args: [
|
||||
|
@ -37,6 +40,7 @@ exports.config = {
|
|||
}
|
||||
},
|
||||
{
|
||||
name: 'iPhoneX',
|
||||
browserName: 'chrome',
|
||||
chromeOptions: {
|
||||
mobileEmulation: {
|
||||
|
@ -46,6 +50,7 @@ exports.config = {
|
|||
}
|
||||
},
|
||||
{
|
||||
name: 'iPhone8',
|
||||
browserName: 'chrome',
|
||||
chromeOptions: {
|
||||
mobileEmulation: {
|
||||
|
@ -55,6 +60,7 @@ exports.config = {
|
|||
}
|
||||
},
|
||||
{
|
||||
name: 'iPad',
|
||||
browserName: 'chrome',
|
||||
chromeOptions: {
|
||||
mobileEmulation: {
|
||||
|
@ -64,6 +70,7 @@ exports.config = {
|
|||
}
|
||||
},
|
||||
{
|
||||
name: 'iPadPro',
|
||||
browserName: 'chrome',
|
||||
chromeOptions: {
|
||||
mobileEmulation: {
|
||||
|
@ -73,6 +80,7 @@ exports.config = {
|
|||
}
|
||||
},
|
||||
{
|
||||
name: 'Nexus6P',
|
||||
browserName: 'chrome',
|
||||
chromeOptions: {
|
||||
mobileEmulation: {
|
||||
|
@ -82,6 +90,7 @@ exports.config = {
|
|||
}
|
||||
},
|
||||
{
|
||||
name: 'Nexus5X',
|
||||
browserName: 'chrome',
|
||||
chromeOptions: {
|
||||
mobileEmulation: {
|
||||
|
|
Loading…
Reference in New Issue