Is your feature request related to a problem? Please describe.
Add support for https://playwright.dev/docs/api/class-credentials feature.
Describe the solution you'd like
Credentials are tied to the context. I think there should be three keywords.
Create Credential would call https://playwright.dev/docs/api/class-credentials#credentials-create and https://playwright.dev/docs/api/class-credentials#credentials-install To set the credential in the context. Also calling with None values would only call https://playwright.dev/docs/api/class-credentials#credentials-install
Get Credential would be direct wrapper for https://playwright.dev/docs/api/class-credentials#credentials-get
Delete Credential would be direct wrapper for https://playwright.dev/docs/api/class-credentials#credentials-delete
Keyword usage would look like this:
New Context
Create Credential # This calls both create and install credentials automatically
... rpId=example.com
... id=${knownCredentialId} #base64url
... userHandle=${known_user_handle} #Base64url-encoded PKCS#8 (DER) private key.
... publicKey=${public_key} #Base64url-encoded SPKI (DER) public key.
... userHandle=${user_handle} #Base64url-encoded user handle.
New Page https://example.com
New Context
Create Credential # This calls only install credential
New Page https://example.com
# Do something that created a credential
${credential} = Get Credential id=${credential_id}
${credential} = Get Credential rpId=${credential_rpId}
# ${credential} is dictionary (RF dotdict) which has id, rpId, userHandle privateKey and publicKey as keys.
Delete Credential id=${credential_id}
I do not like word id in dictionary or in arguments, because id reserved work in Python. So adding underscore (id_) or calling id credential_id are better options.
Additional context
https://playwright.dev/docs/api/class-credentials
Is your feature request related to a problem? Please describe.
Add support for https://playwright.dev/docs/api/class-credentials feature.
Describe the solution you'd like
Credentials are tied to the context. I think there should be three keywords.
Create Credentialwould call https://playwright.dev/docs/api/class-credentials#credentials-create and https://playwright.dev/docs/api/class-credentials#credentials-install To set the credential in the context. Also calling with None values would only call https://playwright.dev/docs/api/class-credentials#credentials-installGet Credentialwould be direct wrapper for https://playwright.dev/docs/api/class-credentials#credentials-getDelete Credentialwould be direct wrapper for https://playwright.dev/docs/api/class-credentials#credentials-deleteKeyword usage would look like this:
I do not like word
idin dictionary or in arguments, because id reserved work in Python. So adding underscore (id_) or calling idcredential_idare better options.Additional context
https://playwright.dev/docs/api/class-credentials