Files
deck/cypress/e2e/boardFeatures.js
Simon Hötten 584675db21 add eslint for cypress tests
Signed-off-by: Simon Hötten <s+git@hoetten.org>
2022-12-30 14:43:11 +01:00

42 lines
1.0 KiB
JavaScript

import { randHash } from '../utils/index.js'
const randUser = randHash()
describe('Board', function() {
const password = 'pass123'
before(function() {
cy.nextcloudCreateUser(randUser, password)
})
beforeEach(function() {
cy.login(randUser, password)
})
it('Can create a board', function() {
const board = 'TestBoard'
cy.intercept({
method: 'POST',
url: '/index.php/apps/deck/boards',
}).as('createBoardRequest')
// Click "Add board"
cy.openLeftSidebar()
cy.get('#app-navigation-vue .app-navigation__list .app-navigation-entry')
.eq(3).find('a').first().click({ force: true })
// Type the board title
cy.get('.board-create form input[type=text]')
.type(board, { force: true })
// Submit
cy.get('.board-create form input[type=submit]')
.first().click({ force: true })
cy.wait('@createBoardRequest').its('response.statusCode').should('equal', 200)
cy.get('.app-navigation__list .app-navigation-entry__children .app-navigation-entry')
.contains(board).should('be.visible')
})
})