diff --git a/package-lock.json b/package-lock.json index ec093e863c..8c4e9c5dfb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,7 @@ "@wordpress/api-fetch": "^5.2.6", "@wordpress/components": "^19.5.0", "@wordpress/compose": "^5.0.6", - "@wordpress/e2e-test-utils": "^7.0.0", + "@wordpress/e2e-test-utils": "^11.13.0", "@wordpress/element": "^4.14.0", "@wordpress/eslint-plugin": "^11.1.0", "@wordpress/i18n": "^4.2.4", @@ -1791,10 +1791,11 @@ } }, "node_modules/@babel/runtime": { - "version": "7.19.0", - "license": "MIT", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.25.7.tgz", + "integrity": "sha512-FjoyLe754PMiYsFaN5C94ttGiOmBNYTf6pLr4xXHAT5uctHb092PBszndLDR5XA/jghQvn4n7JMHl7dmTgbm9w==", "dependencies": { - "regenerator-runtime": "^0.13.4" + "regenerator-runtime": "^0.14.0" }, "engines": { "node": ">=6.9.0" @@ -1811,6 +1812,11 @@ "node": ">=6.9.0" } }, + "node_modules/@babel/runtime/node_modules/regenerator-runtime": { + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", + "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==" + }, "node_modules/@babel/template": { "version": "7.22.15", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz", @@ -8527,23 +8533,24 @@ } }, "node_modules/@wordpress/e2e-test-utils": { - "version": "7.11.0", - "license": "GPL-2.0-or-later", - "dependencies": { - "@babel/runtime": "^7.16.0", - "@wordpress/api-fetch": "^6.12.0", - "@wordpress/keycodes": "^3.15.0", - "@wordpress/url": "^3.16.0", + "version": "11.13.0", + "resolved": "https://registry.npmjs.org/@wordpress/e2e-test-utils/-/e2e-test-utils-11.13.0.tgz", + "integrity": "sha512-NR4xVIKbyXyc4zq9cjVBNfhoMjBt6OgCoh6r7YSjP1ZRF5COr/Tq1rvPZErcRzCSnVRC6lm9FFgtRk7HGyfzgQ==", + "dependencies": { + "@babel/runtime": "7.25.7", + "@wordpress/api-fetch": "*", + "@wordpress/keycodes": "*", + "@wordpress/url": "*", "change-case": "^4.1.2", "form-data": "^4.0.0", - "lodash": "^4.17.21", - "node-fetch": "^2.6.0" + "node-fetch": "2.7.0" }, "engines": { - "node": ">=12" + "node": ">=18.12.0", + "npm": ">=8.19.2" }, "peerDependencies": { - "jest": ">=27", + "jest": ">=29", "puppeteer-core": ">=11" } }, @@ -8559,6 +8566,25 @@ "node": ">=12" } }, + "node_modules/@wordpress/e2e-test-utils/node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, "node_modules/@wordpress/element": { "version": "4.16.0", "license": "GPL-2.0-or-later", @@ -33159,12 +33185,6 @@ "dev": true, "license": "GPL-3.0-or-later", "dependencies": { - "chalk": "^4.1.2", - "columnify": "^1.5.4", - "commander": "^8.2.0", - "inquirer": "^8.2.0", - "replace-in-file": "^6.3.1", - "semver": "^7.3.5", "yaml": "^2.2.2" }, "bin": { @@ -33206,7 +33226,7 @@ "dev": true, "license": "GPL-3.0-or-later", "dependencies": { - "@wordpress/e2e-test-utils": "^7.0.0", + "@wordpress/e2e-test-utils": "^11.13.0", "css-xpath": "^1.0.0", "semver": "^7.3.5" }, diff --git a/packages/llms-e2e-test-utils/package.json b/packages/llms-e2e-test-utils/package.json index 8fbebd74f9..b801f9a016 100644 --- a/packages/llms-e2e-test-utils/package.json +++ b/packages/llms-e2e-test-utils/package.json @@ -21,7 +21,7 @@ }, "main": "src/index.js", "dependencies": { - "@wordpress/e2e-test-utils": "^7.0.0", + "@wordpress/e2e-test-utils": "^11.13.0", "css-xpath": "^1.0.0", "semver": "^7.3.5" }, diff --git a/packages/llms-e2e-test-utils/src/click.js b/packages/llms-e2e-test-utils/src/click.js index 61e3ea856a..b606b97d51 100644 --- a/packages/llms-e2e-test-utils/src/click.js +++ b/packages/llms-e2e-test-utils/src/click.js @@ -8,8 +8,6 @@ * @return {void} */ export async function click( selector ) { - const target = await page.$( selector ); - target.scrollIntoView(); await page.waitForSelector( selector ); await page.$eval( selector, ( el ) => el.click() ); } diff --git a/packages/llms-e2e-test-utils/src/run-setup-wizard.js b/packages/llms-e2e-test-utils/src/run-setup-wizard.js index ac06be75fa..d9cb86d382 100644 --- a/packages/llms-e2e-test-utils/src/run-setup-wizard.js +++ b/packages/llms-e2e-test-utils/src/run-setup-wizard.js @@ -4,7 +4,7 @@ import { findElementByText } from './find-element-by-text'; import { wpVersionCompare } from './wp-version-compare'; import { dismissEditorWelcomeGuide } from './dismiss-editor-welcome-guide'; -import { visitAdminPage } from '@wordpress/e2e-test-utils'; +import { visitAdminPage, clickButton } from '@wordpress/e2e-test-utils'; /** * Retrieve the Setup Wizard Page Title. @@ -78,22 +78,26 @@ export async function runSetupWizard( { } else if ( coursesToImport ) { // Import courses. - console.log('taking before screenshot'); - await page.screenshot({ - path: 'screenshots/before-selecting-courses-setup-wizard.jpg' - }); - // Select specified courses. for ( const courseTitle of coursesToImport ) { await clickElementByText( courseTitle, 'h3' ); } - console.log('taking after screenshot'); await page.screenshot({ path: 'screenshots/after-selecting-courses-setup-wizard.jpg' }); - await clickAndWait( '.llms-setup-actions .llms-button-primary' ); + await clickButton( 'Import Courses' ); + + await page.screenshot({ + path: 'screenshots/after-clicked-import-button.jpg' + }); + + await page.waitForNavigation(); + + await page.screenshot({ + path: 'screenshots/after-setup-wizard-navigation.jpg' + }); if ( 1 === coursesToImport.length ) { // Single course imported.