2

I have spent a long time trying to debug this, but every solution I tried didn't work.

I have a project (here) containerised using docker, and the project itself uses Laravel, Nginx and Dusk.

If i try build the environment and run the dusk tests, they pass. Yet when i push this up to GH, the tests fail. I have dump()ed inside the CI, and it seems to show an empty page (<html><head></head><body></body></html>).

I feel like i've searched the whole internet at this point.

How i run my tests:

$ cd src/copytube
$ npm ci
$ npm run dev
$ composer install
$ docker-compose up -d
$ docker exec copytube_phpfpm php artisan dusk

Don't suppose anyone has any idea as to why/how tests would fail only in the CI? The only difference between local and the CI i can think of is, I use a Mac, whereas the CI uses an ubuntu runner. But even then, because everything is containerised, it shouldn't be a problem

EDIT

On every single test, it errors, saying Element oes not exist, which makes sense becausee the page is just an empty body, the tests can be found here

EDIT 2

The CI failing can be seen here (old action)

I've disabled the dusk tests from running inside the workflow

EDIT 3

D: I'll re-enable the tests so it can be easier to see

EDIT 4

Here's a PR where I enabled the dusk tests in the CI so you can see the errors: https://github.com/ebebbington/copytube/pull/161

Indecisive
  • 66
  • 3

1 Answers1

0

I had this kind of problem when I was setting in the .env file as APP_URL a URL that starts with https://

So I guess that the problem is related to the .env file that you using on Github CI to run the tests.

Here is my answer related to that.
Laravel Dusk returns empty html document when dumping browser, assertions therefore fail

Davide Casiraghi
  • 15,591
  • 9
  • 34
  • 56