-
Notifications
You must be signed in to change notification settings - Fork 798
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Boost: Refactor and add new e2e tests (#21819)
* WIP: Refactor and create new e2e tests * WIP: Refactor and create new e2e tests * Fix tests following recent refactoring migrating Jest to Playwright * WIP: Refactor tests * Fix coding standards for consistency * WIP: Refactor and extend E2E tests * Fix tests name * Fix test name * Reduce timeout * Improve test assertion * Add a E2E test for the render blocking js module * Refactor the test for the Lazy images module * Add a new prerequisite to install the jitm package before tests * Change connection tests order * Remove useless prerequisite for connection test * Fix line break * Improve build package command * Fix test content * Improve the modules common tests * WIP: Add Critical CSS module related E2E tests * Install required packages for testing inside the worfklow rather than as prerequisites. * [not verified] Revert "Install required packages for testing inside the worfklow rather than as prerequisites." This reverts commit fee8d30. * Remove not needed prerequesite * Refactor the specs directory structure and remove useless test * Implement some common/general E2E tests * Rename test description * Remove useless export statements * Fix logging message * Make sure that the ensurePluginsState prerequisite is run only on a local site * Remove the describe tests grouping as not required in the context of common tests * Add missing page.close statements * Removing the use of the TestContentPage in favor to the PostFrontEnd page * Refactor to remove locator statements from the tests * Remove a page close statement which may break tests * Remove helper file not needed anymore * Refactor the way to check if the site score is loading to make it more robust * Refactor tests check * Add back the page close statement * Create a new common Themes page * Create a new sidebar page method to navigate to the themes page * Fix test description * Fix test comment * Implement a new Critical CSS related test * Fix test description * Relocate tests conment * Add new Critical CSS related tests * Update the README file * Ensure a clean env pre-requisite before running test * Increase timeout * Fix typo * Standardize the way new pages are created * Fix typo * Improve methods naming * Don't setup load promises before navigation; Playwright doesn't work that way * Ensure jetpack is active before ensuring it's connected * Don't use .serial; tests don't rely on previous tests, so can continue after failure * Use `test.describe.serial` for `Modules` test suit * Add more apiEndpointsRegex New endpoints to make waitForApiResponse to be effective for lazy-images and render-blocking-js status Co-authored-by: Mark George <[email protected]> Co-authored-by: Adnan Haque <[email protected]>
- Loading branch information
1 parent
c18c518
commit 0571017
Showing
23 changed files
with
675 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: minor | ||
Type: added | ||
|
||
Refactor and add new core E2E tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default as JetpackBoostPage } from './wp-admin/JetpackBoostPage.js'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
import { chromium } from '@playwright/test'; | ||
import { prerequisitesBuilder } from 'jetpack-e2e-commons/env/prerequisites.js'; | ||
import { boostPrerequisitesBuilder } from './env/prerequisites.js'; | ||
|
||
export default async function () { | ||
const browser = await chromium.launch(); | ||
const page = await browser.newPage(); | ||
await prerequisitesBuilder( page ).withLoggedIn( true ).withConnection( true ).build(); | ||
await prerequisitesBuilder( page ).withLoggedIn( true ).withActivePlugins( [ 'boost' ] ).build(); | ||
await boostPrerequisitesBuilder( page ).withCleanEnv( true ).withConnection( true ).build(); | ||
await page.close(); | ||
} |
Oops, something went wrong.