mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 20:33:36 -05:00
8eb8b233c0
[server-ce] e2e tests: add capability for reconfiguring the instance GitOrigin-RevId: 44ec800b5b37497b3122310a94f637c24ff2667a
22 lines
565 B
TypeScript
22 lines
565 B
TypeScript
export function createProject(
|
|
name: string,
|
|
{
|
|
type = 'Blank Project',
|
|
}: {
|
|
type?: 'Blank Project' | 'Example Project'
|
|
} = {}
|
|
): Cypress.Chainable<string> {
|
|
cy.findAllByRole('button')
|
|
.contains(/new project/i)
|
|
.click()
|
|
// FIXME: This should only look in the left menu
|
|
cy.findAllByText(type).first().click()
|
|
cy.findByRole('dialog').within(() => {
|
|
cy.get('input').type(name)
|
|
cy.findByText('Create').click()
|
|
})
|
|
return cy
|
|
.url()
|
|
.should('match', /\/project\/[a-fA-F0-9]{24}/)
|
|
.then(url => url.split('/').pop())
|
|
}
|