-
Notifications
You must be signed in to change notification settings - Fork 3
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
Begin adding e2e tests #20
Conversation
I purposefully included a failing test to start: https://github.com/umd-mith/mith-static/blob/a2a33f82acb95d78553d8e27ca731ee51aebd81d/tests/top-level-pages.spec.ts#L31C1-L36C3 Also, see the note about "invisible" elements (relevant to current People page design): https://github.com/umd-mith/mith-static/blob/a2a33f82acb95d78553d8e27ca731ee51aebd81d/tests/top-level-pages.spec.ts#L21C3-L28C46 |
Once we go this route, we can also add workflow steps to run tests before building the staging site |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@trevormunoz I had to increased the timeout time for this to work on my machine. Processing the nodes from Airtable can take a while... I'm looking at a strategy to cache them better, but we'll still need a generous timeout in case the tests are run before a first build.
I also needed to install playwright as a binary with npx playwright install
, a step that will be needed in the deployment workflow(s) as well.
Otherwise, it behaves as expected, returning the error for title and h1 on the news page. I think we can merge this and keep working on it on the main branch,
@raffazizzi Were you running into these errors with the Gatsby build on Actions? https://github.com/umd-mith/mith-static/actions/runs/9998232860/job/27636795516#step:6:22 (I think this is a Gatsby timeout and not a Playwright one?) |
That's the same error I was getting when I first tested this branch. |
Weird. Your commit increasing the timeout is definitely there on the branch … lemme look some more |
So, the timeout needs to be increased in See https://playwright.dev/docs/test-webserver#configuring-a-web-server We need the increased timeout to wait for the Gatsby startup (as you said). Now the Actions test results match the local ones |
Without sinking too much time into testing, I think we can benefit from having at least a small test suite to check that pages are the way we want as we are remodeling the site.
I've added a super basic set of Playwright tests aimed at the top-level pages to start.
You can use
npm run test
to launch the tests.