Skip to content
Snippets Groups Projects
Verified Commit 9016d6bd authored by jfriedli's avatar jfriedli
Browse files

make cypress test more reliable

parent 610bcf47
No related branches found
No related tags found
1 merge request!149Develop
# https://jessie-barnett.dev/blog/articles/running-cypress-gitlab-ci/
FROM cypress/included:3.4.1
WORKDIR /app
# This allows for creating a package.json within the Dockerfile itself
RUN
# Copying both the test files and the config for cypress
COPY ./test/cypress cypress
COPY cypress.ci.json /app/cypress.json
COPY wait-for-it.sh ./wait-for-it.sh
RUN chmod +x wait-for-it.sh
ENTRYPOINT ./wait-for-it.sh mat2-web-frontend:8080 -s -t 0 -- cypress run --spec "**/*.spec.js"
import 'cypress-file-upload'
describe('Upload page tests', () => {
describe('Download page tests', () => {
beforeEach(() => {
cy.unregisterServiceWorkers()
cy.server()
cy.route({
method: 'GET',
url: '/api/*'
url: '/api/extension'
}).as('api')
cy.visit('/')
cy.wait('@api').then((xhr) => {
......@@ -16,7 +16,7 @@ describe('Upload page tests', () => {
it('allows downloading multiple files', () => {
cy.route({
method: 'POST',
url: '/api/*'
url: '/api/upload'
}).as('fileUpload')
let fileNameOne = 'test-image.png'
......@@ -67,7 +67,7 @@ describe('Upload page tests', () => {
assert.isNotNull(xhr.response.body.data, 'file 3 upload successful')
})
cy.get('[data-cy=removed-metadata-title]').contains('Metadata removed')
cy.get('[data-cy=removed-metadata-title]',{timeout: 7000}).contains('Metadata removed')
cy.get('[data-cy=removed-metadata-paragraph]').contains('Successfully removed the metadata')
cy.get('[data-cy=main-back-button]').should('be.visible')
cy.get('[data-cy=success-badge]').should('have.css', 'background-color')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment