mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-14 13:45:36 +03:00
feat(webkit): reload page after updating user agent (#268)
This commit is contained in:
parent
68a03c2e84
commit
bfb8df29bb
@ -329,6 +329,7 @@ export class FrameManager implements PageDelegate {
|
||||
|
||||
async setUserAgent(userAgent: string): Promise<void> {
|
||||
await this._setUserAgent(this._session, userAgent);
|
||||
await this.reload();
|
||||
}
|
||||
|
||||
async setJavaScriptEnabled(enabled: boolean): Promise<void> {
|
||||
|
@ -513,7 +513,7 @@ module.exports.addTests = function({testRunner, expect, headless, playwright, FF
|
||||
]);
|
||||
expect(request.headers['user-agent']).toBe('foobar');
|
||||
});
|
||||
it.skip(WEBKIT)('should emulate device user-agent', async({page, server}) => {
|
||||
it('should emulate device user-agent', async({page, server}) => {
|
||||
await page.goto(server.PREFIX + '/mobile.html');
|
||||
expect(await page.evaluate(() => navigator.userAgent)).not.toContain('iPhone');
|
||||
await page.setUserAgent(playwright.devices['iPhone 6'].userAgent);
|
||||
|
Loading…
Reference in New Issue
Block a user