Skip to content

Commit

Permalink
run against vanilla WP when PR_NUMBER is undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
WunderBart committed Jul 8, 2024
1 parent 6fd5216 commit d8bf681
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions test/visreg/example.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
*/
import { test, expect } from '@playwright/test';

test( 'WP Editor default view', async ( { context, page } ) => {
// 1. Go to the Gutenberg PR Preview page and submit the PR number.
await page.goto( 'https://playground.wordpress.net/gutenberg.html' );

const prInput = page.getByLabel( 'Pull request number or URL:' );
test.use( { baseURL: 'https://playground.wordpress.net' } );

await prInput.fill( process.env.PR_NUMBER );
await prInput.press( 'Enter' );
test( 'WP Editor default view', async ( { context, page } ) => {
if ( process.env.PR_NUMBER ) {
// 1. Go to the Gutenberg PR Preview page and submit the PR number.
await page.goto( `/gutenberg.html?pr=${ process.env.PR_NUMBER }` );
} else {
// 1. Go to the WordPress Playground (Gutenberg plugin disabled).
await page.goto( '/' );
}

// 2. Get the URL of the iframed WordPress instance so we can strip the
// Playground UI off.
Expand Down

0 comments on commit d8bf681

Please sign in to comment.