focalboard/webapp/cypress/support/ui_commands.ts
Scott Bishel 70ab1afecd
fix cypress tests (#2628)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-03-24 11:24:18 -06:00

21 lines
669 B
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
/* eslint-disable cypress/no-unnecessary-waiting */
Cypress.Commands.add('uiCreateBoard', (item: string) => {
cy.log(`Create new board: ${item}`)
cy.contains('+ Add board').should('be.visible').click()
cy.contains(item).click()
cy.contains('Use this template').click({force: true}).wait(1000)
})
Cypress.Commands.add('uiCreateEmptyBoard', () => {
cy.log('Create new empty board')
cy.contains('+ Add board').should('be.visible').click().wait(500)
return cy.contains('Create empty board').click({force: true}).wait(1000)
})