diff --git a/patches/@wordpress+e2e-test-utils+10.11.0.patch b/patches/@wordpress+e2e-test-utils+10.11.0.patch deleted file mode 100644 index 1ad40e079c8..00000000000 --- a/patches/@wordpress+e2e-test-utils+10.11.0.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/node_modules/@wordpress/e2e-test-utils/build/activate-theme.js b/node_modules/@wordpress/e2e-test-utils/build/activate-theme.js -index e171fe9..c1b2632 100644 ---- a/node_modules/@wordpress/e2e-test-utils/build/activate-theme.js -+++ b/node_modules/@wordpress/e2e-test-utils/build/activate-theme.js -@@ -25,6 +25,10 @@ async function activateTheme(slug) { - return; - } - await page.click(`div[data-slug="${slug}"] .button.activate`); -+ -+ // Switch to themes.php page as some themes can redirect to a different page after activation. -+ await (0, _visitAdminPage.visitAdminPage)('themes.php'); -+ - await page.waitForSelector(`div[data-slug="${slug}"].active`); - await (0, _switchUserToTest.switchUserToTest)(); - } diff --git a/patches/@wordpress+e2e-test-utils+10.12.0.patch b/patches/@wordpress+e2e-test-utils+10.12.0.patch new file mode 100644 index 00000000000..2fb9d88d9e4 --- /dev/null +++ b/patches/@wordpress+e2e-test-utils+10.12.0.patch @@ -0,0 +1,174 @@ +diff --git a/node_modules/@wordpress/e2e-test-utils/build-module/activate-plugin.js b/node_modules/@wordpress/e2e-test-utils/build-module/activate-plugin.js +index 37d6171..40c5dfa 100644 +--- a/node_modules/@wordpress/e2e-test-utils/build-module/activate-plugin.js ++++ b/node_modules/@wordpress/e2e-test-utils/build-module/activate-plugin.js +@@ -4,6 +4,7 @@ + import { switchUserToAdmin } from './switch-user-to-admin'; + import { switchUserToTest } from './switch-user-to-test'; + import { visitAdminPage } from './visit-admin-page'; ++import { isCurrentURL } from './is-current-url'; + + /** + * Activates an installed plugin. +@@ -19,6 +20,9 @@ export async function activatePlugin(slug) { + return; + } + await page.click(`tr[data-slug="${slug}"] .activate a`); ++ if (!isCurrentURL('plugins.php')) { ++ await visitAdminPage('plugins.php'); ++ } + await page.waitForSelector(`tr[data-slug="${slug}"] .deactivate a`); + await switchUserToTest(); + } +diff --git a/node_modules/@wordpress/e2e-test-utils/build-module/activate-plugin.js.map b/node_modules/@wordpress/e2e-test-utils/build-module/activate-plugin.js.map +index 2976b0c..fa11712 100644 +--- a/node_modules/@wordpress/e2e-test-utils/build-module/activate-plugin.js.map ++++ b/node_modules/@wordpress/e2e-test-utils/build-module/activate-plugin.js.map +@@ -1 +1 @@ +-{"version":3,"names":["switchUserToAdmin","switchUserToTest","visitAdminPage","activatePlugin","slug","disableLink","page","$","click","waitForSelector"],"sources":["@wordpress/e2e-test-utils/src/activate-plugin.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { switchUserToAdmin } from './switch-user-to-admin';\nimport { switchUserToTest } from './switch-user-to-test';\nimport { visitAdminPage } from './visit-admin-page';\n\n/**\n * Activates an installed plugin.\n *\n * @param {string} slug Plugin slug.\n */\nexport async function activatePlugin( slug ) {\n\tawait switchUserToAdmin();\n\tawait visitAdminPage( 'plugins.php' );\n\tconst disableLink = await page.$(\n\t\t`tr[data-slug=\"${ slug }\"] .deactivate a`\n\t);\n\tif ( disableLink ) {\n\t\tawait switchUserToTest();\n\t\treturn;\n\t}\n\tawait page.click( `tr[data-slug=\"${ slug }\"] .activate a` );\n\tawait page.waitForSelector( `tr[data-slug=\"${ slug }\"] .deactivate a` );\n\tawait switchUserToTest();\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,iBAAiB,QAAQ,wBAAwB;AAC1D,SAASC,gBAAgB,QAAQ,uBAAuB;AACxD,SAASC,cAAc,QAAQ,oBAAoB;;AAEnD;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeC,cAAcA,CAAEC,IAAI,EAAG;EAC5C,MAAMJ,iBAAiB,CAAC,CAAC;EACzB,MAAME,cAAc,CAAE,aAAc,CAAC;EACrC,MAAMG,WAAW,GAAG,MAAMC,IAAI,CAACC,CAAC,CAC9B,iBAAiBH,IAAM,kBACzB,CAAC;EACD,IAAKC,WAAW,EAAG;IAClB,MAAMJ,gBAAgB,CAAC,CAAC;IACxB;EACD;EACA,MAAMK,IAAI,CAACE,KAAK,CAAG,iBAAiBJ,IAAM,gBAAgB,CAAC;EAC3D,MAAME,IAAI,CAACG,eAAe,CAAG,iBAAiBL,IAAM,kBAAkB,CAAC;EACvE,MAAMH,gBAAgB,CAAC,CAAC;AACzB"} +\ No newline at end of file ++{"version":3,"names":["switchUserToAdmin","switchUserToTest","visitAdminPage","isCurrentURL","activatePlugin","slug","disableLink","page","$","click","waitForSelector"],"sources":["@wordpress/e2e-test-utils/src/activate-plugin.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { switchUserToAdmin } from './switch-user-to-admin';\nimport { switchUserToTest } from './switch-user-to-test';\nimport { visitAdminPage } from './visit-admin-page';\nimport { isCurrentURL } from './is-current-url';\n\n/**\n * Activates an installed plugin.\n *\n * @param {string} slug Plugin slug.\n */\nexport async function activatePlugin( slug ) {\n\tawait switchUserToAdmin();\n\tawait visitAdminPage( 'plugins.php' );\n\tconst disableLink = await page.$(\n\t\t`tr[data-slug=\"${ slug }\"] .deactivate a`\n\t);\n\tif ( disableLink ) {\n\t\tawait switchUserToTest();\n\t\treturn;\n\t}\n\tawait page.click( `tr[data-slug=\"${ slug }\"] .activate a` );\n\n\tif ( ! isCurrentURL( 'plugins.php' ) ) {\n\t\tawait visitAdminPage( 'plugins.php' );\n\t}\n\tawait page.waitForSelector( `tr[data-slug=\"${ slug }\"] .deactivate a` );\n\tawait switchUserToTest();\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,iBAAiB,QAAQ,wBAAwB;AAC1D,SAASC,gBAAgB,QAAQ,uBAAuB;AACxD,SAASC,cAAc,QAAQ,oBAAoB;AACnD,SAASC,YAAY,QAAQ,kBAAkB;;AAE/C;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeC,cAAcA,CAAEC,IAAI,EAAG;EAC5C,MAAML,iBAAiB,CAAC,CAAC;EACzB,MAAME,cAAc,CAAE,aAAc,CAAC;EACrC,MAAMI,WAAW,GAAG,MAAMC,IAAI,CAACC,CAAC,CAC9B,iBAAiBH,IAAM,kBACzB,CAAC;EACD,IAAKC,WAAW,EAAG;IAClB,MAAML,gBAAgB,CAAC,CAAC;IACxB;EACD;EACA,MAAMM,IAAI,CAACE,KAAK,CAAG,iBAAiBJ,IAAM,gBAAgB,CAAC;EAE3D,IAAK,CAAEF,YAAY,CAAE,aAAc,CAAC,EAAG;IACtC,MAAMD,cAAc,CAAE,aAAc,CAAC;EACtC;EACA,MAAMK,IAAI,CAACG,eAAe,CAAG,iBAAiBL,IAAM,kBAAkB,CAAC;EACvE,MAAMJ,gBAAgB,CAAC,CAAC;AACzB"} +\ No newline at end of file +diff --git a/node_modules/@wordpress/e2e-test-utils/build-module/activate-theme.js b/node_modules/@wordpress/e2e-test-utils/build-module/activate-theme.js +index 06d169a..9723e53 100644 +--- a/node_modules/@wordpress/e2e-test-utils/build-module/activate-theme.js ++++ b/node_modules/@wordpress/e2e-test-utils/build-module/activate-theme.js +@@ -4,6 +4,7 @@ + import { switchUserToAdmin } from './switch-user-to-admin'; + import { switchUserToTest } from './switch-user-to-test'; + import { visitAdminPage } from './visit-admin-page'; ++import { isCurrentURL } from './is-current-url'; + + /** + * Activates an installed theme. +@@ -19,6 +20,9 @@ export async function activateTheme(slug) { + return; + } + await page.click(`div[data-slug="${slug}"] .button.activate`); ++ if (!isCurrentURL('themes.php')) { ++ await visitAdminPage('themes.php'); ++ } + await page.waitForSelector(`div[data-slug="${slug}"].active`); + await switchUserToTest(); + } +diff --git a/node_modules/@wordpress/e2e-test-utils/build-module/activate-theme.js.map b/node_modules/@wordpress/e2e-test-utils/build-module/activate-theme.js.map +index 7613e0e..f821f1e 100644 +--- a/node_modules/@wordpress/e2e-test-utils/build-module/activate-theme.js.map ++++ b/node_modules/@wordpress/e2e-test-utils/build-module/activate-theme.js.map +@@ -1 +1 @@ +-{"version":3,"names":["switchUserToAdmin","switchUserToTest","visitAdminPage","activateTheme","slug","activateButton","page","$","click","waitForSelector"],"sources":["@wordpress/e2e-test-utils/src/activate-theme.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { switchUserToAdmin } from './switch-user-to-admin';\nimport { switchUserToTest } from './switch-user-to-test';\nimport { visitAdminPage } from './visit-admin-page';\n\n/**\n * Activates an installed theme.\n *\n * @param {string} slug Theme slug.\n */\nexport async function activateTheme( slug ) {\n\tawait switchUserToAdmin();\n\tawait visitAdminPage( 'themes.php' );\n\n\tconst activateButton = await page.$(\n\t\t`div[data-slug=\"${ slug }\"] .button.activate`\n\t);\n\tif ( ! activateButton ) {\n\t\tawait switchUserToTest();\n\t\treturn;\n\t}\n\n\tawait page.click( `div[data-slug=\"${ slug }\"] .button.activate` );\n\tawait page.waitForSelector( `div[data-slug=\"${ slug }\"].active` );\n\tawait switchUserToTest();\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,iBAAiB,QAAQ,wBAAwB;AAC1D,SAASC,gBAAgB,QAAQ,uBAAuB;AACxD,SAASC,cAAc,QAAQ,oBAAoB;;AAEnD;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeC,aAAaA,CAAEC,IAAI,EAAG;EAC3C,MAAMJ,iBAAiB,CAAC,CAAC;EACzB,MAAME,cAAc,CAAE,YAAa,CAAC;EAEpC,MAAMG,cAAc,GAAG,MAAMC,IAAI,CAACC,CAAC,CACjC,kBAAkBH,IAAM,qBAC1B,CAAC;EACD,IAAK,CAAEC,cAAc,EAAG;IACvB,MAAMJ,gBAAgB,CAAC,CAAC;IACxB;EACD;EAEA,MAAMK,IAAI,CAACE,KAAK,CAAG,kBAAkBJ,IAAM,qBAAqB,CAAC;EACjE,MAAME,IAAI,CAACG,eAAe,CAAG,kBAAkBL,IAAM,WAAW,CAAC;EACjE,MAAMH,gBAAgB,CAAC,CAAC;AACzB"} +\ No newline at end of file ++{"version":3,"names":["switchUserToAdmin","switchUserToTest","visitAdminPage","isCurrentURL","activateTheme","slug","activateButton","page","$","click","waitForSelector"],"sources":["@wordpress/e2e-test-utils/src/activate-theme.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { switchUserToAdmin } from './switch-user-to-admin';\nimport { switchUserToTest } from './switch-user-to-test';\nimport { visitAdminPage } from './visit-admin-page';\nimport { isCurrentURL } from './is-current-url';\n\n/**\n * Activates an installed theme.\n *\n * @param {string} slug Theme slug.\n */\nexport async function activateTheme( slug ) {\n\tawait switchUserToAdmin();\n\tawait visitAdminPage( 'themes.php' );\n\n\tconst activateButton = await page.$(\n\t\t`div[data-slug=\"${ slug }\"] .button.activate`\n\t);\n\tif ( ! activateButton ) {\n\t\tawait switchUserToTest();\n\t\treturn;\n\t}\n\n\tawait page.click( `div[data-slug=\"${ slug }\"] .button.activate` );\n\n\tif ( ! isCurrentURL( 'themes.php' ) ) {\n\t\tawait visitAdminPage( 'themes.php' );\n\t}\n\tawait page.waitForSelector( `div[data-slug=\"${ slug }\"].active` );\n\tawait switchUserToTest();\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,iBAAiB,QAAQ,wBAAwB;AAC1D,SAASC,gBAAgB,QAAQ,uBAAuB;AACxD,SAASC,cAAc,QAAQ,oBAAoB;AACnD,SAASC,YAAY,QAAQ,kBAAkB;;AAE/C;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeC,aAAaA,CAAEC,IAAI,EAAG;EAC3C,MAAML,iBAAiB,CAAC,CAAC;EACzB,MAAME,cAAc,CAAE,YAAa,CAAC;EAEpC,MAAMI,cAAc,GAAG,MAAMC,IAAI,CAACC,CAAC,CACjC,kBAAkBH,IAAM,qBAC1B,CAAC;EACD,IAAK,CAAEC,cAAc,EAAG;IACvB,MAAML,gBAAgB,CAAC,CAAC;IACxB;EACD;EAEA,MAAMM,IAAI,CAACE,KAAK,CAAG,kBAAkBJ,IAAM,qBAAqB,CAAC;EAEjE,IAAK,CAAEF,YAAY,CAAE,YAAa,CAAC,EAAG;IACrC,MAAMD,cAAc,CAAE,YAAa,CAAC;EACrC;EACA,MAAMK,IAAI,CAACG,eAAe,CAAG,kBAAkBL,IAAM,WAAW,CAAC;EACjE,MAAMJ,gBAAgB,CAAC,CAAC;AACzB"} +\ No newline at end of file +diff --git a/node_modules/@wordpress/e2e-test-utils/build-module/login-user.js b/node_modules/@wordpress/e2e-test-utils/build-module/login-user.js +index 9f5572c..6024df6 100644 +--- a/node_modules/@wordpress/e2e-test-utils/build-module/login-user.js ++++ b/node_modules/@wordpress/e2e-test-utils/build-module/login-user.js +@@ -24,7 +24,8 @@ export async function loginUser(username = WP_USERNAME, password = WP_PASSWORD) + await page.focus('#user_pass'); + await pressKeyWithModifier('primary', 'a'); + await page.type('#user_pass', password); +- const waitForLoginNavigation = page.waitForNavigation(); +- await Promise.all([waitForLoginNavigation, page.click('#wp-submit')]); ++ await Promise.all([page.click('#wp-submit'), page.waitForNavigation({ ++ waitUntil: 'networkidle0' ++ })]); + } + //# sourceMappingURL=login-user.js.map +\ No newline at end of file +diff --git a/node_modules/@wordpress/e2e-test-utils/build-module/login-user.js.map b/node_modules/@wordpress/e2e-test-utils/build-module/login-user.js.map +index c86c077..220f4fb 100644 +--- a/node_modules/@wordpress/e2e-test-utils/build-module/login-user.js.map ++++ b/node_modules/@wordpress/e2e-test-utils/build-module/login-user.js.map +@@ -1 +1 @@ +-{"version":3,"names":["WP_USERNAME","WP_PASSWORD","createURL","isCurrentURL","pressKeyWithModifier","loginUser","username","password","waitForLoginPageNavigation","page","waitForNavigation","goto","focus","type","waitForLoginNavigation","Promise","all","click"],"sources":["@wordpress/e2e-test-utils/src/login-user.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { WP_USERNAME, WP_PASSWORD } from './shared/config';\nimport { createURL } from './create-url';\nimport { isCurrentURL } from './is-current-url';\nimport { pressKeyWithModifier } from './press-key-with-modifier';\n\n/**\n * Performs log in with specified username and password.\n *\n * @param {?string} username String to be used as user credential.\n * @param {?string} password String to be used as user credential.\n */\nexport async function loginUser(\n\tusername = WP_USERNAME,\n\tpassword = WP_PASSWORD\n) {\n\tif ( ! isCurrentURL( 'wp-login.php' ) ) {\n\t\tconst waitForLoginPageNavigation = page.waitForNavigation();\n\t\tawait page.goto( createURL( 'wp-login.php' ) );\n\t\tawait waitForLoginPageNavigation;\n\t}\n\n\tawait page.focus( '#user_login' );\n\tawait pressKeyWithModifier( 'primary', 'a' );\n\tawait page.type( '#user_login', username );\n\tawait page.focus( '#user_pass' );\n\tawait pressKeyWithModifier( 'primary', 'a' );\n\tawait page.type( '#user_pass', password );\n\n\tconst waitForLoginNavigation = page.waitForNavigation();\n\tawait Promise.all( [ waitForLoginNavigation, page.click( '#wp-submit' ) ] );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,WAAW,QAAQ,iBAAiB;AAC1D,SAASC,SAAS,QAAQ,cAAc;AACxC,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAASC,oBAAoB,QAAQ,2BAA2B;;AAEhE;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeC,SAASA,CAC9BC,QAAQ,GAAGN,WAAW,EACtBO,QAAQ,GAAGN,WAAW,EACrB;EACD,IAAK,CAAEE,YAAY,CAAE,cAAe,CAAC,EAAG;IACvC,MAAMK,0BAA0B,GAAGC,IAAI,CAACC,iBAAiB,CAAC,CAAC;IAC3D,MAAMD,IAAI,CAACE,IAAI,CAAET,SAAS,CAAE,cAAe,CAAE,CAAC;IAC9C,MAAMM,0BAA0B;EACjC;EAEA,MAAMC,IAAI,CAACG,KAAK,CAAE,aAAc,CAAC;EACjC,MAAMR,oBAAoB,CAAE,SAAS,EAAE,GAAI,CAAC;EAC5C,MAAMK,IAAI,CAACI,IAAI,CAAE,aAAa,EAAEP,QAAS,CAAC;EAC1C,MAAMG,IAAI,CAACG,KAAK,CAAE,YAAa,CAAC;EAChC,MAAMR,oBAAoB,CAAE,SAAS,EAAE,GAAI,CAAC;EAC5C,MAAMK,IAAI,CAACI,IAAI,CAAE,YAAY,EAAEN,QAAS,CAAC;EAEzC,MAAMO,sBAAsB,GAAGL,IAAI,CAACC,iBAAiB,CAAC,CAAC;EACvD,MAAMK,OAAO,CAACC,GAAG,CAAE,CAAEF,sBAAsB,EAAEL,IAAI,CAACQ,KAAK,CAAE,YAAa,CAAC,CAAG,CAAC;AAC5E"} +\ No newline at end of file ++{"version":3,"names":["WP_USERNAME","WP_PASSWORD","createURL","isCurrentURL","pressKeyWithModifier","loginUser","username","password","waitForLoginPageNavigation","page","waitForNavigation","goto","focus","type","Promise","all","click","waitUntil"],"sources":["@wordpress/e2e-test-utils/src/login-user.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { WP_USERNAME, WP_PASSWORD } from './shared/config';\nimport { createURL } from './create-url';\nimport { isCurrentURL } from './is-current-url';\nimport { pressKeyWithModifier } from './press-key-with-modifier';\n\n/**\n * Performs log in with specified username and password.\n *\n * @param {?string} username String to be used as user credential.\n * @param {?string} password String to be used as user credential.\n */\nexport async function loginUser(\n\tusername = WP_USERNAME,\n\tpassword = WP_PASSWORD\n) {\n\tif ( ! isCurrentURL( 'wp-login.php' ) ) {\n\t\tconst waitForLoginPageNavigation = page.waitForNavigation();\n\t\tawait page.goto( createURL( 'wp-login.php' ) );\n\t\tawait waitForLoginPageNavigation;\n\t}\n\n\tawait page.focus( '#user_login' );\n\tawait pressKeyWithModifier( 'primary', 'a' );\n\tawait page.type( '#user_login', username );\n\tawait page.focus( '#user_pass' );\n\tawait pressKeyWithModifier( 'primary', 'a' );\n\tawait page.type( '#user_pass', password );\n\n\tawait Promise.all( [\n\t\tpage.click( '#wp-submit' ),\n\t\tpage.waitForNavigation( { waitUntil: 'networkidle0' } ),\n\t] );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,WAAW,QAAQ,iBAAiB;AAC1D,SAASC,SAAS,QAAQ,cAAc;AACxC,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAASC,oBAAoB,QAAQ,2BAA2B;;AAEhE;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeC,SAASA,CAC9BC,QAAQ,GAAGN,WAAW,EACtBO,QAAQ,GAAGN,WAAW,EACrB;EACD,IAAK,CAAEE,YAAY,CAAE,cAAe,CAAC,EAAG;IACvC,MAAMK,0BAA0B,GAAGC,IAAI,CAACC,iBAAiB,CAAC,CAAC;IAC3D,MAAMD,IAAI,CAACE,IAAI,CAAET,SAAS,CAAE,cAAe,CAAE,CAAC;IAC9C,MAAMM,0BAA0B;EACjC;EAEA,MAAMC,IAAI,CAACG,KAAK,CAAE,aAAc,CAAC;EACjC,MAAMR,oBAAoB,CAAE,SAAS,EAAE,GAAI,CAAC;EAC5C,MAAMK,IAAI,CAACI,IAAI,CAAE,aAAa,EAAEP,QAAS,CAAC;EAC1C,MAAMG,IAAI,CAACG,KAAK,CAAE,YAAa,CAAC;EAChC,MAAMR,oBAAoB,CAAE,SAAS,EAAE,GAAI,CAAC;EAC5C,MAAMK,IAAI,CAACI,IAAI,CAAE,YAAY,EAAEN,QAAS,CAAC;EAEzC,MAAMO,OAAO,CAACC,GAAG,CAAE,CAClBN,IAAI,CAACO,KAAK,CAAE,YAAa,CAAC,EAC1BP,IAAI,CAACC,iBAAiB,CAAE;IAAEO,SAAS,EAAE;EAAe,CAAE,CAAC,CACtD,CAAC;AACJ"} +\ No newline at end of file +diff --git a/node_modules/@wordpress/e2e-test-utils/build/activate-plugin.js b/node_modules/@wordpress/e2e-test-utils/build/activate-plugin.js +index e2bdf39..ff419cf 100644 +--- a/node_modules/@wordpress/e2e-test-utils/build/activate-plugin.js ++++ b/node_modules/@wordpress/e2e-test-utils/build/activate-plugin.js +@@ -7,6 +7,7 @@ exports.activatePlugin = activatePlugin; + var _switchUserToAdmin = require("./switch-user-to-admin"); + var _switchUserToTest = require("./switch-user-to-test"); + var _visitAdminPage = require("./visit-admin-page"); ++var _isCurrentUrl = require("./is-current-url"); + /** + * Internal dependencies + */ +@@ -25,6 +26,9 @@ async function activatePlugin(slug) { + return; + } + await page.click(`tr[data-slug="${slug}"] .activate a`); ++ if (!(0, _isCurrentUrl.isCurrentURL)('plugins.php')) { ++ await (0, _visitAdminPage.visitAdminPage)('plugins.php'); ++ } + await page.waitForSelector(`tr[data-slug="${slug}"] .deactivate a`); + await (0, _switchUserToTest.switchUserToTest)(); + } +diff --git a/node_modules/@wordpress/e2e-test-utils/build/activate-plugin.js.map b/node_modules/@wordpress/e2e-test-utils/build/activate-plugin.js.map +index 6506e80..110968b 100644 +--- a/node_modules/@wordpress/e2e-test-utils/build/activate-plugin.js.map ++++ b/node_modules/@wordpress/e2e-test-utils/build/activate-plugin.js.map +@@ -1 +1 @@ +-{"version":3,"names":["_switchUserToAdmin","require","_switchUserToTest","_visitAdminPage","activatePlugin","slug","switchUserToAdmin","visitAdminPage","disableLink","page","$","switchUserToTest","click","waitForSelector"],"sources":["@wordpress/e2e-test-utils/src/activate-plugin.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { switchUserToAdmin } from './switch-user-to-admin';\nimport { switchUserToTest } from './switch-user-to-test';\nimport { visitAdminPage } from './visit-admin-page';\n\n/**\n * Activates an installed plugin.\n *\n * @param {string} slug Plugin slug.\n */\nexport async function activatePlugin( slug ) {\n\tawait switchUserToAdmin();\n\tawait visitAdminPage( 'plugins.php' );\n\tconst disableLink = await page.$(\n\t\t`tr[data-slug=\"${ slug }\"] .deactivate a`\n\t);\n\tif ( disableLink ) {\n\t\tawait switchUserToTest();\n\t\treturn;\n\t}\n\tawait page.click( `tr[data-slug=\"${ slug }\"] .activate a` );\n\tawait page.waitForSelector( `tr[data-slug=\"${ slug }\"] .deactivate a` );\n\tawait switchUserToTest();\n}\n"],"mappings":";;;;;;AAGA,IAAAA,kBAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AALA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACO,eAAeG,cAAcA,CAAEC,IAAI,EAAG;EAC5C,MAAM,IAAAC,oCAAiB,EAAC,CAAC;EACzB,MAAM,IAAAC,8BAAc,EAAE,aAAc,CAAC;EACrC,MAAMC,WAAW,GAAG,MAAMC,IAAI,CAACC,CAAC,CAC9B,iBAAiBL,IAAM,kBACzB,CAAC;EACD,IAAKG,WAAW,EAAG;IAClB,MAAM,IAAAG,kCAAgB,EAAC,CAAC;IACxB;EACD;EACA,MAAMF,IAAI,CAACG,KAAK,CAAG,iBAAiBP,IAAM,gBAAgB,CAAC;EAC3D,MAAMI,IAAI,CAACI,eAAe,CAAG,iBAAiBR,IAAM,kBAAkB,CAAC;EACvE,MAAM,IAAAM,kCAAgB,EAAC,CAAC;AACzB"} +\ No newline at end of file ++{"version":3,"names":["_switchUserToAdmin","require","_switchUserToTest","_visitAdminPage","_isCurrentUrl","activatePlugin","slug","switchUserToAdmin","visitAdminPage","disableLink","page","$","switchUserToTest","click","isCurrentURL","waitForSelector"],"sources":["@wordpress/e2e-test-utils/src/activate-plugin.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { switchUserToAdmin } from './switch-user-to-admin';\nimport { switchUserToTest } from './switch-user-to-test';\nimport { visitAdminPage } from './visit-admin-page';\nimport { isCurrentURL } from './is-current-url';\n\n/**\n * Activates an installed plugin.\n *\n * @param {string} slug Plugin slug.\n */\nexport async function activatePlugin( slug ) {\n\tawait switchUserToAdmin();\n\tawait visitAdminPage( 'plugins.php' );\n\tconst disableLink = await page.$(\n\t\t`tr[data-slug=\"${ slug }\"] .deactivate a`\n\t);\n\tif ( disableLink ) {\n\t\tawait switchUserToTest();\n\t\treturn;\n\t}\n\tawait page.click( `tr[data-slug=\"${ slug }\"] .activate a` );\n\n\tif ( ! isCurrentURL( 'plugins.php' ) ) {\n\t\tawait visitAdminPage( 'plugins.php' );\n\t}\n\tawait page.waitForSelector( `tr[data-slug=\"${ slug }\"] .deactivate a` );\n\tawait switchUserToTest();\n}\n"],"mappings":";;;;;;AAGA,IAAAA,kBAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AANA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACO,eAAeI,cAAcA,CAAEC,IAAI,EAAG;EAC5C,MAAM,IAAAC,oCAAiB,EAAC,CAAC;EACzB,MAAM,IAAAC,8BAAc,EAAE,aAAc,CAAC;EACrC,MAAMC,WAAW,GAAG,MAAMC,IAAI,CAACC,CAAC,CAC9B,iBAAiBL,IAAM,kBACzB,CAAC;EACD,IAAKG,WAAW,EAAG;IAClB,MAAM,IAAAG,kCAAgB,EAAC,CAAC;IACxB;EACD;EACA,MAAMF,IAAI,CAACG,KAAK,CAAG,iBAAiBP,IAAM,gBAAgB,CAAC;EAE3D,IAAK,CAAE,IAAAQ,0BAAY,EAAE,aAAc,CAAC,EAAG;IACtC,MAAM,IAAAN,8BAAc,EAAE,aAAc,CAAC;EACtC;EACA,MAAME,IAAI,CAACK,eAAe,CAAG,iBAAiBT,IAAM,kBAAkB,CAAC;EACvE,MAAM,IAAAM,kCAAgB,EAAC,CAAC;AACzB"} +\ No newline at end of file +diff --git a/node_modules/@wordpress/e2e-test-utils/build/activate-theme.js b/node_modules/@wordpress/e2e-test-utils/build/activate-theme.js +index e171fe9..50884d2 100644 +--- a/node_modules/@wordpress/e2e-test-utils/build/activate-theme.js ++++ b/node_modules/@wordpress/e2e-test-utils/build/activate-theme.js +@@ -7,6 +7,7 @@ exports.activateTheme = activateTheme; + var _switchUserToAdmin = require("./switch-user-to-admin"); + var _switchUserToTest = require("./switch-user-to-test"); + var _visitAdminPage = require("./visit-admin-page"); ++var _isCurrentUrl = require("./is-current-url"); + /** + * Internal dependencies + */ +@@ -25,6 +26,9 @@ async function activateTheme(slug) { + return; + } + await page.click(`div[data-slug="${slug}"] .button.activate`); ++ if (!(0, _isCurrentUrl.isCurrentURL)('themes.php')) { ++ await (0, _visitAdminPage.visitAdminPage)('themes.php'); ++ } + await page.waitForSelector(`div[data-slug="${slug}"].active`); + await (0, _switchUserToTest.switchUserToTest)(); + } +diff --git a/node_modules/@wordpress/e2e-test-utils/build/activate-theme.js.map b/node_modules/@wordpress/e2e-test-utils/build/activate-theme.js.map +index 7d50b7f..be7b6fe 100644 +--- a/node_modules/@wordpress/e2e-test-utils/build/activate-theme.js.map ++++ b/node_modules/@wordpress/e2e-test-utils/build/activate-theme.js.map +@@ -1 +1 @@ +-{"version":3,"names":["_switchUserToAdmin","require","_switchUserToTest","_visitAdminPage","activateTheme","slug","switchUserToAdmin","visitAdminPage","activateButton","page","$","switchUserToTest","click","waitForSelector"],"sources":["@wordpress/e2e-test-utils/src/activate-theme.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { switchUserToAdmin } from './switch-user-to-admin';\nimport { switchUserToTest } from './switch-user-to-test';\nimport { visitAdminPage } from './visit-admin-page';\n\n/**\n * Activates an installed theme.\n *\n * @param {string} slug Theme slug.\n */\nexport async function activateTheme( slug ) {\n\tawait switchUserToAdmin();\n\tawait visitAdminPage( 'themes.php' );\n\n\tconst activateButton = await page.$(\n\t\t`div[data-slug=\"${ slug }\"] .button.activate`\n\t);\n\tif ( ! activateButton ) {\n\t\tawait switchUserToTest();\n\t\treturn;\n\t}\n\n\tawait page.click( `div[data-slug=\"${ slug }\"] .button.activate` );\n\tawait page.waitForSelector( `div[data-slug=\"${ slug }\"].active` );\n\tawait switchUserToTest();\n}\n"],"mappings":";;;;;;AAGA,IAAAA,kBAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AALA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACO,eAAeG,aAAaA,CAAEC,IAAI,EAAG;EAC3C,MAAM,IAAAC,oCAAiB,EAAC,CAAC;EACzB,MAAM,IAAAC,8BAAc,EAAE,YAAa,CAAC;EAEpC,MAAMC,cAAc,GAAG,MAAMC,IAAI,CAACC,CAAC,CACjC,kBAAkBL,IAAM,qBAC1B,CAAC;EACD,IAAK,CAAEG,cAAc,EAAG;IACvB,MAAM,IAAAG,kCAAgB,EAAC,CAAC;IACxB;EACD;EAEA,MAAMF,IAAI,CAACG,KAAK,CAAG,kBAAkBP,IAAM,qBAAqB,CAAC;EACjE,MAAMI,IAAI,CAACI,eAAe,CAAG,kBAAkBR,IAAM,WAAW,CAAC;EACjE,MAAM,IAAAM,kCAAgB,EAAC,CAAC;AACzB"} +\ No newline at end of file ++{"version":3,"names":["_switchUserToAdmin","require","_switchUserToTest","_visitAdminPage","_isCurrentUrl","activateTheme","slug","switchUserToAdmin","visitAdminPage","activateButton","page","$","switchUserToTest","click","isCurrentURL","waitForSelector"],"sources":["@wordpress/e2e-test-utils/src/activate-theme.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { switchUserToAdmin } from './switch-user-to-admin';\nimport { switchUserToTest } from './switch-user-to-test';\nimport { visitAdminPage } from './visit-admin-page';\nimport { isCurrentURL } from './is-current-url';\n\n/**\n * Activates an installed theme.\n *\n * @param {string} slug Theme slug.\n */\nexport async function activateTheme( slug ) {\n\tawait switchUserToAdmin();\n\tawait visitAdminPage( 'themes.php' );\n\n\tconst activateButton = await page.$(\n\t\t`div[data-slug=\"${ slug }\"] .button.activate`\n\t);\n\tif ( ! activateButton ) {\n\t\tawait switchUserToTest();\n\t\treturn;\n\t}\n\n\tawait page.click( `div[data-slug=\"${ slug }\"] .button.activate` );\n\n\tif ( ! isCurrentURL( 'themes.php' ) ) {\n\t\tawait visitAdminPage( 'themes.php' );\n\t}\n\tawait page.waitForSelector( `div[data-slug=\"${ slug }\"].active` );\n\tawait switchUserToTest();\n}\n"],"mappings":";;;;;;AAGA,IAAAA,kBAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AANA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACO,eAAeI,aAAaA,CAAEC,IAAI,EAAG;EAC3C,MAAM,IAAAC,oCAAiB,EAAC,CAAC;EACzB,MAAM,IAAAC,8BAAc,EAAE,YAAa,CAAC;EAEpC,MAAMC,cAAc,GAAG,MAAMC,IAAI,CAACC,CAAC,CACjC,kBAAkBL,IAAM,qBAC1B,CAAC;EACD,IAAK,CAAEG,cAAc,EAAG;IACvB,MAAM,IAAAG,kCAAgB,EAAC,CAAC;IACxB;EACD;EAEA,MAAMF,IAAI,CAACG,KAAK,CAAG,kBAAkBP,IAAM,qBAAqB,CAAC;EAEjE,IAAK,CAAE,IAAAQ,0BAAY,EAAE,YAAa,CAAC,EAAG;IACrC,MAAM,IAAAN,8BAAc,EAAE,YAAa,CAAC;EACrC;EACA,MAAME,IAAI,CAACK,eAAe,CAAG,kBAAkBT,IAAM,WAAW,CAAC;EACjE,MAAM,IAAAM,kCAAgB,EAAC,CAAC;AACzB"} +\ No newline at end of file +diff --git a/node_modules/@wordpress/e2e-test-utils/build/login-user.js b/node_modules/@wordpress/e2e-test-utils/build/login-user.js +index 86722d1..703d223 100644 +--- a/node_modules/@wordpress/e2e-test-utils/build/login-user.js ++++ b/node_modules/@wordpress/e2e-test-utils/build/login-user.js +@@ -30,7 +30,8 @@ async function loginUser(username = _config.WP_USERNAME, password = _config.WP_P + await page.focus('#user_pass'); + await (0, _pressKeyWithModifier.pressKeyWithModifier)('primary', 'a'); + await page.type('#user_pass', password); +- const waitForLoginNavigation = page.waitForNavigation(); +- await Promise.all([waitForLoginNavigation, page.click('#wp-submit')]); ++ await Promise.all([page.click('#wp-submit'), page.waitForNavigation({ ++ waitUntil: 'networkidle0' ++ })]); + } + //# sourceMappingURL=login-user.js.map +\ No newline at end of file +diff --git a/node_modules/@wordpress/e2e-test-utils/build/login-user.js.map b/node_modules/@wordpress/e2e-test-utils/build/login-user.js.map +index e5dbc9a..056d443 100644 +--- a/node_modules/@wordpress/e2e-test-utils/build/login-user.js.map ++++ b/node_modules/@wordpress/e2e-test-utils/build/login-user.js.map +@@ -1 +1 @@ +-{"version":3,"names":["_config","require","_createUrl","_isCurrentUrl","_pressKeyWithModifier","loginUser","username","WP_USERNAME","password","WP_PASSWORD","isCurrentURL","waitForLoginPageNavigation","page","waitForNavigation","goto","createURL","focus","pressKeyWithModifier","type","waitForLoginNavigation","Promise","all","click"],"sources":["@wordpress/e2e-test-utils/src/login-user.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { WP_USERNAME, WP_PASSWORD } from './shared/config';\nimport { createURL } from './create-url';\nimport { isCurrentURL } from './is-current-url';\nimport { pressKeyWithModifier } from './press-key-with-modifier';\n\n/**\n * Performs log in with specified username and password.\n *\n * @param {?string} username String to be used as user credential.\n * @param {?string} password String to be used as user credential.\n */\nexport async function loginUser(\n\tusername = WP_USERNAME,\n\tpassword = WP_PASSWORD\n) {\n\tif ( ! isCurrentURL( 'wp-login.php' ) ) {\n\t\tconst waitForLoginPageNavigation = page.waitForNavigation();\n\t\tawait page.goto( createURL( 'wp-login.php' ) );\n\t\tawait waitForLoginPageNavigation;\n\t}\n\n\tawait page.focus( '#user_login' );\n\tawait pressKeyWithModifier( 'primary', 'a' );\n\tawait page.type( '#user_login', username );\n\tawait page.focus( '#user_pass' );\n\tawait pressKeyWithModifier( 'primary', 'a' );\n\tawait page.type( '#user_pass', password );\n\n\tconst waitForLoginNavigation = page.waitForNavigation();\n\tawait Promise.all( [ waitForLoginNavigation, page.click( '#wp-submit' ) ] );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AACA,IAAAG,qBAAA,GAAAH,OAAA;AANA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACO,eAAeI,SAASA,CAC9BC,QAAQ,GAAGC,mBAAW,EACtBC,QAAQ,GAAGC,mBAAW,EACrB;EACD,IAAK,CAAE,IAAAC,0BAAY,EAAE,cAAe,CAAC,EAAG;IACvC,MAAMC,0BAA0B,GAAGC,IAAI,CAACC,iBAAiB,CAAC,CAAC;IAC3D,MAAMD,IAAI,CAACE,IAAI,CAAE,IAAAC,oBAAS,EAAE,cAAe,CAAE,CAAC;IAC9C,MAAMJ,0BAA0B;EACjC;EAEA,MAAMC,IAAI,CAACI,KAAK,CAAE,aAAc,CAAC;EACjC,MAAM,IAAAC,0CAAoB,EAAE,SAAS,EAAE,GAAI,CAAC;EAC5C,MAAML,IAAI,CAACM,IAAI,CAAE,aAAa,EAAEZ,QAAS,CAAC;EAC1C,MAAMM,IAAI,CAACI,KAAK,CAAE,YAAa,CAAC;EAChC,MAAM,IAAAC,0CAAoB,EAAE,SAAS,EAAE,GAAI,CAAC;EAC5C,MAAML,IAAI,CAACM,IAAI,CAAE,YAAY,EAAEV,QAAS,CAAC;EAEzC,MAAMW,sBAAsB,GAAGP,IAAI,CAACC,iBAAiB,CAAC,CAAC;EACvD,MAAMO,OAAO,CAACC,GAAG,CAAE,CAAEF,sBAAsB,EAAEP,IAAI,CAACU,KAAK,CAAE,YAAa,CAAC,CAAG,CAAC;AAC5E"} +\ No newline at end of file ++{"version":3,"names":["_config","require","_createUrl","_isCurrentUrl","_pressKeyWithModifier","loginUser","username","WP_USERNAME","password","WP_PASSWORD","isCurrentURL","waitForLoginPageNavigation","page","waitForNavigation","goto","createURL","focus","pressKeyWithModifier","type","Promise","all","click","waitUntil"],"sources":["@wordpress/e2e-test-utils/src/login-user.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { WP_USERNAME, WP_PASSWORD } from './shared/config';\nimport { createURL } from './create-url';\nimport { isCurrentURL } from './is-current-url';\nimport { pressKeyWithModifier } from './press-key-with-modifier';\n\n/**\n * Performs log in with specified username and password.\n *\n * @param {?string} username String to be used as user credential.\n * @param {?string} password String to be used as user credential.\n */\nexport async function loginUser(\n\tusername = WP_USERNAME,\n\tpassword = WP_PASSWORD\n) {\n\tif ( ! isCurrentURL( 'wp-login.php' ) ) {\n\t\tconst waitForLoginPageNavigation = page.waitForNavigation();\n\t\tawait page.goto( createURL( 'wp-login.php' ) );\n\t\tawait waitForLoginPageNavigation;\n\t}\n\n\tawait page.focus( '#user_login' );\n\tawait pressKeyWithModifier( 'primary', 'a' );\n\tawait page.type( '#user_login', username );\n\tawait page.focus( '#user_pass' );\n\tawait pressKeyWithModifier( 'primary', 'a' );\n\tawait page.type( '#user_pass', password );\n\n\tawait Promise.all( [\n\t\tpage.click( '#wp-submit' ),\n\t\tpage.waitForNavigation( { waitUntil: 'networkidle0' } ),\n\t] );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AACA,IAAAG,qBAAA,GAAAH,OAAA;AANA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACO,eAAeI,SAASA,CAC9BC,QAAQ,GAAGC,mBAAW,EACtBC,QAAQ,GAAGC,mBAAW,EACrB;EACD,IAAK,CAAE,IAAAC,0BAAY,EAAE,cAAe,CAAC,EAAG;IACvC,MAAMC,0BAA0B,GAAGC,IAAI,CAACC,iBAAiB,CAAC,CAAC;IAC3D,MAAMD,IAAI,CAACE,IAAI,CAAE,IAAAC,oBAAS,EAAE,cAAe,CAAE,CAAC;IAC9C,MAAMJ,0BAA0B;EACjC;EAEA,MAAMC,IAAI,CAACI,KAAK,CAAE,aAAc,CAAC;EACjC,MAAM,IAAAC,0CAAoB,EAAE,SAAS,EAAE,GAAI,CAAC;EAC5C,MAAML,IAAI,CAACM,IAAI,CAAE,aAAa,EAAEZ,QAAS,CAAC;EAC1C,MAAMM,IAAI,CAACI,KAAK,CAAE,YAAa,CAAC;EAChC,MAAM,IAAAC,0CAAoB,EAAE,SAAS,EAAE,GAAI,CAAC;EAC5C,MAAML,IAAI,CAACM,IAAI,CAAE,YAAY,EAAEV,QAAS,CAAC;EAEzC,MAAMW,OAAO,CAACC,GAAG,CAAE,CAClBR,IAAI,CAACS,KAAK,CAAE,YAAa,CAAC,EAC1BT,IAAI,CAACC,iBAAiB,CAAE;IAAES,SAAS,EAAE;EAAe,CAAE,CAAC,CACtD,CAAC;AACJ"} +\ No newline at end of file diff --git a/tests/e2e/config/bootstrap.js b/tests/e2e/config/bootstrap.js index fb8c0297b22..54aafedaa0a 100644 --- a/tests/e2e/config/bootstrap.js +++ b/tests/e2e/config/bootstrap.js @@ -296,8 +296,10 @@ beforeAll(async () => { await trashAllPosts(); await createTestData(); await cleanUpSettings(); - await page.setDefaultNavigationTimeout(10000); - await page.setDefaultTimeout(10000); + + // Keep navigation timeout high since CI resources can be slow. + await page.setDefaultNavigationTimeout(20000); + await page.setDefaultTimeout(20000); }); // eslint-disable-next-line jest/require-top-level-describe diff --git a/tests/e2e/specs/admin/anchor-linking.js b/tests/e2e/specs/admin/anchor-linking.js index d324dc24428..e2f3744e010 100644 --- a/tests/e2e/specs/admin/anchor-linking.js +++ b/tests/e2e/specs/admin/anchor-linking.js @@ -16,7 +16,7 @@ import { saveSettings } from '../../utils/amp-settings-utils'; describe('AMP settings page anchor linking', () => { beforeEach(async () => { await loginUser(); - }, 400000); + }); it('jumps to supported templates section', async () => { await visitAdminPageWithHash( @@ -50,7 +50,7 @@ describe('AMP developer tools settings', () => { 'page=amp-options', 'other-settings' ); - }, 400000); + }); afterEach(async () => { await cleanUpSettings();