Skip to content

Commit

Permalink
Convert E2E infrastructure to ESM (#33846)
Browse files Browse the repository at this point in the history
Playwright uses a Nodejs loader hook, and the combination of that hook
and changes in Node 20 results in several bugs when it comes to loading
CommonJS files. It's not even clear whether the bugs are in Playwright
or Node.

On the other hand, we can avoid all the bugs (whoever they belong to) by
converting everything over to ESM syntax. So let's do that.
  • Loading branch information
anomiex authored Nov 7, 2023
1 parent de675f8 commit 278ba7f
Show file tree
Hide file tree
Showing 100 changed files with 216 additions and 195 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ jobs:
echo "TEST_SITE=${SITE}" >> $GITHUB_ENV
# Wait for the site to pick up latest tag version (DISPATCH_REF_NAME)
TEST_SITE="${SITE}" node "$GITHUB_WORKSPACE/tools/e2e-commons/bin/update-beta-version.cjs" $DISPATCH_REF_TYPE $DISPATCH_REF_NAME
TEST_SITE="${SITE}" node "$GITHUB_WORKSPACE/tools/e2e-commons/bin/update-beta-version.js" $DISPATCH_REF_TYPE $DISPATCH_REF_NAME
- name: Set up VIP site
if: ${{ matrix.suite == 'vip' }}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: changed
Comment: Convert E2E configs to ESM. No change to the plugin itself.


Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"/home/runner/work/jetpack/jetpack/node_modules/.pnpm/[email protected]/node_modules/allure-playwright/dist/index.js",
null
],
[ "/home/runner/work/jetpack/jetpack/tools/e2e-commons/reporters/reporter.cjs", null ],
[ "/home/runner/work/jetpack/jetpack/tools/e2e-commons/reporters/reporter.js", null ],
[ "github", null ]
],
"reportSlowTests": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"/home/runner/work/jetpack/jetpack/node_modules/.pnpm/[email protected]/node_modules/allure-playwright/dist/index.js",
null
],
[ "/home/runner/work/jetpack/jetpack/tools/e2e-commons/reporters/reporter.cjs", null ],
[ "/home/runner/work/jetpack/jetpack/tools/e2e-commons/reporters/reporter.js", null ],
[ "github", null ]
],
"reportSlowTests": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"/home/runner/work/jetpack/jetpack/node_modules/.pnpm/[email protected]/node_modules/allure-playwright/dist/index.js",
null
],
[ "/home/runner/work/jetpack/jetpack/tools/e2e-commons/reporters/reporter.cjs", null ],
[ "/home/runner/work/jetpack/jetpack/tools/e2e-commons/reporters/reporter.js", null ],
[ "github", null ]
],
"reportSlowTests": null,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: changed
Comment: Convert E2E configs to ESM. No change to the plugin itself.


4 changes: 2 additions & 2 deletions projects/plugins/boost/tests/e2e/lib/env/prerequisites.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import logger from 'jetpack-e2e-commons/logger.cjs';
import { execWpCommand } from 'jetpack-e2e-commons/helpers/utils-helper.cjs';
import logger from 'jetpack-e2e-commons/logger.js';
import { execWpCommand } from 'jetpack-e2e-commons/helpers/utils-helper.js';

import { expect } from '@playwright/test';
import { JetpackBoostPage } from '../pages/index.js';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import WpPage from 'jetpack-e2e-commons/pages/wp-page.js';
import { resolveSiteUrl } from 'jetpack-e2e-commons/helpers/utils-helper.cjs';
import { resolveSiteUrl } from 'jetpack-e2e-commons/helpers/utils-helper.js';

const apiEndpointsRegex = {
'modules-state': /jetpack-boost-ds\/modules-state\/merge/,
Expand Down
2 changes: 1 addition & 1 deletion projects/plugins/boost/tests/e2e/playwright.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import config from 'jetpack-e2e-commons/config/playwright.config.default.cjs';
import config from 'jetpack-e2e-commons/config/playwright.config.default.mjs';

config.globalSetup = './lib/setupTests.js';

Expand Down
4 changes: 2 additions & 2 deletions projects/plugins/boost/tests/e2e/specs/base/common.test.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { test, expect } from 'jetpack-e2e-commons/fixtures/base-test.js';
import { DashboardPage, PluginsPage, Sidebar } from 'jetpack-e2e-commons/pages/wp-admin/index.js';
import { execWpCommand } from 'jetpack-e2e-commons/helpers/utils-helper.cjs';
import { execWpCommand } from 'jetpack-e2e-commons/helpers/utils-helper.js';
import { boostPrerequisitesBuilder } from '../../lib/env/prerequisites.js';
import { prerequisitesBuilder } from 'jetpack-e2e-commons/env/prerequisites.js';
import { JetpackBoostPage } from '../../lib/pages/index.js';
import playwrightConfig from 'jetpack-e2e-commons/playwright.config.cjs';
import playwrightConfig from 'jetpack-e2e-commons/playwright.config.mjs';

test.afterAll( async ( { browser } ) => {
const page = await browser.newPage( playwrightConfig.use );
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { test, expect } from 'jetpack-e2e-commons/fixtures/base-test.js';
import playwrightConfig from 'jetpack-e2e-commons/playwright.config.cjs';
import playwrightConfig from 'jetpack-e2e-commons/playwright.config.mjs';
import { boostPrerequisitesBuilder } from '../../lib/env/prerequisites.js';
import { JetpackBoostPage } from '../../lib/pages/index.js';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { boostPrerequisitesBuilder } from '../../lib/env/prerequisites.js';
import { JetpackBoostPage } from '../../lib/pages/index.js';
import { PostFrontendPage } from 'jetpack-e2e-commons/pages/index.js';
import { DashboardPage, ThemesPage, Sidebar } from 'jetpack-e2e-commons/pages/wp-admin/index.js';
import playwrightConfig from 'jetpack-e2e-commons/playwright.config.cjs';
import playwrightConfig from 'jetpack-e2e-commons/playwright.config.mjs';

test.describe( 'Critical CSS module', () => {
let page;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { boostPrerequisitesBuilder } from '../../lib/env/prerequisites.js';
import { test, expect } from 'jetpack-e2e-commons/fixtures/base-test.js';
import { JetpackBoostPage } from '../../lib/pages/index.js';
import playwrightConfig from 'jetpack-e2e-commons/playwright.config.cjs';
import playwrightConfig from 'jetpack-e2e-commons/playwright.config.mjs';

const modules = [
// ['MODULE_NAME', 'DEFAULT STATE'],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { test, expect } from 'jetpack-e2e-commons/fixtures/base-test.js';
import { boostPrerequisitesBuilder } from '../../lib/env/prerequisites.js';
import { PostFrontendPage } from 'jetpack-e2e-commons/pages/index.js';
import playwrightConfig from 'jetpack-e2e-commons/playwright.config.cjs';
import playwrightConfig from 'jetpack-e2e-commons/playwright.config.mjs';

const testPostTitle = 'Hello World with JavaScript';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { test, expect } from 'jetpack-e2e-commons/fixtures/base-test.js';
import { boostPrerequisitesBuilder } from '../../lib/env/prerequisites.js';
import playwrightConfig from 'jetpack-e2e-commons/playwright.config.cjs';
import playwrightConfig from 'jetpack-e2e-commons/playwright.config.mjs';
import { JetpackBoostPage } from '../../lib/pages/index.js';

test.describe( 'Auto refresh of speed scores', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: other
Comment: Convert E2E configs to ESM. No change to the plugin itself.


4 changes: 2 additions & 2 deletions projects/plugins/jetpack/tests/e2e/helpers/sync-helper.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { execWpCommand } from 'jetpack-e2e-commons/helpers/utils-helper.cjs';
import logger from 'jetpack-e2e-commons/logger.cjs';
import { execWpCommand } from 'jetpack-e2e-commons/helpers/utils-helper.js';
import logger from 'jetpack-e2e-commons/logger.js';

export async function enableSync() {
logger.sync( 'Enabling sync' );
Expand Down
4 changes: 2 additions & 2 deletions projects/plugins/jetpack/tests/e2e/helpers/waf-helper.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { execWpCommand } from 'jetpack-e2e-commons/helpers/utils-helper.cjs';
import logger from 'jetpack-e2e-commons/logger.cjs';
import { execWpCommand } from 'jetpack-e2e-commons/helpers/utils-helper.js';
import logger from 'jetpack-e2e-commons/logger.js';

export async function enableAutomaticRules() {
logger.sync( 'Enabling automatic firewall rules' );
Expand Down
2 changes: 1 addition & 1 deletion projects/plugins/jetpack/tests/e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"tunnel:reset": "tunnel reset",
"tunnel:down": "tunnel down",
"pretest:run": "pnpm run clean",
"test:run": ". ./node_modules/jetpack-e2e-commons/bin/app-password.sh && playwright install && NODE_CONFIG_DIR='./config' ALLURE_RESULTS_DIR=./output/allure-results NODE_PATH=\"$PWD/node_modules\" playwright test --config=playwright.config.cjs",
"test:run": ". ./node_modules/jetpack-e2e-commons/bin/app-password.sh && playwright install && NODE_CONFIG_DIR='./config' ALLURE_RESULTS_DIR=./output/allure-results NODE_PATH=\"$PWD/node_modules\" playwright test --config=playwright.config.mjs",
"test-decrypt-default-config": "openssl enc -md sha1 -aes-256-cbc -d -pass env:CONFIG_KEY -in ./node_modules/jetpack-e2e-commons/config/encrypted.enc -out ./node_modules/jetpack-e2e-commons/config/local.cjs",
"test-decrypt-config": "openssl enc -md sha1 -aes-256-cbc -d -pass env:CONFIG_KEY -in ./config/encrypted.enc -out config/local.cjs",
"test-decrypt-all-config": "pnpm test-decrypt-default-config && pnpm test-decrypt-config",
Expand Down
1 change: 0 additions & 1 deletion projects/plugins/jetpack/tests/e2e/playwright.config.cjs

This file was deleted.

1 change: 1 addition & 0 deletions projects/plugins/jetpack/tests/e2e/playwright.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from 'jetpack-e2e-commons/config/playwright.config.default.mjs';
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
import { PostFrontendPage } from 'jetpack-e2e-commons/pages/index.js';
import config from 'config';
import { prerequisitesBuilder, Plans } from 'jetpack-e2e-commons/env/index.js';
import playwrightConfig from '../../playwright.config.cjs';
import playwrightConfig from '../../playwright.config.mjs';

test.beforeAll( async ( { browser } ) => {
const page = await browser.newPage( playwrightConfig.use );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
} from 'jetpack-e2e-commons/pages/wp-admin/index.js';
import { PostFrontendPage } from 'jetpack-e2e-commons/pages/index.js';
import { prerequisitesBuilder, Plans } from 'jetpack-e2e-commons/env/index.js';
import playwrightConfig from '../../playwright.config.cjs';
import playwrightConfig from '../../playwright.config.mjs';

let blockEditor;
test.beforeAll( async ( { browser } ) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { test, expect } from 'jetpack-e2e-commons/fixtures/base-test.js';
import { RecommendationsPage } from 'jetpack-e2e-commons/pages/wp-admin/index.js';
import { Plans, prerequisitesBuilder } from 'jetpack-e2e-commons/env/index.js';
import playwrightConfig from '../../playwright.config.cjs';
import playwrightConfig from '../../playwright.config.mjs';

test.beforeAll( async ( { browser } ) => {
const page = await browser.newPage( playwrightConfig.use );
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { test, expect } from 'jetpack-e2e-commons/fixtures/base-test.js';
import { WpPage } from 'jetpack-e2e-commons/pages/index.js';
import playwrightConfig from '../../playwright.config.cjs';
import playwrightConfig from '../../playwright.config.mjs';
import { Plans, prerequisitesBuilder } from 'jetpack-e2e-commons/env/index.js';
import { resolveSiteUrl } from 'jetpack-e2e-commons/helpers/utils-helper.cjs';
import { resolveSiteUrl } from 'jetpack-e2e-commons/helpers/utils-helper.js';
import { enableAutomaticRules, generateRules } from '../../helpers/waf-helper.js';

test.describe.parallel( 'WAF Blocking', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import {
DashboardPage,
JetpackPage,
} from 'jetpack-e2e-commons/pages/wp-admin/index.js';
import { execWpCommand } from 'jetpack-e2e-commons/helpers/utils-helper.cjs';
import { execWpCommand } from 'jetpack-e2e-commons/helpers/utils-helper.js';
import { prerequisitesBuilder } from 'jetpack-e2e-commons/env/index.js';
import { test, expect } from 'jetpack-e2e-commons/fixtures/base-test.js';
import playwrightConfig from '../../playwright.config.cjs';
import playwrightConfig from '../../playwright.config.mjs';

test.beforeAll( async ( { browser } ) => {
const page = await browser.newPage( playwrightConfig.use );
Expand Down
6 changes: 3 additions & 3 deletions projects/plugins/jetpack/tests/e2e/specs/sync/sync.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { test, expect } from 'jetpack-e2e-commons/fixtures/base-test.js';
import { execWpCommand } from 'jetpack-e2e-commons/helpers/utils-helper.cjs';
import { execWpCommand } from 'jetpack-e2e-commons/helpers/utils-helper.js';
import {
enableSync,
disableSync,
Expand All @@ -10,8 +10,8 @@ import {
} from '../../helpers/sync-helper.js';
import { BlockEditorPage } from 'jetpack-e2e-commons/pages/wp-admin/index.js';
import { prerequisitesBuilder } from 'jetpack-e2e-commons/env/index.js';
import playwrightConfig from '../../playwright.config.cjs';
import logger from 'jetpack-e2e-commons/logger.cjs';
import playwrightConfig from '../../playwright.config.mjs';
import logger from 'jetpack-e2e-commons/logger.js';

test.describe( 'Sync', () => {
const wpcomRestAPIBase = 'https://public-api.wordpress.com/rest/';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
execShellCommand,
resolveSiteUrl,
execContainerShellCommand,
} from 'jetpack-e2e-commons/helpers/utils-helper.cjs';
} from 'jetpack-e2e-commons/helpers/utils-helper.js';
import { PluginsPage, JetpackDashboardPage } from 'jetpack-e2e-commons/pages/wp-admin/index.js';
import { test, expect } from 'jetpack-e2e-commons/fixtures/base-test.js';
import { prerequisitesBuilder } from 'jetpack-e2e-commons/env/index.js';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: changed
Comment: Convert E2E configs to ESM. No change to the plugin itself.


2 changes: 1 addition & 1 deletion projects/plugins/migration/tests/e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"tunnel:reset": "tunnel reset",
"tunnel:down": "tunnel down",
"pretest:run": "pnpm run clean",
"test:run": ". ./node_modules/jetpack-e2e-commons/bin/app-password.sh && playwright install && NODE_CONFIG_DIR='./config' ALLURE_RESULTS_DIR=./output/allure-results NODE_PATH=\"$PWD/node_modules\" playwright test --config=./playwright.config.cjs"
"test:run": ". ./node_modules/jetpack-e2e-commons/bin/app-password.sh && playwright install && NODE_CONFIG_DIR='./config' ALLURE_RESULTS_DIR=./output/allure-results NODE_PATH=\"$PWD/node_modules\" playwright test --config=./playwright.config.mjs"
},
"devDependencies": {
"@playwright/test": "1.39.0",
Expand Down
1 change: 0 additions & 1 deletion projects/plugins/migration/tests/e2e/playwright.config.cjs

This file was deleted.

1 change: 1 addition & 0 deletions projects/plugins/migration/tests/e2e/playwright.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from 'jetpack-e2e-commons/config/playwright.config.default.mjs';
2 changes: 1 addition & 1 deletion projects/plugins/migration/tests/e2e/specs/start.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { test } from '@playwright/test';
import { Sidebar, DashboardPage } from 'jetpack-e2e-commons/pages/wp-admin/index.js';
import { prerequisitesBuilder } from 'jetpack-e2e-commons/env/prerequisites.js';
import playwrightConfig from '../playwright.config.cjs';
import playwrightConfig from '../playwright.config.mjs';

test.describe( 'Starter plugin!', () => {
test.beforeEach( async ( { browser } ) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: changed
Comment: Convert E2E configs to ESM. No change to the plugin itself.


4 changes: 2 additions & 2 deletions projects/plugins/search/tests/e2e/helpers/search-helper.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { execWpCommand } from 'jetpack-e2e-commons/helpers/utils-helper.cjs';
import logger from 'jetpack-e2e-commons/logger.cjs';
import { execWpCommand } from 'jetpack-e2e-commons/helpers/utils-helper.js';
import logger from 'jetpack-e2e-commons/logger.js';
import { SearchHomepage } from '../pages/index.js';

export async function enableInstantSearch() {
Expand Down
2 changes: 1 addition & 1 deletion projects/plugins/search/tests/e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"tunnel:reset": "tunnel reset",
"tunnel:down": "tunnel down",
"pretest:run": "pnpm run clean",
"test:run": ". ./node_modules/jetpack-e2e-commons/bin/app-password.sh && playwright install && NODE_CONFIG_DIR='./config' ALLURE_RESULTS_DIR=./output/allure-results NODE_PATH=\"$PWD/node_modules\" playwright test --config=playwright.config.cjs"
"test:run": ". ./node_modules/jetpack-e2e-commons/bin/app-password.sh && playwright install && NODE_CONFIG_DIR='./config' ALLURE_RESULTS_DIR=./output/allure-results NODE_PATH=\"$PWD/node_modules\" playwright test --config=playwright.config.mjs"
},
"devDependencies": {
"@playwright/test": "1.39.0",
Expand Down
5 changes: 3 additions & 2 deletions projects/plugins/search/tests/e2e/pages/search-homepage.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import WpPage from 'jetpack-e2e-commons/pages/wp-page.js';
import { resolveSiteUrl } from 'jetpack-e2e-commons/helpers/utils-helper.cjs';
import { resolveSiteUrl } from 'jetpack-e2e-commons/helpers/utils-helper.js';

export default class SearchHomepage extends WpPage {
static SEARCH_API_PATTERN = /^https:\/\/public-api\.wordpress.com\/rest\/v1.3\/sites\/\d+\/search.*/;
static SEARCH_API_PATTERN =
/^https:\/\/public-api\.wordpress.com\/rest\/v1.3\/sites\/\d+\/search.*/;

constructor( page ) {
const url = `${ resolveSiteUrl() }/?result_format=expanded`;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import WpPage from 'jetpack-e2e-commons/pages/wp-page.js';
import { resolveSiteUrl } from 'jetpack-e2e-commons/helpers/utils-helper.cjs';
import { resolveSiteUrl } from 'jetpack-e2e-commons/helpers/utils-helper.js';

export default class SearchConfigure extends WpPage {
static SEARCH_SETTING_API_PATTERN = /^https?:\/\/.*%2Fwp%2Fv2%2Fsettings/;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import WpPage from 'jetpack-e2e-commons/pages/wp-page.js';
import { resolveSiteUrl } from 'jetpack-e2e-commons/helpers/utils-helper.cjs';
import { resolveSiteUrl } from 'jetpack-e2e-commons/helpers/utils-helper.js';

export default class SearchDashboard extends WpPage {
static SEARCH_SETTING_API_PATTERN = /^https?:\/\/.*jetpack\/v4\/search\/settings/;
Expand Down
1 change: 0 additions & 1 deletion projects/plugins/search/tests/e2e/playwright.config.cjs

This file was deleted.

1 change: 1 addition & 0 deletions projects/plugins/search/tests/e2e/playwright.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from 'jetpack-e2e-commons/config/playwright.config.default.mjs';
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
clearSearchPlanInfo,
} from '../helpers/search-helper.js';
import { prerequisitesBuilder, Plans } from 'jetpack-e2e-commons/env/index.js';
import playwrightConfig from '../playwright.config.cjs';
import playwrightConfig from '../playwright.config.mjs';

test.describe( 'Search Configure', () => {
let searchConfigure;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
clearSearchPlanInfo,
} from '../helpers/search-helper.js';
import { prerequisitesBuilder, Plans } from 'jetpack-e2e-commons/env/index.js';
import playwrightConfig from '../playwright.config.cjs';
import playwrightConfig from '../playwright.config.mjs';

test.describe( 'Search Dashboard', () => {
let searchDashboard;
Expand Down
4 changes: 2 additions & 2 deletions projects/plugins/search/tests/e2e/specs/search.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import {
clearSearchPlanInfo,
} from '../helpers/search-helper.js';
import { prerequisitesBuilder, Plans } from 'jetpack-e2e-commons/env/index.js';
import { resolveSiteUrl } from 'jetpack-e2e-commons/helpers/utils-helper.cjs';
import playwrightConfig from '../playwright.config.cjs';
import { resolveSiteUrl } from 'jetpack-e2e-commons/helpers/utils-helper.js';
import playwrightConfig from '../playwright.config.mjs';

test.describe( 'Instant Search', () => {
let homepage;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: changed
Comment: Convert E2E configs to ESM. No change to the plugin itself.


2 changes: 1 addition & 1 deletion projects/plugins/social/tests/e2e/flows/connection.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AuthorizePage } from 'jetpack-e2e-commons/pages/wpcom/index.js';
import logger from 'jetpack-e2e-commons/logger.cjs';
import logger from 'jetpack-e2e-commons/logger.js';
import { JetpackSocialPage } from '../pages/index.js';

export async function connect( page, premium = false ) {
Expand Down
2 changes: 1 addition & 1 deletion projects/plugins/social/tests/e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"tunnel:reset": "tunnel reset",
"tunnel:down": "tunnel down",
"pretest:run": "pnpm run clean",
"test:run": ". ./node_modules/jetpack-e2e-commons/bin/app-password.sh && playwright install && NODE_CONFIG_DIR='./config' ALLURE_RESULTS_DIR=./output/allure-results NODE_PATH=\"$PWD/node_modules\" playwright test --config=./playwright.config.cjs"
"test:run": ". ./node_modules/jetpack-e2e-commons/bin/app-password.sh && playwright install && NODE_CONFIG_DIR='./config' ALLURE_RESULTS_DIR=./output/allure-results NODE_PATH=\"$PWD/node_modules\" playwright test --config=./playwright.config.mjs"
},
"devDependencies": {
"@playwright/test": "1.39.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import WpPage from 'jetpack-e2e-commons/pages/wp-page.js';
import logger from 'jetpack-e2e-commons/logger.cjs';
import { resolveSiteUrl } from 'jetpack-e2e-commons/helpers/utils-helper.cjs';
import logger from 'jetpack-e2e-commons/logger.js';
import { resolveSiteUrl } from 'jetpack-e2e-commons/helpers/utils-helper.js';

export default class JetpackSocialPage extends WpPage {
constructor( page ) {
Expand Down
1 change: 0 additions & 1 deletion projects/plugins/social/tests/e2e/playwright.config.cjs

This file was deleted.

1 change: 1 addition & 0 deletions projects/plugins/social/tests/e2e/playwright.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from 'jetpack-e2e-commons/config/playwright.config.default.mjs';
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: changed
Comment: Convert E2E configs to ESM. No change to the plugin itself.


2 changes: 1 addition & 1 deletion projects/plugins/starter-plugin/tests/e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"tunnel:reset": "tunnel reset",
"tunnel:down": "tunnel down",
"pretest:run": "pnpm run clean",
"test:run": ". ./node_modules/jetpack-e2e-commons/bin/app-password.sh && playwright install && NODE_CONFIG_DIR='./config' ALLURE_RESULTS_DIR=./output/allure-results NODE_PATH=\"$PWD/node_modules\" playwright test --config=./playwright.config.cjs"
"test:run": ". ./node_modules/jetpack-e2e-commons/bin/app-password.sh && playwright install && NODE_CONFIG_DIR='./config' ALLURE_RESULTS_DIR=./output/allure-results NODE_PATH=\"$PWD/node_modules\" playwright test --config=./playwright.config.mjs"
},
"devDependencies": {
"@playwright/test": "1.39.0",
Expand Down

This file was deleted.

Loading

0 comments on commit 278ba7f

Please sign in to comment.