two-factor icon indicating copy to clipboard operation
two-factor copied to clipboard

Add e2e tests for critical paths

Open iandunn opened this issue 3 years ago • 4 comments

Some things can't be tested well with PHPUnit (like #490), so it could be helpful to have some e2e tests. I don't think they need to be comprehensive, but it'd be nice to cover the critical paths from user and security perspectives.

We might get a head start by looking at what @sjinks did ƒor https://github.com/sjinks/wp-two-factor-provider-webauthn

iandunn avatar Nov 18 '22 21:11 iandunn

@iandunn would it make sense to leverage Playwright like Gutenberg and Core have evolved to do for e2e tests?

jeffpaul avatar Mar 02 '23 15:03 jeffpaul

I haven't used it yet, so I'm open to someone more knowledgeable having a different opinion, but that sounds like a logical approach 👍🏻

It looks like that's also what was done in https://github.com/sjinks/wp-two-factor-provider-webauthn, so we might be able to copy a lot of that.

iandunn avatar Mar 02 '23 18:03 iandunn

If you need some help, please feel free to ping me :-)

sjinks avatar Mar 03 '23 23:03 sjinks

@sjinks if you're familiar with Playwright tests, then you can take a look at how WordPress core and Gutenberg both utilize that for their e2e tests and work on an initial PR to add those tests & GitHub Action for the Two-Factor plugin:

Thanks! Jeff.

jeffpaul avatar Mar 16 '23 15:03 jeffpaul