@spscommerce/e2e-core 2.4.15 → 2.4.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- FROM mcr.microsoft.com/playwright:v1.49.1-noble
1
+ FROM mcr.microsoft.com/playwright:v1.51.1-noble
2
2
 
3
3
  ARG BROWSER
4
4
 
@@ -9,7 +9,8 @@ const path_1 = __importDefault(require("path"));
9
9
  class ScreenshotsReporter {
10
10
  onTestEnd(test, result) {
11
11
  const screenshotsDirName = path_1.default.join(process.cwd(), 'results-e2e/screenshots/');
12
- result.attachments.forEach(attachment => {
12
+ // .filter to fix 1.51.1 new _prompt-0 'text/markdown' attachment without path
13
+ result.attachments.filter(attachment => attachment?.path).forEach(attachment => {
13
14
  // Create folder if un-exists
14
15
  if (!fs_1.default.existsSync(screenshotsDirName))
15
16
  fs_1.default.mkdirSync(screenshotsDirName, { recursive: true });
@@ -1 +1 @@
1
- {"version":3,"file":"screenshots.js","sourceRoot":"","sources":["../../src/reporters/screenshots.ts"],"names":[],"mappings":";;;;;AAAA,4CAAoB;AACpB,gDAAwB;AAGxB,iEAAiE;AACjE,MAAM,mBAAmB;IACvB,SAAS,CAAC,IAAc,EAAE,MAAkB;QAC1C,MAAM,kBAAkB,GAAG,cAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,0BAA0B,CAAC,CAAC;QAChF,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;YACtC,6BAA6B;YAC7B,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,kBAAkB,CAAC;gBAAE,YAAE,CAAC,SAAS,CAAC,kBAAkB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YAC9F,sDAAsD;YACtD,YAAE,CAAC,YAAY,CACb,UAAU,CAAC,IAAI,EACf,cAAI,CAAC,IAAI,CACP,kBAAkB,EAClB,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,KAAK,GAAG,cAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAC3E,CACF,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAED,kBAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"screenshots.js","sourceRoot":"","sources":["../../src/reporters/screenshots.ts"],"names":[],"mappings":";;;;;AAAA,4CAAoB;AACpB,gDAAwB;AAGxB,iEAAiE;AACjE,MAAM,mBAAmB;IACvB,SAAS,CAAC,IAAc,EAAE,MAAkB;QAC1C,MAAM,kBAAkB,GAAG,cAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,0BAA0B,CAAC,CAAC;QAChF,8EAA8E;QAC9E,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;YAC7E,6BAA6B;YAC7B,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,kBAAkB,CAAC;gBAAE,YAAE,CAAC,SAAS,CAAC,kBAAkB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YAC9F,sDAAsD;YACtD,YAAE,CAAC,YAAY,CACb,UAAU,CAAC,IAAI,EACf,cAAI,CAAC,IAAI,CACP,kBAAkB,EAClB,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,KAAK,GAAG,cAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAC3E,CACF,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAED,kBAAe,mBAAmB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spscommerce/e2e-core",
3
- "version": "2.4.15",
3
+ "version": "2.4.17",
4
4
  "description": "An automation test framework which is based on Playwright.",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -25,7 +25,7 @@
25
25
  "author": "SPS Commerce",
26
26
  "license": "UNLICENSED",
27
27
  "dependencies": {
28
- "@playwright/test": "1.49.1",
28
+ "@playwright/test": "1.51.1",
29
29
  "@typescript-eslint/eslint-plugin": "6.21.0",
30
30
  "@typescript-eslint/parser": "6.21.0",
31
31
  "dotenv": "16.4.5",
@@ -70,7 +70,6 @@ switch (process.env.BROWSER) {
70
70
  name: 'chromium',
71
71
  testMatch: /.*(test|spec)\.(js|ts|mjs)/,
72
72
  use: {
73
- channel: 'chrome',
74
73
  ...devices['Desktop Chrome'],
75
74
  userAgent: devices['Desktop Chrome'].userAgent + ' SPS auto test run',
76
75
  viewport: customViewport,
@@ -47,6 +47,10 @@ export default async function globalSetup(): Promise<void> {
47
47
  await page.fill('input[type="password"]', process.env.USER_PASSWORD);
48
48
  await page.click('button[type="submit"]:visible');
49
49
  await page.waitForURL(/^((?!login).)*$/);
50
+ if (page.url().includes("/consent")) {
51
+ await page.click('button[type="submit"][value="accept"]');
52
+ await page.waitForURL(/^((?!consent).)*$/);
53
+ }
50
54
  if (page.url().includes('select-org')) {
51
55
  await page.click('button[type="submit"]');
52
56
  }
@@ -6,7 +6,8 @@ import type { Reporter, TestCase, TestResult } from '@playwright/test/reporter';
6
6
  class ScreenshotsReporter implements Reporter {
7
7
  onTestEnd(test: TestCase, result: TestResult) {
8
8
  const screenshotsDirName = path.join(process.cwd(), 'results-e2e/screenshots/');
9
- result.attachments.forEach(attachment => {
9
+ // .filter to fix 1.51.1 new _prompt-0 'text/markdown' attachment without path
10
+ result.attachments.filter(attachment => attachment?.path).forEach(attachment => {
10
11
  // Create folder if un-exists
11
12
  if (!fs.existsSync(screenshotsDirName)) fs.mkdirSync(screenshotsDirName, { recursive: true });
12
13
  // Copy file as '<description> <test name>.<file ext>'