diff --git a/packages/e2e-test-utils/README.md b/packages/e2e-test-utils/README.md index 3f08ca78766cf..16a257cec518b 100644 --- a/packages/e2e-test-utils/README.md +++ b/packages/e2e-test-utils/README.md @@ -88,7 +88,7 @@ Clicks on More Menu item, searches for the button with the text provided and cli ### createEmbeddingMatcher -[src/index.js#L52-L52](src/index.js#L52-L52) +[src/index.js#L53-L53](src/index.js#L53-L53) Creates a function to determine if a request is embedding a certain URL. @@ -102,7 +102,7 @@ Creates a function to determine if a request is embedding a certain URL. ### createJSONResponse -[src/index.js#L52-L52](src/index.js#L52-L52) +[src/index.js#L53-L53](src/index.js#L53-L53) Respond to a request with a JSON response. @@ -141,7 +141,7 @@ Creates new URL by parsing base URL, WPPath and query string. ### createURLMatcher -[src/index.js#L52-L52](src/index.js#L52-L52) +[src/index.js#L53-L53](src/index.js#L53-L53) Creates a function to determine if a request is calling a URL with the substring present. @@ -286,10 +286,26 @@ Returns a boolean indicating if the current selected block has a block switcher `Promise`: Promise resolving with a boolean. -### insertBlock +### hasPHPError [src/index.js#L24-L24](src/index.js#L24-L24) +Returns a promise resolving to a boolean reflecting whether a PHP notice is +present anywhere within the document's markup. This requires the environment +be configured to display errors. + +**Related** + +- + +**Returns** + +`Promise`: Promise resolving to a boolean reflecting whether a PHP notice is present. + +### insertBlock + +[src/index.js#L25-L25](src/index.js#L25-L25) + Opens the inserter, searches for the given term, then selects the first result that appears. @@ -300,7 +316,7 @@ result that appears. ### installPlugin -[src/index.js#L25-L25](src/index.js#L25-L25) +[src/index.js#L26-L26](src/index.js#L26-L26) Installs a plugin from the WP.org repository. @@ -311,7 +327,7 @@ Installs a plugin from the WP.org repository. ### isCurrentURL -[src/index.js#L26-L26](src/index.js#L26-L26) +[src/index.js#L27-L27](src/index.js#L27-L27) Checks if current URL is a WordPress path. @@ -326,7 +342,7 @@ Checks if current URL is a WordPress path. ### isInDefaultBlock -[src/index.js#L27-L27](src/index.js#L27-L27) +[src/index.js#L28-L28](src/index.js#L28-L28) Checks if the block that is focused is the default block. @@ -336,7 +352,7 @@ Checks if the block that is focused is the default block. ### loginUser -[src/index.js#L28-L28](src/index.js#L28-L28) +[src/index.js#L29-L29](src/index.js#L29-L29) Performs log in with specified username and password. @@ -347,7 +363,7 @@ Performs log in with specified username and password. ### mockOrTransform -[src/index.js#L52-L52](src/index.js#L52-L52) +[src/index.js#L53-L53](src/index.js#L53-L53) Mocks a request with the supplied mock object, or allows it to run with an optional transform, based on the deserialised JSON response for the request. @@ -364,38 +380,38 @@ deserialised JSON response for the request. ### observeFocusLoss -[src/index.js#L29-L29](src/index.js#L29-L29) +[src/index.js#L30-L30](src/index.js#L30-L30) Binds to the document on page load which throws an error if a `focusout` event occurs without a related target (i.e. focus loss). ### openAllBlockInserterCategories -[src/index.js#L30-L30](src/index.js#L30-L30) +[src/index.js#L31-L31](src/index.js#L31-L31) Opens all block inserter categories. ### openDocumentSettingsSidebar -[src/index.js#L31-L31](src/index.js#L31-L31) +[src/index.js#L32-L32](src/index.js#L32-L32) Clicks on the button in the header which opens Document Settings sidebar when it is closed. ### openGlobalBlockInserter -[src/index.js#L32-L32](src/index.js#L32-L32) +[src/index.js#L33-L33](src/index.js#L33-L33) Opens the global block inserter. ### openPublishPanel -[src/index.js#L33-L33](src/index.js#L33-L33) +[src/index.js#L34-L34](src/index.js#L34-L34) Opens the publish panel. ### pressKeyTimes -[src/index.js#L34-L34](src/index.js#L34-L34) +[src/index.js#L35-L35](src/index.js#L35-L35) Presses the given keyboard key a number of times in sequence. @@ -410,7 +426,7 @@ Presses the given keyboard key a number of times in sequence. ### pressKeyWithModifier -[src/index.js#L35-L35](src/index.js#L35-L35) +[src/index.js#L36-L36](src/index.js#L36-L36) Performs a key press with modifier (Shift, Control, Meta, Alt), where each modifier is normalized to platform-specific modifier. @@ -422,7 +438,7 @@ is normalized to platform-specific modifier. ### publishPost -[src/index.js#L36-L36](src/index.js#L36-L36) +[src/index.js#L37-L37](src/index.js#L37-L37) Publishes the post, resolving once the request is complete (once a notice is displayed). @@ -433,7 +449,7 @@ is displayed). ### publishPostWithPrePublishChecksDisabled -[src/index.js#L37-L37](src/index.js#L37-L37) +[src/index.js#L38-L38](src/index.js#L38-L38) Publishes the post without the pre-publish checks, resolving once the request is complete (once a notice is displayed). @@ -444,7 +460,7 @@ resolving once the request is complete (once a notice is displayed). ### saveDraft -[src/index.js#L38-L38](src/index.js#L38-L38) +[src/index.js#L39-L39](src/index.js#L39-L39) Saves the post as a draft, resolving once the request is complete (once the "Saved" indicator is displayed). @@ -455,7 +471,7 @@ Saves the post as a draft, resolving once the request is complete (once the ### searchForBlock -[src/index.js#L39-L39](src/index.js#L39-L39) +[src/index.js#L40-L40](src/index.js#L40-L40) Search for block in the global inserter @@ -465,7 +481,7 @@ Search for block in the global inserter ### selectBlockByClientId -[src/index.js#L40-L40](src/index.js#L40-L40) +[src/index.js#L41-L41](src/index.js#L41-L41) Given the clientId of a block, selects the block on the editor. @@ -475,7 +491,7 @@ Given the clientId of a block, selects the block on the editor. ### setBrowserViewport -[src/index.js#L41-L41](src/index.js#L41-L41) +[src/index.js#L42-L42](src/index.js#L42-L42) Sets browser viewport to specified type. @@ -485,7 +501,7 @@ Sets browser viewport to specified type. ### setPostContent -[src/index.js#L42-L42](src/index.js#L42-L42) +[src/index.js#L43-L43](src/index.js#L43-L43) Sets code editor content @@ -499,7 +515,7 @@ Sets code editor content ### setUpResponseMocking -[src/index.js#L52-L52](src/index.js#L52-L52) +[src/index.js#L53-L53](src/index.js#L53-L53) Sets up mock checks and responses. Accepts a list of mock settings with the following properties: @@ -530,7 +546,7 @@ If none of the mock settings match the request, the request is allowed to contin ### switchEditorModeTo -[src/index.js#L43-L43](src/index.js#L43-L43) +[src/index.js#L44-L44](src/index.js#L44-L44) Switches editor mode. @@ -540,21 +556,21 @@ Switches editor mode. ### switchUserToAdmin -[src/index.js#L44-L44](src/index.js#L44-L44) +[src/index.js#L45-L45](src/index.js#L45-L45) Switches the current user to the admin user (if the user running the test is not already the admin user). ### switchUserToTest -[src/index.js#L45-L45](src/index.js#L45-L45) +[src/index.js#L46-L46](src/index.js#L46-L46) Switches the current user to whichever user we should be running the tests as (if we're not already that user). ### toggleScreenOption -[src/index.js#L46-L46](src/index.js#L46-L46) +[src/index.js#L47-L47](src/index.js#L47-L47) Toggles the screen option with the given label. @@ -565,7 +581,7 @@ Toggles the screen option with the given label. ### transformBlockTo -[src/index.js#L47-L47](src/index.js#L47-L47) +[src/index.js#L48-L48](src/index.js#L48-L48) Converts editor's block type. @@ -575,7 +591,7 @@ Converts editor's block type. ### uninstallPlugin -[src/index.js#L48-L48](src/index.js#L48-L48) +[src/index.js#L49-L49](src/index.js#L49-L49) Uninstalls a plugin. @@ -585,7 +601,7 @@ Uninstalls a plugin. ### visitAdminPage -[src/index.js#L49-L49](src/index.js#L49-L49) +[src/index.js#L50-L50](src/index.js#L50-L50) Visits admin page; if user is not logged in then it logging in it first, then visits admin page. @@ -596,7 +612,7 @@ Visits admin page; if user is not logged in then it logging in it first, then vi ### waitForWindowDimensions -[src/index.js#L50-L50](src/index.js#L50-L50) +[src/index.js#L51-L51](src/index.js#L51-L51) Function that waits until the page viewport has the required dimensions. It is being used to address a problem where after using setViewport the execution may continue,