-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5811 from Automattic/develop
Staging release: v20240820.1
- Loading branch information
Showing
18 changed files
with
6,758 additions
and
3,264 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
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
Large diffs are not rendered by default.
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
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,40 @@ | ||
import { type Response, expect, test } from '@playwright/test'; | ||
|
||
test.describe( 'Generic Checks', () => { | ||
test( 'Page contains closing html tag and no wp_die() message', async ( { page, baseURL } ) => { | ||
expect( baseURL ).toBeDefined(); | ||
const response = await page.goto( baseURL! ) as Response; | ||
expect.soft( response.status() ).toBeLessThan( 500 ); | ||
await expect( page.locator( '.wp-die-message' ) ).toHaveCount( 0 ); | ||
const html = await page.content(); | ||
expect( html ).toContain( '</html>' ); | ||
} ); | ||
|
||
test( 'REST API smoke test', async ( { request } ) => { | ||
const response = await request.get( './wp-json/' ); | ||
expect( response.status() ).toBe( 200 ); | ||
const data: unknown = await response.json(); | ||
expect( typeof data ).toBe( 'object' ); | ||
expect.soft( data ).toHaveProperty( 'name' ); | ||
expect.soft( data ).toHaveProperty( 'description' ); | ||
expect.soft( data ).toHaveProperty( 'url' ); | ||
expect.soft( data ).toHaveProperty( 'routes' ); | ||
} ); | ||
|
||
test( 'XML RPC smoke test', async ( { request } ) => { | ||
const xmlPayload = '<?xml version="1.0"?><methodCall><methodName>demo.sayHello</methodName><params/></methodCall>'; | ||
|
||
const response = await request.post( './xmlrpc.php', { | ||
headers: { | ||
'Content-Type': 'text/xml', | ||
}, | ||
data: xmlPayload, | ||
} ); | ||
|
||
expect( response.status() ).toBe( 200 ); | ||
const responseText = await response.text(); | ||
expect( responseText ).toContain( '<methodResponse>' ); | ||
expect( responseText ).not.toContain( '<fault>' ); | ||
expect( responseText ).toContain( '<string>Hello!</string>' ); | ||
} ); | ||
} ); |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Oops, something went wrong.