Skip to content
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

[Vote] Add XVFB for cypress tests #23

Open
JeffBeltran opened this issue Feb 25, 2019 · 9 comments
Open

[Vote] Add XVFB for cypress tests #23

JeffBeltran opened this issue Feb 25, 2019 · 9 comments
Labels
feature request Vote with a thumb up or down for this feature request

Comments

@JeffBeltran
Copy link

Hello, to avoid having to maintain my own image i was hoping you could add XVFB to this so that i could run my cypress tests with this image. If not i understand

@lorisleiva
Copy link
Owner

Hi there 👋

Thanks for your suggestion. Do you have any idea how heavy this addition would be?

I'm trying to include as much features as possible in this image but I don't want it to become unnecessarily big and therefore long to download when used in CI/CD.

@JeffBeltran
Copy link
Author

tbh no, and i can just use the cypress image for that stage so it's not a big deal. If you are not sure i say keep it simple because I have a valid work around.

As an aside, Thanks for the this "suite" of tools to make my deployments easier

@lorisleiva
Copy link
Owner

Thanks I'm glad you're finding it useful. 🙂

No problem, in that case I'm going to leave this issue open and let people vote with thumbs up. If I see that this is popular and necessary for most projects, I'll add it to the DockerFiles.

@lorisleiva lorisleiva changed the title Add XVFB for cypress tests [Vote] Add XVFB for cypress tests Jun 28, 2019
@lorisleiva lorisleiva added the feature request Vote with a thumb up or down for this feature request label Jun 28, 2019
@juniorgarcia
Copy link

Hi guys. I bumped in that issue about using Cypress with this docker image.

@JeffBeltran What CI tool do you use? I thought about using Cypress image to make the tests, but, how would you start the local server and make it visible to Cypress?

@JeffBeltran
Copy link
Author

@juniorgarcia we are using gitlab but we don't start a local server and test the code. We just deploy to our dev environment and run our Cypress suite post deployment. it's more a safety check than anything else. It's not the best solution but it works to catch things in dev before they make their way to prod

@juniorgarcia
Copy link

Well, as far as I searched, Cypress is just not compatible with Alpine Linux. I've tried to install it using docker locally and even xvfb is not enough to make it run.

I believe that the "best" way to fix this issue is to use one of Cypress docker images and build your own based on them, or wait until version 4.0 which will upgrade Electron and fix this.

See:

@Jakegillingham5
Copy link

Jakegillingham5 commented Sep 11, 2019

@juniorgarcia did you manage to get a solution for including it in your CI pipeline?

Also having dependency issues when running cypress, wanting to start the server locally and run the tests against it.

@juniorgarcia
Copy link

juniorgarcia commented Sep 11, 2019

Hey guys, I've made a Docker image to run Laravel tests using Cypress. I'm using to test a real app and works like a charm.

Here's the GitLab's CI config part for the test:

e2etest:
  image: juniorgarcia/laravel-cypress:latest
  before_script:
    - mv .env.testing .env
    - touch testing.sqlite
    - php artisan key:generate
    - php artisan migrate
    - nohup php artisan serve -q &
  stage: test
  script:
    - npx cypress install
    - npx cypress verify
    - npm run-script test:e2eci
  dependencies:
    - composer
    - npm

In my package.json the script that runs the test is (test:e2eci) is: wait-on http://127.0.0.1:8000 && cypress run --config video=false. If you would use the same script, remember to install wait-on package.

Of course, for the other CI phases I use lorisleiva/laravel-docker for it's really well made and lightweight.

@robsontenorio
Copy link

For now, this is my current approach. If there is another option, please, let me know.

https://github.com/robsontenorio/laravel-docker-cypress

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Vote with a thumb up or down for this feature request
Projects
None yet
Development

No branches or pull requests

5 participants