diff --git a/server-ce/test/Makefile b/server-ce/test/Makefile index 80e7d2df6d..c0e5f9fbb9 100644 --- a/server-ce/test/Makefile +++ b/server-ce/test/Makefile @@ -5,4 +5,9 @@ test-e2e: docker compose -f docker-compose.yml run --rm e2e docker compose down -v -t 0 -.PHONY: test-e2e \ No newline at end of file +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 diff --git a/server-ce/test/create-and-compile-project.spec.ts b/server-ce/test/create-and-compile-project.spec.ts index 3c974b9b48..c3eea10c60 100644 --- a/server-ce/test/create-and-compile-project.spec.ts +++ b/server-ce/test/create-and-compile-project.spec.ts @@ -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') diff --git a/server-ce/test/docker-compose.yml b/server-ce/test/docker-compose.yml index e445373ce8..9a148ebd7a 100644 --- a/server-ce/test/docker-compose.yml +++ b/server-ce/test/docker-compose.yml @@ -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 diff --git a/server-ce/test/package-lock.json b/server-ce/test/package-lock.json index 1912fda1d2..aa232b55da 100644 --- a/server-ce/test/package-lock.json +++ b/server-ce/test/package-lock.json @@ -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", diff --git a/server-ce/test/package.json b/server-ce/test/package.json index 244b73d2db..1385b349f6 100644 --- a/server-ce/test/package.json +++ b/server-ce/test/package.json @@ -10,7 +10,7 @@ }, "dependencies": { "@testing-library/cypress": "^10.0.1", - "cypress": "13.3.0", + "cypress": "13.3.3", "typescript": "^5.0.4" } }