-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
80678f9
commit 26a07c9
Showing
8 changed files
with
53 additions
and
2 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+42.3 KB
test/e2e/specs/visual/__snapshots__/Home-page-logged-out-1-chromium.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+51 KB
test/e2e/specs/visual/__snapshots__/Home-page-whole-page-1-chromium.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,48 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
const { test, expect } = require( '@wordpress/e2e-test-utils-playwright' ); | ||
|
||
test.describe.only( 'Home page', () => { | ||
test.beforeAll( async ( { requestUtils } ) => { | ||
await requestUtils.activateTheme( 'twentytwentythree' ); | ||
} ); | ||
|
||
test.beforeEach( async ( { page } ) => { | ||
await page.goto( '/' ); | ||
} ); | ||
|
||
test.afterAll( async ( { requestUtils } ) => { | ||
await requestUtils.activateTheme( 'twentytwentyone' ); | ||
} ); | ||
|
||
test( 'whole page', async ( { page } ) => { | ||
await expect( page ).toHaveScreenshot( { fullPage: true } ); | ||
} ); | ||
|
||
test( 'header', async ( { page } ) => { | ||
await expect( page.getByRole( 'banner' ) ).toHaveScreenshot(); | ||
} ); | ||
|
||
test( 'main', async ( { page } ) => { | ||
await expect( page.getByRole( 'main' ) ).toHaveScreenshot(); | ||
} ); | ||
|
||
test( 'footer', async ( { page } ) => { | ||
await expect( page.getByRole( 'contentinfo' ) ).toHaveScreenshot(); | ||
} ); | ||
|
||
test( 'logged out', async ( { browser } ) => { | ||
const incognitoContext = await browser.newContext( { | ||
storageState: undefined, | ||
} ); | ||
const incognitoPage = await incognitoContext.newPage(); | ||
await incognitoPage.goto( '/' ); | ||
|
||
await expect | ||
.soft( incognitoPage ) | ||
.toHaveScreenshot( { fullPage: true } ); | ||
|
||
await incognitoContext.close(); | ||
} ); | ||
} ); |