@@ -18820,8 +18820,7 @@ export interface Coverage {
1882018820 * const context = await browser.newContext();
1882118821 *
1882218822 * // A passkey your backend already provisioned for a test user.
18823- * await context.credentials.create({
18824- * rpId: 'example.com',
18823+ * await context.credentials.create('example.com', {
1882518824 * id: knownCredentialId, // base64url
1882618825 * userHandle: knownUserHandle, // base64url
1882718826 * privateKey: knownPrivateKey, // base64url PKCS#8 (DER)
@@ -18854,7 +18853,7 @@ export interface Coverage {
1885418853 * // later test: seed the captured passkey so the app starts already enrolled.
1885518854 * const credential = JSON.parse(fs.readFileSync('playwright/.auth/passkey.json', 'utf8'));
1885618855 * const context = await browser.newContext();
18857- * await context.credentials.create(credential);
18856+ * await context.credentials.create(credential.rpId, credential );
1885818857 * await context.credentials.install();
1885918858 *
1886018859 * const page = await context.newPage();
@@ -18877,9 +18876,10 @@ export interface Credentials {
1887718876 *
1887818877 * Call [credentials.install()](https://playwright.dev/docs/api/class-credentials#credentials-install) before
1887918878 * navigating to a page that uses WebAuthn.
18879+ * @param rpId Relying party id (typically the site's effective domain).
1888018880 * @param options
1888118881 */
18882- create(options: {
18882+ create(rpId: string, options? : {
1888318883 /**
1888418884 * Base64url-encoded credential id. Auto-generated if omitted.
1888518885 */
@@ -18895,11 +18895,6 @@ export interface Credentials {
1889518895 */
1889618896 publicKey?: string;
1889718897
18898- /**
18899- * Relying party id (typically the site's effective domain).
18900- */
18901- rpId: string;
18902-
1890318898 /**
1890418899 * Base64url-encoded user handle. Auto-generated if omitted.
1890518900 */
@@ -18933,22 +18928,22 @@ export interface Credentials {
1893318928
1893418929 /**
1893518930 * Removes a credential from the authenticator by its id. Works for any credential currently held — both those seeded
18936- * with [credentials.create(options)](https://playwright.dev/docs/api/class-credentials#credentials-create) and those
18937- * the page registered itself by calling `navigator.credentials.create()`.
18931+ * with [credentials.create(rpId[, options] )](https://playwright.dev/docs/api/class-credentials#credentials-create)
18932+ * and those the page registered itself by calling `navigator.credentials.create()`.
1893818933 * @param id Base64url-encoded credential id.
1893918934 */
1894018935 delete(id: string): Promise<void>;
1894118936
1894218937 /**
1894318938 * Returns every credential currently held by the authenticator, optionally filtered by `rpId` or `id`. This includes
1894418939 * both credentials seeded with
18945- * [credentials.create(options)](https://playwright.dev/docs/api/class-credentials#credentials-create) and credentials
18946- * the page registered itself by calling `navigator.credentials.create()`.
18940+ * [credentials.create(rpId[, options] )](https://playwright.dev/docs/api/class-credentials#credentials-create) and
18941+ * credentials the page registered itself by calling `navigator.credentials.create()`.
1894718942 *
1894818943 * Each returned credential includes its `privateKey` and `publicKey`, so a passkey the app just registered can be
1894918944 * saved and re-seeded into a later test with
18950- * [credentials.create(options)](https://playwright.dev/docs/api/class-credentials#credentials-create) — see the
18951- * second example in the class overview.
18945+ * [credentials.create(rpId[, options] )](https://playwright.dev/docs/api/class-credentials#credentials-create) — see
18946+ * the second example in the class overview.
1895218947 * @param options
1895318948 */
1895418949 get(options?: {
@@ -18980,7 +18975,7 @@ export interface Credentials {
1898018975 *
1898118976 * Required: until `install()` is called, no interception is in place and the page sees the platform's native (or
1898218977 * absent) WebAuthn behaviour. Seeding credentials with
18983- * [credentials.create(options)](https://playwright.dev/docs/api/class-credentials#credentials-create) without
18978+ * [credentials.create(rpId[, options] )](https://playwright.dev/docs/api/class-credentials#credentials-create) without
1898418979 * `install()` populates the authenticator, but the page will never see those credentials.
1898518980 */
1898618981 install(): Promise<void>;
0 commit comments