mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-01 21:32:22 -05:00
b75d183cfc
[server-pro] add tests for upgrade process GitOrigin-RevId: eaa1486688cb2fa544adaaee16da04fd757a1b65
22 lines
647 B
TypeScript
22 lines
647 B
TypeScript
export function createProject(
|
|
name: string,
|
|
{
|
|
type = 'Blank Project',
|
|
newProjectButtonMatcher = /new project/i,
|
|
}: {
|
|
type?: 'Blank Project' | 'Example Project'
|
|
newProjectButtonMatcher?: RegExp
|
|
} = {}
|
|
): Cypress.Chainable<string> {
|
|
cy.findAllByRole('button').contains(newProjectButtonMatcher).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())
|
|
}
|