Some cypress test cleanup and fixes

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2022-08-28 14:37:11 +02:00
parent 74d9e63888
commit a0c47f8115
7 changed files with 213 additions and 142 deletions

View File

@@ -1,10 +1,10 @@
import { randHash } from "../utils"
import { randHash } from '../utils'
const randUser = randHash()
describe('Board', function () {
const password = 'pass123'
before(function () {
describe('Board', function() {
const password = 'pass123'
before(function() {
cy.nextcloudCreateUser(randUser, password)
})
@@ -12,30 +12,30 @@ describe('Board', function () {
cy.login(randUser, password)
})
it('Can create a board', function () {
let board = 'Test'
it('Can create a board', function() {
const board = 'Test'
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})
cy.intercept({
method: 'POST',
url: '/index.php/apps/deck/boards',
}).as('createBoardRequest')
// Type the board title
cy.get('.board-create form input[type=text]')
.type(board, {force: true})
// Click "Add board"
cy.openLeftSidebar()
cy.get('#app-navigation-vue .app-navigation__list .app-navigation-entry')
.eq(3).find('a').first().click({ force: true })
// Submit
cy.get('.board-create form input[type=submit]')
.first().click({force: true})
// Type the board title
cy.get('.board-create form input[type=text]')
.type(board, { 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')
// 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')
})
})
})