mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 06:03:45 +01:00
Merge pull request #16508 from overleaf/msm-fix-ce-test
[server-ce] Fix cypress e2e tests GitOrigin-RevId: ffb802d15491cd5fdb96486629da675d90cce18e
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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<string> {
|
||||
// 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(() => {
|
||||
|
||||
Reference in New Issue
Block a user