mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-15 06:02:57 +03:00
test: improve autowaiting tests (#3168)
This commit is contained in:
parent
98cc9db8e8
commit
d0b758a8d2
@ -107,12 +107,11 @@ describe('Auto waiting', () => {
|
||||
const messages = [];
|
||||
server.setRoute('/empty.html?cancel', async (req, res) => { res.end('done'); });
|
||||
server.setRoute('/empty.html?override', async (req, res) => { messages.push('routeoverride'); res.end('done'); });
|
||||
await Promise.all([
|
||||
page.evaluate(`
|
||||
await page.evaluate(`
|
||||
window.location.href = "${server.EMPTY_PAGE}?cancel";
|
||||
window.location.href = "${server.EMPTY_PAGE}?override";
|
||||
`).then(() => messages.push('evaluate')),
|
||||
]);
|
||||
`);
|
||||
messages.push('evaluate');
|
||||
expect(messages.join('|')).toBe('routeoverride|evaluate');
|
||||
});
|
||||
it('should await navigation when evaluating reload', async({page, server}) => {
|
||||
@ -172,7 +171,6 @@ describe('Auto waiting', () => {
|
||||
});
|
||||
it('should work with goto following click', async({page, server}) => {
|
||||
server.setRoute('/login.html', async (req, res) => {
|
||||
messages.push('route');
|
||||
res.setHeader('Content-Type', 'text/html');
|
||||
res.end(`You are logged in`);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user