Merge pull request #16995 from overleaf/jpa-fix-server-ce-e2e

[server-ce] fix e2e tests

GitOrigin-RevId: 95a9edd44a50254ac9f680368cf8e10bbf827d69
This commit is contained in:
Jakob Ackermann 2024-02-08 16:51:26 +00:00 committed by Copybot
parent 4c0c341fe1
commit 1b0c4215b8
5 changed files with 35 additions and 13 deletions

View file

@ -5,4 +5,9 @@ test-e2e:
docker compose -f docker-compose.yml run --rm e2e
docker compose down -v -t 0
.PHONY: test-e2e
test-e2e-open:
docker compose down -v -t 0
docker compose -f docker-compose.yml run --rm e2e-open
docker compose down -v -t 0
.PHONY: test-e2e test-e2e-open

View file

@ -63,7 +63,7 @@ describe('Project creation and compilation', function () {
cy.findByText('Create').click()
})
// FIXME: should be aria-labeled or data-test-id
cy.get('.file-tree').within(() => {
cy.get('.file-tree').first().within(() => {
cy.findByText('frog.jpg').click()
})
cy.findByText('Another project')
@ -100,9 +100,7 @@ describe('Project creation and compilation', function () {
cy.findByText('Share').click()
cy.findByRole('dialog').within(() => {
cy.get('input').type('collaborator@example.com,')
// FIXME: Open an issue for this.
cy.get('button[type="submit"]').click({ force: true })
cy.get('button[type="submit"]').click({ force: true })
cy.findByText('Share').click({ force: true })
})
cy.visit('/project')
@ -123,7 +121,7 @@ describe('Project creation and compilation', function () {
cy.url().should('include', targetProjectId)
})
cy.get('.file-tree').within(() => {
cy.get('.file-tree').first().within(() => {
cy.findByText('frog.jpg').click()
})
cy.findByText('Another project')

View file

@ -9,7 +9,7 @@ services:
redis:
condition: service_started
ports:
- 80:80
- 127.0.0.2:80:80
links:
- mongo
- redis
@ -50,7 +50,7 @@ services:
- 6379
e2e:
image: cypress/included:13.3.0
image: cypress/included:13.3.3
links:
- sharelatex
working_dir: /e2e
@ -62,3 +62,22 @@ services:
depends_on:
sharelatex:
condition: service_healthy
e2e-open:
image: cypress/included:13.3.3
entrypoint: npm
command: run cypress:open
links:
- sharelatex
working_dir: /e2e
volumes:
- ./:/e2e
- /tmp/.X11-unix:/tmp/.X11-unix
user: "${DOCKER_USER:-1000:1000}"
environment:
CYPRESS_BASE_URL: http://sharelatex
SPEC_PATTERN: '**/*.spec.{js,jsx,ts,tsx}'
DISPLAY: ${DISPLAY:-:0}
depends_on:
sharelatex:
condition: service_healthy

View file

@ -7,7 +7,7 @@
"name": "@overleaf/server-ce/test",
"dependencies": {
"@testing-library/cypress": "^10.0.1",
"cypress": "13.3.0",
"cypress": "13.3.3",
"typescript": "^5.0.4"
}
},
@ -713,9 +713,9 @@
}
},
"node_modules/cypress": {
"version": "13.3.0",
"resolved": "https://registry.npmjs.org/cypress/-/cypress-13.3.0.tgz",
"integrity": "sha512-mpI8qcTwLGiA4zEQvTC/U1xGUezVV4V8HQCOYjlEOrVmU1etVvxOjkCXHGwrlYdZU/EPmUiWfsO3yt1o+Q2bgw==",
"version": "13.3.3",
"resolved": "https://registry.npmjs.org/cypress/-/cypress-13.3.3.tgz",
"integrity": "sha512-mbdkojHhKB1xbrj7CrKWHi22uFx9P9vQFiR0sYDZZoK99OMp9/ZYN55TO5pjbXmV7xvCJ4JwBoADXjOJK8aCJw==",
"hasInstallScript": true,
"dependencies": {
"@cypress/request": "^3.0.0",

View file

@ -10,7 +10,7 @@
},
"dependencies": {
"@testing-library/cypress": "^10.0.1",
"cypress": "13.3.0",
"cypress": "13.3.3",
"typescript": "^5.0.4"
}
}