Testing WebAuthn with Playwright. #678
Replies: 2 comments 11 replies
-
Hello @kentcdodds, thanks for reaching out. I read through your issue and watched the video you linked; thanks for sending over the playwright test code too. Nothing immediately jumps out to me so I'll take a look in the next day or two and see if I can't propose a solution. One thing I can recommend trying off-hand is, can you try adding a hard page refresh to your failing test after logging out? If your site is a SPA then in the past there's been some issues with certain browsers that didn't let you call WebAuthn twice without a hard page refresh after each call, which really dampened enthusiasm for SPA developers. That time should be long behind us, though, so I offer this only as something to try until I get back home to play around with your tests myself. Can you confirm that your testing is running against macOS Chromium? And also what's that test runner you're using? I'm familiar with playwright but usually run them in the command line. I like the idea of a GUI-based test setup... |
Beta Was this translation helpful? Give feedback.
-
@kentcdodds I figured it out! It's this step in which you parse the registration options: It's stripping out the Update The only other thing I had to do to get that test to full pass is update the final Give it a shot and let me know if it works! |
Beta Was this translation helpful? Give feedback.
-
Hi there @MasterKale! Thank you so much for all of the awesome things that you're doing for the web authentication spec and libraries surrounding it. I really totally love this stuff. I'm just having a problem with automated testing. To make this report as useful as possible, I have recorded the problem in a live stream to demonstrate exactly the issue! It's at the start of this live stream here: https://www.youtube.com/watch?v=TV-HM4xVEdc
What I am demoing is just in the first 6 minutes.
The code for the passing test is here:
The code for the failing test is here:
The code for the app we're running can be found here: https://github.com/epicweb-dev/epic-stack/tree/dev
The relevant bits can be found here: epicweb-dev/epic-stack@main...dev
I'm in the process of adding webauthn support to that repo, so this is a diff between what's currently running and what I added to support webauthn.
Thank you so much for your help! I'm very stuck!
Beta Was this translation helpful? Give feedback.
All reactions