2023-11-23 05:40:13 -05:00
|
|
|
export function createProject(
|
|
|
|
name: string,
|
|
|
|
{
|
|
|
|
type = 'Blank Project',
|
2024-01-16 04:40:22 -05:00
|
|
|
}: {
|
|
|
|
type?: 'Blank Project' | 'Example Project'
|
|
|
|
} = {}
|
2023-11-23 05:40:13 -05:00
|
|
|
): Cypress.Chainable<string> {
|
2024-05-30 03:12:56 -04:00
|
|
|
cy.findAllByRole('button')
|
|
|
|
.contains(/new project/i)
|
|
|
|
.click()
|
2023-11-23 05:40:13 -05:00
|
|
|
// 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())
|
|
|
|
}
|