Преглед изворни кода

Merge pull request #23173 from overleaf/mj-fix-e2e

[web+server-ce] Fix E2E tests

GitOrigin-RevId: cc22952bf828c32ce01eacc707935d3e7b156d71
Mathias Jakobsen пре 1 година
родитељ
комит
57e535af52

+ 2 - 2
server-ce/test/editor.spec.ts

@@ -107,7 +107,7 @@ describe('editor', () => {
       cy.intercept('POST', '**/track_changes').as('enableTrackChanges')
       cy.findByText('Everyone')
         .parent()
-        .within(() => cy.get('.input-switch').click())
+        .within(() => cy.get('.form-check-input').click())
       cy.wait('@enableTrackChanges')
 
       login('collaborator@example.com')
@@ -146,7 +146,7 @@ describe('editor', () => {
       cy.intercept('POST', '**/track_changes').as('enableTrackChanges')
       cy.findByText('Everyone')
         .parent()
-        .within(() => cy.get('.input-switch').click())
+        .within(() => cy.get('.form-check-input').click())
       cy.wait('@enableTrackChanges')
 
       login('collaborator@example.com')

+ 4 - 4
server-ce/test/git-bridge.spec.ts

@@ -82,7 +82,7 @@ describe('git-bridge', function () {
       cy.get('header').findByText('Menu').click()
       cy.findByText('Sync')
       cy.findByText('Git').click()
-      cy.findByRole('dialog').within(() => {
+      cy.findByTestId('git-bridge-modal').within(() => {
         cy.get('@projectId').then(id => {
           cy.get('code').contains(
             `git clone http://git@${gitBridgePublicHost}/git/${id}`
@@ -98,7 +98,7 @@ describe('git-bridge', function () {
       cy.url().then(url => cy.visit(url))
       cy.get('header').findByText('Menu').click()
       cy.findByText('Git').click()
-      cy.findByRole('dialog').within(() => {
+      cy.findByTestId('git-bridge-modal').within(() => {
         cy.get('@projectId').then(id => {
           cy.get('code').contains(
             `git clone http://git@${gitBridgePublicHost}/git/${id}`
@@ -186,7 +186,7 @@ describe('git-bridge', function () {
       cy.findByText('Sync')
       cy.findByText('Git').click()
       cy.get('@projectId').then(projectId => {
-        cy.findByRole('dialog').within(() => {
+        cy.findByTestId('git-bridge-modal').within(() => {
           cy.get('code').contains(
             `git clone http://git@${gitBridgePublicHost}/git/${projectId}`
           )
@@ -202,7 +202,7 @@ describe('git-bridge', function () {
             // close Git modal
             cy.findAllByText('Close').last().click()
             // close editor menu
-            cy.get('#left-menu-modal').click()
+            cy.get('.left-menu-modal-backdrop').click()
 
             const fs = new LightningFS('fs')
             const dir = `/${projectId}`

+ 2 - 2
server-ce/test/sandboxed-compiles.spec.ts

@@ -46,7 +46,7 @@ describe('SandboxedCompiles', function () {
         .findByText('2023')
         .parent()
         .select('2022')
-      cy.get('#left-menu-modal').click()
+      cy.get('.left-menu-modal-backdrop').click()
 
       cy.log('Trigger compile with other TeX Live version')
       recompile()
@@ -187,7 +187,7 @@ describe('SandboxedCompiles', function () {
         .findByText('pdfLaTeX')
         .parent()
         .select('XeLaTeX')
-      cy.get('#left-menu-modal').click()
+      cy.get('.left-menu-modal-backdrop').click()
 
       cy.log('Trigger compile with other compiler')
       recompile()

+ 1 - 1
server-ce/test/templates.spec.ts

@@ -64,7 +64,7 @@ describe('Templates', () => {
         .get('textarea')
         .type(description)
       cy.findByText('Publish').click()
-      cy.findByText('Publishing…').should('be.disabled')
+      cy.findByText('Publishing…').parent().should('be.disabled')
       cy.findByText('Publish').should('not.exist')
       cy.findByText('Unpublish', { timeout: 10_000 })
       cy.findByText('Republish')

+ 1 - 1
server-ce/test/upgrading.spec.ts

@@ -59,7 +59,7 @@ describe('Upgrading', function () {
         recompile()
         cy.get('header').findByText('Menu').click()
         cy.findByText('Source').click()
-        cy.get('#left-menu-modal').click()
+        cy.get('.left-menu-modal-backdrop').click({ force: true })
       }
 
       cy.log('Check compile and history')