Add Playwright authentication capture + authenticated tests for GitHub API integration page
Update Oct 22: As we are approaching the end of October, I'll accept the first PR that is ready to be merged. No need for an exclusive issue assignment. Note that AI generated content including code, PR description, or issue reply text may be marked as SPAM.
Prerequisite:
- Have Hackathon Starter up and running with a local account.
- Have set valid GitHub API keys and have linked their local account to their GitHub account in Hackathon Starter's account page.
Scope:
- Create
test/helpers/playwright-auth-setup.jsthat can capture a session for a Hackathon Starter user who already has GitHub linked, and output the session state so it can be set as an environment variable. The output ofnode test/helpers/playwright-auth-setup.jsshould include instructions on how to set the environment variable. - Create
test/e2e/github-authenticated.e2e.test.jsfor GitHub example page that use the session (via the environment variable) and Playwright to verify the portion of the page that require authentication. Note that these tests can't use mongo mongodb-memory-server and needs to use a persistence Mongo DB instance. ~~- The test should be able to run both for a local account that has GitHub linked, and an account that was created using GitHub without a local account. Please verify this manually. You would need to delete your Hackathon Starter accounts thru the accounts page.~~ -
npx playwright test --config=test/playwright.config.js test/e2e/github-authenticated.e2e.test.jsshould run the new tests with all passing. - Update the readme
Blocked on https://github.com/sahat/hackathon-starter/pull/1414
@YasharF Does GitHub API keys mean GitHub Tokens? Where do I get the API keys from?
Also, is there any other platform like discord where I can discuss queries?
Look for the GitHub section under https://github.com/sahat/hackathon-starter?tab=readme-ov-file#obtaining-api-keys
Any updates? Let me know if you have any questions or stuck on something.
Any updates? Let me know if you have any questions or stuck on something.
I'm working on it. Got stuck with a bit of work, will finish it soon.
I'm getting this error now, after I pulled the recent changes from the repo master branch. I tried changing the port to 587 from 465, but doesn't seem to work. Any idea on how do I resolve this? Here, I'm trying to create a new account by registering, shows this error.
ERROR: Could not send login by email link. Error: connect ETIMEDOUT 142.250.4.108:587 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1637:16) { errno: -4039, code: 'ESOCKET', syscall: 'connect', address: '142.250.4.108', port: 587, command: 'CONN' }
PS: I tried changing my network, it worked. Thanks.
@YasharF Raised a PR. Requesting for review.
Hi all — quick status check.
I'm a bit confused by the current state of this issue/PR: I see a few merged commits and related PRs referenced (e.g., #1414, #1421, #1462), but I'm not sure which branch or PR is considered the current work-in-progress and whether anything else is needed before this can be merged.
Could someone please clarify:
Which PR should be reviewed/merged next? Are there any outstanding blockers (tests, CI, or Mongo persistence setup) that I can help with? Is there a simple reproduction or checklist you want contributors to follow for the authenticated Playwright tests? Happy to help pick up any remaining work — just tell me where to jump in. Thanks!
It is in progress
Ok.