Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default to being signed in for playwright tests #54609

Open
ojeytonwilliams opened this issue May 2, 2024 · 0 comments · May be fixed by #54633
Open

Default to being signed in for playwright tests #54609

ojeytonwilliams opened this issue May 2, 2024 · 0 comments · May be fixed by #54633
Labels
status: PR in works Work in Progress (WIP) Issues.

Comments

@ojeytonwilliams
Copy link
Contributor

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 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: [] } });.

Original discussion:
#54481 (comment)

@ojeytonwilliams ojeytonwilliams added the help wanted Open for all. You do not need permission to work on these. label May 2, 2024
@huyenltnguyen huyenltnguyen added status: PR in works Work in Progress (WIP) Issues. and removed help wanted Open for all. You do not need permission to work on these. labels May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: PR in works Work in Progress (WIP) Issues.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants