From ac15073a524171683e39b98f345d93de76bf9f4d Mon Sep 17 00:00:00 2001 From: Kristina <7614497+khjrtbrg@users.noreply.github.com> Date: Thu, 6 Feb 2025 10:12:39 +0100 Subject: [PATCH] [web] update e2e tests to look for new strings (#23425) GitOrigin-RevId: 62c513369adcd003db0aac6a3777eb0a98bf3289 --- server-ce/test/create-and-compile-project.spec.ts | 2 +- server-ce/test/editor.spec.ts | 2 +- server-ce/test/git-bridge.spec.ts | 6 +++--- server-ce/test/helpers/project.ts | 8 ++++---- server-ce/test/project-sharing.spec.ts | 12 ++++-------- 5 files changed, 13 insertions(+), 17 deletions(-) diff --git a/server-ce/test/create-and-compile-project.spec.ts b/server-ce/test/create-and-compile-project.spec.ts index 1bfcfa999a..a9924dbce8 100644 --- a/server-ce/test/create-and-compile-project.spec.ts +++ b/server-ce/test/create-and-compile-project.spec.ts @@ -101,7 +101,7 @@ describe('Project creation and compilation', function () { cy.findByText('Share').click() cy.findByRole('dialog').within(() => { cy.get('input').type('collaborator@example.com,') - cy.findByText('Share').click({ force: true }) + cy.findByText('Invite').click({ force: true }) }) cy.visit('/project') diff --git a/server-ce/test/editor.spec.ts b/server-ce/test/editor.spec.ts index 8344e5af61..cf24be92aa 100644 --- a/server-ce/test/editor.spec.ts +++ b/server-ce/test/editor.spec.ts @@ -86,7 +86,7 @@ describe('editor', () => { const linkSharingReadAndWrite = el.text() login('collaborator@example.com') cy.visit(linkSharingReadAndWrite) - cy.get('button').contains('Join Project').click() + cy.get('button').contains('OK, join project').click() cy.log( 'navigate to project dashboard to avoid cross session requests from editor' ) diff --git a/server-ce/test/git-bridge.spec.ts b/server-ce/test/git-bridge.spec.ts index 424bbac351..fd590134f6 100644 --- a/server-ce/test/git-bridge.spec.ts +++ b/server-ce/test/git-bridge.spec.ts @@ -148,7 +148,7 @@ describe('git-bridge', function () { shareProjectByEmailAndAcceptInviteViaDash( projectName, 'collaborator-ro@example.com', - 'Read only' + 'Can view' ) maybeClearAllTokens() cy.visit('/project') @@ -162,7 +162,7 @@ describe('git-bridge', function () { maybeClearAllTokens() cy.visit(linkSharingReadAndWrite) cy.findByText(projectName) // wait for lazy loading - cy.findByText('Join Project').click() + cy.findByText('OK, join project').click() checkGitAccess('readAndWrite') }) }) @@ -173,7 +173,7 @@ describe('git-bridge', function () { maybeClearAllTokens() cy.visit(linkSharingReadOnly) cy.findByText(projectName) // wait for lazy loading - cy.findByText('Join Project').click() + cy.findByText('OK, join project').click() checkGitAccess('readOnly') }) }) diff --git a/server-ce/test/helpers/project.ts b/server-ce/test/helpers/project.ts index c4d885a57f..4af6edc3bb 100644 --- a/server-ce/test/helpers/project.ts +++ b/server-ce/test/helpers/project.ts @@ -27,7 +27,7 @@ export function createProject( function shareProjectByEmail( projectName: string, email: string, - level: 'Read only' | 'Can edit' + level: 'Can view' | 'Can edit' ) { cy.visit('/project') cy.findByText(projectName).click() @@ -37,14 +37,14 @@ function shareProjectByEmail( cy.get('input') .parents('form') .within(() => cy.findByText('Can edit').parent().select(level)) - cy.findByText('Share').click({ force: true }) + cy.findByText('Invite').click({ force: true }) }) } export function shareProjectByEmailAndAcceptInviteViaDash( projectName: string, email: string, - level: 'Read only' | 'Can edit' + level: 'Can view' | 'Can edit' ) { shareProjectByEmail(projectName, email, level) @@ -61,7 +61,7 @@ export function shareProjectByEmailAndAcceptInviteViaDash( export function shareProjectByEmailAndAcceptInviteViaEmail( projectName: string, email: string, - level: 'Read only' | 'Can edit' + level: 'Can view' | 'Can edit' ) { shareProjectByEmail(projectName, email, level) diff --git a/server-ce/test/project-sharing.spec.ts b/server-ce/test/project-sharing.spec.ts index e14f36d778..783ab5230c 100644 --- a/server-ce/test/project-sharing.spec.ts +++ b/server-ce/test/project-sharing.spec.ts @@ -152,11 +152,7 @@ describe('Project Sharing', function () { beforeEach(function () { login('user@example.com') - shareProjectByEmailAndAcceptInviteViaEmail( - projectName, - email, - 'Read only' - ) + shareProjectByEmailAndAcceptInviteViaEmail(projectName, email, 'Can view') }) it('should grant the collaborator read access', () => { @@ -173,7 +169,7 @@ describe('Project Sharing', function () { beforeWithReRunOnTestRetry(function () { login('user@example.com') - shareProjectByEmailAndAcceptInviteViaDash(projectName, email, 'Read only') + shareProjectByEmailAndAcceptInviteViaDash(projectName, email, 'Can view') }) it('should grant the collaborator read access', () => { @@ -214,7 +210,7 @@ describe('Project Sharing', function () { login(email) cy.visit(linkSharingReadOnly) cy.findByText(projectName) // wait for lazy loading - cy.findByText('Join Project').click() + cy.findByText('OK, join project').click() expectRestrictedReadOnlyAccess() expectProjectDashboardEntry() }) @@ -228,7 +224,7 @@ describe('Project Sharing', function () { login(email) cy.visit(linkSharingReadAndWrite) cy.findByText(projectName) // wait for lazy loading - cy.findByText('Join Project').click() + cy.findByText('OK, join project').click() expectReadAndWriteAccess() expectEditAuthoredAs('You') expectProjectDashboardEntry()