Skip to content

Commit

Permalink
Allow cypress tests to be run in GitPod (#506)
Browse files Browse the repository at this point in the history
* install xvfb in GitPod

https://community.gitpod.io/t/rails-app-trying-to-get-chromedriver-working/1268

* Update .gitpod.yml

* Update .gitpod.dockerfile

* cypress running in gitpod

* Update README.md

* Update .gitpod.yml
  • Loading branch information
jywarren authored Feb 16, 2021
1 parent f3b4a50 commit ddf7155
Show file tree
Hide file tree
Showing 6 changed files with 10,286 additions and 608 deletions.
63 changes: 63 additions & 0 deletions .gitpod.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
FROM gitpod/workspace-full

USER root
RUN sudo apt-get update && apt-get install -y apt-transport-https \
&& sudo apt-get install -y \
xserver-xorg-dev \
libxext-dev \
build-essential \
libxi-dev \
libglew-dev \
pkg-config \
libglu1-mesa-dev \
freeglut3-dev \
mesa-common-dev \
x11-apps \
libice6 \
libsm6 \
libxaw7 \
libxft2 \
libxmu6 \
libxpm4 \
libxt6 \
x11-apps \
xbitmaps \
ca-certificates \
fonts-liberation \
libappindicator3-1 \
libasound2 \
libatk-bridge2.0-0 \
libatk1.0-0 \
libc6 \
libcairo2 \
libcups2 \
libdbus-1-3 \
libexpat1 \
libfontconfig1 \
libgbm1 \
libgcc1 \
libglib2.0-0 \
libgtk-3-0 \
libnspr4 \
libnss3 \
libpango-1.0-0 \
libpangocairo-1.0-0 \
libstdc++6 \
libx11-6 \
libx11-xcb1 \
libxcb1 \
libxcomposite1 \
libxcursor1 \
libxdamage1 \
libxext6 \
libxfixes3 \
libxi6 \
libxrandr2 \
libxrender1 \
libxss1 \
libxtst6 \
lsb-release \
wget \
xdg-utils \
xvfb \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/*
4 changes: 4 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
image:
file: .gitpod.dockerfile

tasks:
- init: npm install
command: |
npm install -g cypress
npm run start
gp await-port 8080
gp preview http://localhost:8080/example/
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ When specifying layers to include or exclude, use [their names as listed in the
7. Run `npm run cy:run:chrome` to run e2e and integration tests.
8. Test your changes on a browser by opening `examples/index.html`.

#### Testing in GitPod

To run Cypress tests in GitPod, you'll need to do `npm install -g cypress` and then use: `npm run start:ci & cypress run --browser electron`

## Features

### _Zoom or Pan_
Expand Down
4 changes: 2 additions & 2 deletions cypress.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"baseUrl": "http://localhost:8080",
"modifyObstructiveCode": false,
"chromeWebSecurity": false
}
"chromeWebSecurity": false
}
Loading

0 comments on commit ddf7155

Please sign in to comment.