Conversation
9294013
to
2de7313
Compare
This appears to be necessary in order for the Cypress container to reach the webserver within the docker network. Better ways to achieve this may exist. vuejs-templates/webpack#1205 (comment)
No need to make up new env vars.
- added docker cleanup action Bug: T273771
2de7313
to
e28d02f
Compare
e28d02f
to
19e22a4
Compare
for docker-compose command
ffb6602
to
7d6209e
Compare
for docker-compose command
e8bc3c7
to
f7a52fe
Compare
@micgro42 |
Strangely, the actual cypress tests have failed. Not sure why GitHub is marking it as successful 🧐 |
ec166da
to
a6b0dec
Compare
@micgro42 I tried it out with cypress io. now when the tests fail, github also fails the job |
@bereket-WMDE Given how it is done so far, we either need to start the dev server with something like - name: Cypress run
uses: cypress-io/github-action@v2
with:
start: npm run serve see https://github.com/cypress-io/github-action#start-server or actually add this to the action that deploys to netlify and use that server. We would then probably use the config parameter: https://github.com/cypress-io/github-action#config |
fa602a5
to
fcb2d87
Compare
fcb2d87
to
7882352
Compare
hi @micgro42 the tests fail properly now. yay! |
@micgro42 updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\o/
9946afe
to
13b20c0
Compare
Kudos, SonarCloud Quality Gate passed! |
This PR sets up Cypress and adds an initial browser test! \o/
Usage without docker
For running the tests locally
npm install
installs everything Cypress needs, including Electron. You can then runCYPRESS_BASE_URL=http://your-dev-server:8080 npm run cypress
(substitutinghttp://your-dev-server:8080
with the URL where your query builder is running) to run the whole test suite orCYPRESS_BASE_URL=http://your-dev-server:8080 npx cypress open
to run the tests interactively.Usage with docker
Running the tests with docker should be as easy as running
docker-compose -f docker-compose.yml -f docker-compose.e2e.yml up e2e
. Note that something like 321a1c2 is likely necessary for the Cypress service to reach the web server, but there might be a better way to achieve this.There are multiple docker images available for Cypress. We chose the
included
one here, which comes with Cypress preinstalled and multiple web browsers (electron, chrome, firefox). This is definitely not a lightweight option, and it is also worth noting that as it is set up right now, this will use the cypress binary included with the image, not the one fromnode_modules/
. We did this for ease of setup, but please revisit this decision and see if it makes sense.Problems with the application discovered while creating the tests
Apologies for the noise if these are known.
delay
option to thetype()
(docs) calls in the tests, but that's silly. I filed T273868.wdt:undefined
on line 49 in the query. The test passes which means that this is actually something that is produced by the query builder, but I fail to reproduce this on the test system. This might be something that got fixed in the meantime.Problems with the tests