Emdash source with visual editor image upload fix
Fixes: 1. media.ts: wrap placeholder generation in try-catch 2. toolbar.ts: check r.ok, display error message in popover
This commit is contained in:
33
e2e/fixtures/virtual-authenticator.ts
Normal file
33
e2e/fixtures/virtual-authenticator.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* Chrome DevTools virtual WebAuthn authenticator for passkey e2e.
|
||||
* Chromium-only (CDP). See https://developer.chrome.com/docs/devtools/webauthn/
|
||||
*/
|
||||
import type { Page } from "@playwright/test";
|
||||
|
||||
export async function addVirtualWebAuthnAuthenticator(page: Page): Promise<() => Promise<void>> {
|
||||
const session = await page.context().newCDPSession(page);
|
||||
await session.send("WebAuthn.enable");
|
||||
const { authenticatorId } = await session.send("WebAuthn.addVirtualAuthenticator", {
|
||||
options: {
|
||||
protocol: "ctap2",
|
||||
transport: "internal",
|
||||
hasResidentKey: true,
|
||||
hasUserVerification: true,
|
||||
isUserVerified: true,
|
||||
automaticPresenceSimulation: true,
|
||||
},
|
||||
});
|
||||
|
||||
return async () => {
|
||||
try {
|
||||
await session.send("WebAuthn.removeVirtualAuthenticator", { authenticatorId });
|
||||
} catch {
|
||||
// session may already be closed
|
||||
}
|
||||
try {
|
||||
await session.detach();
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user