test: unskip touch tests (#10955)

This commit is contained in:
Alex Rudenko 2023-09-20 14:52:43 +02:00 committed by GitHub
parent 3f79beb71a
commit af42663edb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 26 additions and 17 deletions

View File

@ -8,7 +8,7 @@ sidebar_label: Page.setUserAgent
```typescript ```typescript
class Page { class Page {
setUserAgent( abstract setUserAgent(
userAgent: string, userAgent: string,
userAgentMetadata?: Protocol.Emulation.UserAgentMetadata userAgentMetadata?: Protocol.Emulation.UserAgentMetadata
): Promise<void>; ): Promise<void>;

View File

@ -1443,13 +1443,10 @@ export abstract class Page extends EventEmitter<PageEvents> {
* page * page
* @returns Promise which resolves when the user agent is set. * @returns Promise which resolves when the user agent is set.
*/ */
async setUserAgent( abstract setUserAgent(
userAgent: string, userAgent: string,
userAgentMetadata?: Protocol.Emulation.UserAgentMetadata userAgentMetadata?: Protocol.Emulation.UserAgentMetadata
): Promise<void>; ): Promise<void>;
async setUserAgent(): Promise<void> {
throw new Error('Not implemented');
}
/** /**
* Object containing metrics as key/value pairs. * Object containing metrics as key/value pairs.

View File

@ -155,6 +155,17 @@ export class BidiPage extends Page {
return this.mainFrame().context().cdpSession; return this.mainFrame().context().cdpSession;
} }
override async setUserAgent(
userAgent: string,
userAgentMetadata?: Protocol.Emulation.UserAgentMetadata | undefined
): Promise<void> {
// TODO: handle CDP-specific cases such as mprach.
await this._client().send('Network.setUserAgentOverride', {
userAgent: userAgent,
userAgentMetadata: userAgentMetadata,
});
}
constructor( constructor(
browsingContext: BrowsingContext, browsingContext: BrowsingContext,
browserContext: BidiBrowserContext browserContext: BidiBrowserContext

View File

@ -1829,18 +1829,6 @@
"parameters": ["cdp", "firefox"], "parameters": ["cdp", "firefox"],
"expectations": ["SKIP"] "expectations": ["SKIP"]
}, },
{
"testIdPattern": "[emulation.spec] Emulation Page.emulate should support clicking",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["chrome", "webDriverBiDi"],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[emulation.spec] Emulation Page.emulate should work",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["chrome", "webDriverBiDi"],
"expectations": ["FAIL"]
},
{ {
"testIdPattern": "[emulation.spec] Emulation Page.emulateCPUThrottling should change the CPU throttling rate successfully", "testIdPattern": "[emulation.spec] Emulation Page.emulateCPUThrottling should change the CPU throttling rate successfully",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
@ -3881,12 +3869,24 @@
"parameters": ["cdp", "firefox"], "parameters": ["cdp", "firefox"],
"expectations": ["SKIP"] "expectations": ["SKIP"]
}, },
{
"testIdPattern": "[touchscreen.spec] Touchscreen should report touchMove",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["chrome", "webDriverBiDi"],
"expectations": ["PASS"]
},
{ {
"testIdPattern": "[touchscreen.spec] Touchscreen should tap the button", "testIdPattern": "[touchscreen.spec] Touchscreen should tap the button",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
"parameters": ["cdp", "firefox"], "parameters": ["cdp", "firefox"],
"expectations": ["FAIL"] "expectations": ["FAIL"]
}, },
{
"testIdPattern": "[touchscreen.spec] Touchscreen should tap the button",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["chrome", "webDriverBiDi"],
"expectations": ["PASS"]
},
{ {
"testIdPattern": "[tracing.spec] Tracing should throw if tracing on two pages", "testIdPattern": "[tracing.spec] Tracing should throw if tracing on two pages",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],

View File

@ -48,6 +48,7 @@ describe('TargetManager', () => {
await state.close(); await state.close();
}); });
// CDP-specific test.
it('should handle targets', async () => { it('should handle targets', async () => {
const {server, context, browser} = state; const {server, context, browser} = state;