Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

test: add goto after click test (#1999)

Pavel Feldmand8cccbdb673e
diff --git a/test/autowaiting.spec.js b/test/autowaiting.spec.js
index 5978a998ed..6bc0ba6182 100644
--- a/test/autowaiting.spec.js
+++ b/test/autowaiting.spec.js
@@ -199,6 +199,23 @@ describe('Auto waiting', () => {
]);
expect(messages.join('|')).toBe('route|domcontentloaded|clickload');
});
+ 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`);
+ });
+
+ await page.setContent(`
+ <form action="${server.PREFIX}/login.html" method="get">
+ <input type="text">
+ <input type="submit" value="Submit">
+ </form>`);
+
+ await page.fill('input[type=text]', 'admin');
+ await page.click('input[type=submit]');
+ await page.goto(server.EMPTY_PAGE);
+ });
});
describe('Auto waiting should not hang when', () => {