You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To fix this, we should change the https://github.com/freeCodeCamp/freeCodeCamp/blob/main/playwright.config.ts so that the projects use the generated storageState. Then it should be possible to remove all the test.use({ storageState: 'playwright/.auth/certified-user.json' });, but it will be necessary to manually sign out whenever the tests need the browser to be signed out. This can be achieved with test.use({ storageState: { cookies: [], origins: [] } });.
Our Playwright tests sign in before every test, via the https://github.com/freeCodeCamp/freeCodeCamp/blob/main/e2e/global-setup.ts, but they don't use the authentication cookies by default. This is counterintuitive, since it's natural to assume that this means the test runner will be signed in.
To fix this, we should change the https://github.com/freeCodeCamp/freeCodeCamp/blob/main/playwright.config.ts so that the projects use the generated
storageState
. Then it should be possible to remove all thetest.use({ storageState: 'playwright/.auth/certified-user.json' });
, but it will be necessary to manually sign out whenever the tests need the browser to be signed out. This can be achieved withtest.use({ storageState: { cookies: [], origins: [] } });
.Original discussion:
#54481 (comment)
The text was updated successfully, but these errors were encountered: