r/Playwright • • 25m ago

Help needed beginners question

1 Upvotes

Hey everyone,

I started learning Playwright a few days ago, mostly for fun. I ran some tests at work in our TEST environment and everything worked great, and I got to try out a lot of the cool stuff I'd learned.

Today I tried to replicate the same thing in PROD. The login went smoothly, but right after signing in a blank page appears saying "Working", and then the Playwright session just closes.

Any idea why this is happening? Or a way to fix it?

I'm not a tech guy, just someone wanting to learn a little bit.


r/Playwright • • 4h ago

I built mustfail, an open-source CLI that finds Playwright tests that stay green when the app is broken

0 Upvotes

mustfail, a free, open-source CLI that finds Playwright tests that pass when the app is broken.

You run `npx mustfail run` in your project. It reruns your suite several times: once with every API call failing, then with the values your assertions read changed, lists emptied, and the test's own saves failed. It grades each test by what it noticed. A test that stays green with the whole API down is decorative. A test that stays green when its own data is wrong is weak. You don't change your tests or your config, and it writes an HTML report. It needs Node 20+ and Playwright 1.50+.

I ran it on Strapi's open-source e2e suite. The test that deletes the Author role checks:

await expect(page.getByRole('row', { name: 'Author', exact: true })).not.toBeVisible();

I made `POST /admin/roles/batch-delete` return 500 with `page.route`. The role stayed in the table and the test stayed green. Playwright names a row after the text of all its cells, so no row is named exactly "Author", and `not.toBeVisible()` on a locator that matches nothing passes every time. Checking `getByRole('gridcell', ...)` instead fixes it. I filed it with a second test it found, a homepage widget test that never reloads to check the save: https://github.com/strapi/strapi/issues/28805

Across the 189 admin and content-manager tests I ran, 86 failed an assertion when their data was wrong.

It's an alpha. It reruns your tests several times (a full run takes 3 to 4 times your suite's runtime), so point it at a local or disposable environment, since it repeats your tests' writes.

I'd like to hear where a grade is wrong on your suite. Reply here, or open an issue with the test and the reason mustfail gave.

https://github.com/ashwink-tech/mustfail