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
Hi,
Iv'e been trying for quite a while now to run my playwright test on my application which I run on localhost port 3000,
I navigate to the local host website via page.goto function
which I get it from an enum => LOCAL = 'http://127.0.0.1:3000/users/sign_in',
which I call it like this loadApplication(ApplicationUrl.LOCAL);
I tried to navigate to localhost or 127.0.0.1:3000 but both do not work and I get this connection refused error in github actions
I am exposing port 3000 in the docker-compose.yml file and when running it locally everything works fine and Im able to load up the app via docker compose but it fails when it tries to go to the url and I always get this error.
I also tried to curl http request to the same url on both localhost or 127.0.0.1 which did not solve the issue.
connecting to a url with server that has a DNS name does work in CI, but I wanna run it on local host in the job.
the server is up and running when I run docker-compsoe up and the step passes
otherwise it would have failed if the server was not up
also tried to start the server with it's command rails s -p 3000 -d but still I receive the same error that the connection is refused
please tell me what I need to do to fix this issue since I already tried pretty much everything.
I will provide the workflow + docker-compose file below:
this is the error that I recieve:
1) [Google Chrome] › tests/almondLoginTest/LoginTest.spec.ts:23:9 › Login test to almond QMS › Login to Almond QMS system @LOGIN_SANITY (Qase ID: 90)
Error: page.goto: net::ERR_CONNECTION_REFUSED at http://127.0.0.1:3000/users/sign_in
=========================== logs ===========================
navigating to "http://127.0.0.1:3000/users/sign_in", waiting until "domcontentloaded"
============================================================
at common/BasePage.ts:11
9 |
10 | public async loadApplication(url: ApplicationUrl) {
> 11 | await this.page.goto(url.valueOf(), {
| ^
12 | waitUntil: 'domcontentloaded',
13 | });
14 | }
at BasePage.loadApplication (/__w/almond/almond/uiAutomation/Playwright/common/BasePage.ts:11:[25](https://github.com/almond-qms/almond/actions/runs/5750240504/job/15586604981#step:8:26))
at /__w/almond/almond/uiAutomation/Playwright/tests/almondLoginTest/LoginTest.spec.ts:[26](https://github.com/almond-qms/almond/actions/runs/5750240504/job/15586604981#step:8:27):[28](https://github.com/almond-qms/almond/actions/runs/5750240504/job/15586604981#step:8:29)
at /__w/almond/almond/uiAutomation/Playwright/tests/almondLoginTest/LoginTest.spec.ts:25:20
attachment #2: video (video/webm) ──────────────────────────────────────────────────────────────
test-results/tests-almondLoginTest-LoginTest-Login-test-to--84f2b-n-to-Almond-QMS-system-LOGIN-SANITY-Qase-ID-90--Google-Chrome/video.webm
────────────────────────────────────────────────────────────────────────────────────────────────
attachment #3: trace (application/zip) ─────────────────────────────────────────────────────────
test-results/tests-almondLoginTest-LoginTest-Login-test-to--84f2b-n-to-Almond-QMS-system-LOGIN-SANITY-Qase-ID-90--Google-Chrome/trace.zip
Usage:
npx playwright show-trace test-results/tests-almondLoginTest-LoginTest-Login-test-to--84f2b-n-to-Almond-QMS-system-LOGIN-SANITY-Qase-ID-90--Google-Chrome/trace.zip
I also tried to curl http request to the same url on both localhost or 127.0.0.1 which did not solve the issue. connecting to a url with server that has a DNS name does work in CI, but I wanna run it on local host in the job.
Since you cannot access the url with curl, it seems like a problem with running the server with docker compose on your CI rather than a playwright bug.
If you still think it's a bug in Playwright we'll need a self-contained repro that could be run locally in order to help you.
@yury-s I solved the issue by adding the service under the container key in the CI, similar to docker compose file when you define the services, although idk why I need to specify the service if it is already defined in the docker compose file but this solves the issue for navigating to local host in playwright with github actions.
Hi,
Iv'e been trying for quite a while now to run my playwright test on my application which I run on localhost port 3000,
I navigate to the local host website via page.goto function
which I get it from an enum => LOCAL = 'http://127.0.0.1:3000/users/sign_in',
which I call it like this loadApplication(ApplicationUrl.LOCAL);
I tried to navigate to localhost or 127.0.0.1:3000 but both do not work and I get this connection refused error in github actions
I am exposing port 3000 in the docker-compose.yml file and when running it locally everything works fine and Im able to load up the app via docker compose but it fails when it tries to go to the url and I always get this error.
I also tried to curl http request to the same url on both localhost or 127.0.0.1 which did not solve the issue.
connecting to a url with server that has a DNS name does work in CI, but I wanna run it on local host in the job.
the server is up and running when I run docker-compsoe up and the step passes
otherwise it would have failed if the server was not up
also tried to start the server with it's command rails s -p 3000 -d but still I receive the same error that the connection is refused
please tell me what I need to do to fix this issue since I already tried pretty much everything.
I will provide the workflow + docker-compose file below:
this is the error that I recieve:
this is my CI workflow:
docker-compose
The text was updated successfully, but these errors were encountered: