[web] update e2e tests to look for new strings (#23425)

GitOrigin-RevId: 62c513369adcd003db0aac6a3777eb0a98bf3289
This commit is contained in:
Kristina
2025-02-06 10:12:39 +01:00
committed by Copybot
parent 9b9d002f9b
commit ac15073a52
5 changed files with 13 additions and 17 deletions

View File

@@ -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')

View File

@@ -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'
)

View File

@@ -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')
})
})

View File

@@ -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)

View File

@@ -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()