mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05: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:
parent
a68b0b2793
commit
6703ed7e27
2 changed files with 13 additions and 4 deletions
|
@ -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> {
|
||||
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(() => {
|
||||
|
|
Loading…
Reference in a new issue