ui_commands.ts
TLDR
The ui_commands.ts
file contains custom Cypress commands for creating boards in a user interface.
Methods
uiCreateBoard
This method creates a new board in the user interface. It takes an item parameter specifying the name of the board to be created. The method performs the following steps:
- Logs a message indicating the creation of a new board with the specified item name.
- Checks if the "+ Add board" element is visible and clicks on it.
- Clicks on the element that contains the specified item name.
- Clicks on the "Use this template" element forcefully.
- Waits for 1000 milliseconds.
uiCreateEmptyBoard
This method creates a new empty board in the user interface. It performs the following steps:
- Logs a message indicating the creation of a new empty board.
- Checks if the "+ Add board" element is visible and clicks on it.
- Waits for 500 milliseconds.
- Clicks on the "Create an empty board" element forcefully.
- Waits for 1000 milliseconds.
// 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 an empty board').click({force: true}).wait(1000)
})