diff --git a/server-ce/test/create-and-compile-project.spec.ts b/server-ce/test/create-and-compile-project.spec.ts index 49e4c28aa7..3c974b9b48 100644 --- a/server-ce/test/create-and-compile-project.spec.ts +++ b/server-ce/test/create-and-compile-project.spec.ts @@ -5,7 +5,8 @@ describe('Project creation and compilation', function () { it('users can create project and compile it', function () { login('user@example.com') cy.visit('/project') - createProject('test-project') + // this is the first project created, the welcome screen is displayed instead of the project list + createProject('test-project', { isFirstProject: true }) cy.url().should('match', /\/project\/[a-fA-F0-9]{24}/) cy.findByText('\\maketitle') .parent() diff --git a/server-ce/test/helpers/project.ts b/server-ce/test/helpers/project.ts index aeafdbeea3..47d51bc4e5 100644 --- a/server-ce/test/helpers/project.ts +++ b/server-ce/test/helpers/project.ts @@ -2,10 +2,18 @@ export function createProject( name: string, { type = 'Blank Project', - }: { type?: 'Blank Project' | 'Example Project' } = {} + isFirstProject, + }: { + type?: 'Blank Project' | 'Example Project' + isFirstProject?: boolean + } = {} ): Cypress.Chainable { - // FIXME: This should be be a data-test-id shared between the welcome page and project list - cy.get('.new-project-button').first().click() + if (isFirstProject) { + cy.findByText('Create a new project').click() + } else { + // FIXME: This should be be a data-test-id shared between the welcome page and project list + cy.get('.new-project-button').first().click() + } // FIXME: This should only look in the left menu cy.findAllByText(type).first().click() cy.findByRole('dialog').within(() => {