-
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.
Create example visreg test using Playground
- Loading branch information
1 parent
bb73da7
commit 449a2d5
Showing
3 changed files
with
28 additions
and
0 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,27 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import { test, expect } from '@playwright/test'; | ||
|
||
test( 'test', async ( { context, page } ) => { | ||
await page.goto( 'https://playground.wordpress.net/gutenberg.html' ); | ||
|
||
const prInput = page.getByLabel( 'Pull request number or URL:' ); | ||
|
||
await prInput.fill( process.env.PR_NUMBER ); | ||
await prInput.press( 'Enter' ); | ||
|
||
await page.waitForFunction( 'window?.playground?.absoluteUrl' ); | ||
|
||
const wpIframeURL = await page.evaluate( | ||
async () => await window.playground.absoluteUrl | ||
); | ||
|
||
const wpPage = await context.newPage(); | ||
|
||
await wpPage.goto( wpIframeURL + '/wp-admin/post-new.php' ); | ||
await wpPage.getByLabel( 'Close', { exact: true } ).click(); | ||
|
||
await wpPage.waitForTimeout( 5_000 ); | ||
await expect( wpPage ).toHaveScreenshot( { fullPage: true } ); | ||
} ); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.