Compare commits
1 Commits
subscripti
...
mct5263-up
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0b9acbf58e |
@@ -241,7 +241,7 @@ module.exports = {
|
|||||||
],
|
],
|
||||||
"vue/max-attributes-per-line": ["error", {
|
"vue/max-attributes-per-line": ["error", {
|
||||||
"singleline": 1,
|
"singleline": 1,
|
||||||
"multiline": 1,
|
"multiline": 1
|
||||||
}],
|
}],
|
||||||
"vue/first-attribute-linebreak": "error",
|
"vue/first-attribute-linebreak": "error",
|
||||||
"vue/multiline-html-element-content-newline": "off",
|
"vue/multiline-html-element-content-newline": "off",
|
||||||
@@ -266,6 +266,12 @@ module.exports = {
|
|||||||
"no-var": "off",
|
"no-var": "off",
|
||||||
"one-var": "off"
|
"one-var": "off"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"files": ["**/*.e2e.spec.js", "**/*.visual.spec.js"],
|
||||||
|
"rules": {
|
||||||
|
"no-console": "warn"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -25,3 +25,43 @@ exports.test = base.test.extend({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generic console logging function for use in tests.
|
||||||
|
* @param {'log'|'info'|'warn'|'debug'|'error'} [severity='log'] - The severity of the message.
|
||||||
|
* @param {...any} args
|
||||||
|
*/
|
||||||
|
function log(severity, ...args) {
|
||||||
|
const logTypes = ['log', 'info', 'warn', 'debug', 'error'];
|
||||||
|
let logFn;
|
||||||
|
|
||||||
|
// Default to log level severity if not provided
|
||||||
|
if (!logTypes.includes(severity)) {
|
||||||
|
args.unshift(severity);
|
||||||
|
severity = 'log';
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (severity) {
|
||||||
|
case 'log':
|
||||||
|
logFn = console.log;
|
||||||
|
break;
|
||||||
|
case 'info':
|
||||||
|
logFn = console.info;
|
||||||
|
break;
|
||||||
|
case 'warn':
|
||||||
|
logFn = console.warn;
|
||||||
|
break;
|
||||||
|
case 'debug':
|
||||||
|
logFn = console.debug;
|
||||||
|
break;
|
||||||
|
case 'error':
|
||||||
|
logFn = console.error;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
logFn = console.log;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
logFn(`${severity.toUpperCase()}:`, ...args);
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.log = log;
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ suite is sharing state between tests which is considered an anti-pattern. Implim
|
|||||||
demonstrate some playwright for test developers. This pattern should not be re-used in other CRUD suites.
|
demonstrate some playwright for test developers. This pattern should not be re-used in other CRUD suites.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const { test } = require('../../../fixtures.js');
|
const { test, log } = require('../../../fixtures.js');
|
||||||
const { expect } = require('@playwright/test');
|
const { expect } = require('@playwright/test');
|
||||||
|
|
||||||
let conditionSetUrl;
|
let conditionSetUrl;
|
||||||
@@ -56,10 +56,10 @@ test.describe.serial('Condition Set CRUD Operations on @localStorage', () => {
|
|||||||
|
|
||||||
//Set object identifier from url
|
//Set object identifier from url
|
||||||
conditionSetUrl = await page.url();
|
conditionSetUrl = await page.url();
|
||||||
console.log('conditionSetUrl ' + conditionSetUrl);
|
log('conditionSetUrl ' + conditionSetUrl);
|
||||||
|
|
||||||
getConditionSetIdentifierFromUrl = await conditionSetUrl.split('/').pop().split('?')[0];
|
getConditionSetIdentifierFromUrl = await conditionSetUrl.split('/').pop().split('?')[0];
|
||||||
console.debug('getConditionSetIdentifierFromUrl ' + getConditionSetIdentifierFromUrl);
|
log('debug', 'getConditionSetIdentifierFromUrl ' + getConditionSetIdentifierFromUrl);
|
||||||
});
|
});
|
||||||
test.afterAll(async ({ browser }) => {
|
test.afterAll(async ({ browser }) => {
|
||||||
await browser.close();
|
await browser.close();
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ but only assume that example imagery is present.
|
|||||||
*/
|
*/
|
||||||
/* globals process */
|
/* globals process */
|
||||||
|
|
||||||
const { test } = require('../../../fixtures.js');
|
const { test, log } = require('../../../fixtures.js');
|
||||||
const { expect } = require('@playwright/test');
|
const { expect } = require('@playwright/test');
|
||||||
|
|
||||||
test.describe('Example Imagery', () => {
|
test.describe('Example Imagery', () => {
|
||||||
@@ -101,9 +101,9 @@ test.describe('Example Imagery', () => {
|
|||||||
await page.mouse.move(imageCenterX, imageCenterY);
|
await page.mouse.move(imageCenterX, imageCenterY);
|
||||||
|
|
||||||
//Get Diagnostic info about process environment
|
//Get Diagnostic info about process environment
|
||||||
console.log('process.platform is ' + process.platform);
|
log('process.platform is ' + process.platform);
|
||||||
const getUA = await page.evaluate(() => navigator.userAgent);
|
const getUA = await page.evaluate(() => navigator.userAgent);
|
||||||
console.log('navigator.userAgent ' + getUA);
|
log('navigator.userAgent ' + getUA);
|
||||||
// Pan Imagery Hints
|
// Pan Imagery Hints
|
||||||
const expectedAltText = process.platform === 'linux' ? 'Ctrl+Alt drag to pan' : 'Alt drag to pan';
|
const expectedAltText = process.platform === 'linux' ? 'Ctrl+Alt drag to pan' : 'Alt drag to pan';
|
||||||
const imageryHintsText = await page.locator('.c-imagery__hints').innerText();
|
const imageryHintsText = await page.locator('.c-imagery__hints').innerText();
|
||||||
@@ -347,7 +347,7 @@ test('Example Imagery in Display layout', async ({ page }) => {
|
|||||||
return window.getComputedStyle(el).getPropertyValue('background-image').match(/url\(([^)]+)\)/)[1];
|
return window.getComputedStyle(el).getPropertyValue('background-image').match(/url\(([^)]+)\)/)[1];
|
||||||
});
|
});
|
||||||
let backgroundImageUrl1 = backgroundImageUrl.slice(1, -1); //forgive me, padre
|
let backgroundImageUrl1 = backgroundImageUrl.slice(1, -1); //forgive me, padre
|
||||||
console.log('backgroundImageUrl1 ' + backgroundImageUrl1);
|
log('backgroundImageUrl1 ' + backgroundImageUrl1);
|
||||||
|
|
||||||
let backgroundImageUrl2;
|
let backgroundImageUrl2;
|
||||||
await expect.poll(async () => {
|
await expect.poll(async () => {
|
||||||
@@ -362,7 +362,7 @@ test('Example Imagery in Display layout', async ({ page }) => {
|
|||||||
message: "verify next image has updated",
|
message: "verify next image has updated",
|
||||||
timeout: 6 * 1000
|
timeout: 6 * 1000
|
||||||
}).not.toBe(backgroundImageUrl1);
|
}).not.toBe(backgroundImageUrl1);
|
||||||
console.log('backgroundImageUrl2 ' + backgroundImageUrl2);
|
log('backgroundImageUrl2 ' + backgroundImageUrl2);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.describe('Example imagery thumbnails resize in display layouts', () => {
|
test.describe('Example imagery thumbnails resize in display layouts', () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user