Some cypress test cleanup and fixes
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
@@ -1,38 +1,67 @@
|
||||
import { randHash } from '../utils'
|
||||
const randUser = randHash()
|
||||
|
||||
describe('Card', function () {
|
||||
const board = 'TestBoard'
|
||||
const list = 'TestList'
|
||||
const password = 'pass123'
|
||||
const testBoardData = {
|
||||
title: 'MyBoardTest',
|
||||
color: '00ff00',
|
||||
stacks: [
|
||||
{
|
||||
title: 'TestList',
|
||||
cards: [
|
||||
{
|
||||
title: 'Hello world',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
before(function () {
|
||||
cy.nextcloudCreateUser(randUser, password)
|
||||
cy.deckCreateBoard({ user: randUser, password }, board)
|
||||
cy.deckCreateList({ user: randUser, password }, list)
|
||||
})
|
||||
describe('Card', function() {
|
||||
before(function() {
|
||||
cy.nextcloudCreateUser(randUser, randUser)
|
||||
cy.createExampleBoard({
|
||||
user: randUser,
|
||||
password: randUser,
|
||||
board: testBoardData,
|
||||
})
|
||||
})
|
||||
|
||||
beforeEach(function () {
|
||||
cy.login(randUser, password)
|
||||
})
|
||||
beforeEach(function() {
|
||||
cy.login(randUser, randUser)
|
||||
})
|
||||
|
||||
it('Can add a card', function () {
|
||||
let card = 'Card 1'
|
||||
it('Can show card details modal', function() {
|
||||
cy.openLeftSidebar()
|
||||
cy.getNavigationEntry(testBoardData.title)
|
||||
.first().click({ force: true })
|
||||
|
||||
cy.openLeftSidebar()
|
||||
cy.get('#app-navigation-vue .app-navigation__list .app-navigation-entry')
|
||||
.eq(3).find('a.app-navigation-entry-link')
|
||||
.first().click({force: true})
|
||||
cy.get('.board .stack').eq(0).within(() => {
|
||||
cy.get('.card:contains("Hello world")').should('be.visible').click()
|
||||
})
|
||||
|
||||
cy.get('.board .stack').eq(0).within(() => {
|
||||
cy.get('button.action-item.action-item--single.icon-add')
|
||||
.first().click()
|
||||
cy.get('.modal__card').should('be.visible')
|
||||
cy.get('.app-sidebar-header__maintitle').contains('Hello world')
|
||||
})
|
||||
|
||||
cy.get('.stack__card-add form input#new-stack-input-main')
|
||||
.type(card)
|
||||
cy.get('.stack__card-add form input[type=submit]')
|
||||
.first().click()
|
||||
cy.get('.card').first().contains(card).should('be.visible')
|
||||
})
|
||||
})
|
||||
})
|
||||
it('Can add a card', function() {
|
||||
const newCardTitle = 'Write some cypress tests'
|
||||
|
||||
cy.openLeftSidebar()
|
||||
cy.getNavigationEntry(testBoardData.title)
|
||||
.first().click({ force: true })
|
||||
|
||||
cy.get('.board .stack').eq(0).within(() => {
|
||||
cy.get('.card:contains("Hello world")').should('be.visible')
|
||||
|
||||
cy.get('.button-vue[aria-label*="Add card"]')
|
||||
.first().click()
|
||||
|
||||
cy.get('.stack__card-add form input#new-stack-input-main')
|
||||
.type(newCardTitle)
|
||||
cy.get('.stack__card-add form input[type=submit]')
|
||||
.first().click()
|
||||
cy.get(`.card:contains("${newCardTitle}")`).should('be.visible')
|
||||
})
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user