steelesh / UCollab

IT SR Capstone project
https://steelesh.github.io/UCollab/
0 stars 0 forks source link

Update gh actions workflow to run application before running tests #68

Open steelesh opened 1 week ago

steelesh commented 1 week ago
When the ci/cd pipeline runs the `npx playwright test` command, this error is returned: Error: page.goto: net::ERR_CONNECTION_REFUSED at http://localhost:3000/ Call log: - navigating to "http://localhost:3000/", waiting until "load" 2 | 3 | test('example', async ({ page }) => { > [4](https://github.com/steelesh/UCollab/actions/runs/11749901283/job/32737046056?pr=67#step:6:5) | await page.goto('http://localhost:3000'); // Ensure the URL matches the app’s address | ^ [5](https://github.com/steelesh/UCollab/actions/runs/11749901283/job/32737046056?pr=67#step:6:6) | expect(await page.title()).toBe('UCollab — Sign In'); // Replace 'UCollab' with the actual page title [6](https://github.com/steelesh/UCollab/actions/runs/11749901283/job/32737046056?pr=67#step:6:7) | }); at /home/runner/work/UCollab/UCollab/e2e/title.spec.js:4:12
thomasza92 commented 1 week ago

Unfortunately this will also require us to find a way to utilize a secure .env file for Github Actions. So this issue may be harder to fix than expected. In the mean time I suggest we disable the Playwright workflow until this issue is fixed. We will still be able to run tests locally until then.

thomasza92 commented 1 week ago

Actually I think it's probably better if this issue is closed and we can have any further discussion take place in #39

steelesh commented 1 week ago

@thomasza92 ah did not think of that. should be pretty simple, though. by adding .env values to the GitHub repo (secrets) and referencing them in the workflow everything should work as expected