Adapt cypress config and file names
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
41
cypress/e2e/boardFeatures.js
Normal file
41
cypress/e2e/boardFeatures.js
Normal file
@@ -0,0 +1,41 @@
|
||||
import { randHash } from "../utils"
|
||||
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 () {
|
||||
let 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})
|
||||
|
||||
// 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')
|
||||
})
|
||||
})
|
||||
38
cypress/e2e/cardFeatures.js
Normal file
38
cypress/e2e/cardFeatures.js
Normal file
@@ -0,0 +1,38 @@
|
||||
import { randHash } from '../utils'
|
||||
const randUser = randHash()
|
||||
|
||||
describe('Card', function () {
|
||||
const board = 'TestBoard'
|
||||
const list = 'TestList'
|
||||
const password = 'pass123'
|
||||
|
||||
before(function () {
|
||||
cy.nextcloudCreateUser(randUser, password)
|
||||
cy.deckCreateBoard({ user: randUser, password }, board)
|
||||
cy.deckCreateList({ user: randUser, password }, list)
|
||||
})
|
||||
|
||||
beforeEach(function () {
|
||||
cy.login(randUser, password)
|
||||
})
|
||||
|
||||
it('Can add a card', function () {
|
||||
let card = 'Card 1'
|
||||
|
||||
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('button.action-item.action-item--single.icon-add')
|
||||
.first().click()
|
||||
|
||||
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')
|
||||
})
|
||||
})
|
||||
})
|
||||
32
cypress/e2e/deckDashboard.js
Normal file
32
cypress/e2e/deckDashboard.js
Normal file
@@ -0,0 +1,32 @@
|
||||
import { randHash } from '../utils'
|
||||
const randUser = randHash()
|
||||
|
||||
describe('Deck dashboard', function() {
|
||||
const password = 'pass123'
|
||||
|
||||
before(function () {
|
||||
cy.nextcloudCreateUser(randUser, password)
|
||||
})
|
||||
|
||||
beforeEach(function() {
|
||||
cy.login(randUser, password)
|
||||
})
|
||||
|
||||
it('Can show the right title on the dashboard', function() {
|
||||
cy.get('.board-title h2')
|
||||
.should('have.length', 1).first()
|
||||
.should('have.text', 'Upcoming cards')
|
||||
})
|
||||
|
||||
it('Can see the default "Personal Board" created for user by default', function () {
|
||||
const defaultBoard = 'Personal'
|
||||
|
||||
cy.openLeftSidebar()
|
||||
cy.get('.app-navigation__list .app-navigation-entry')
|
||||
.eq(1)
|
||||
.find('ul.app-navigation-entry__children li.app-navigation-entry')
|
||||
.first()
|
||||
.contains(defaultBoard)
|
||||
.should('be.visible')
|
||||
})
|
||||
})
|
||||
33
cypress/e2e/stackFeatures.js
Normal file
33
cypress/e2e/stackFeatures.js
Normal file
@@ -0,0 +1,33 @@
|
||||
import { randHash } from "../utils";
|
||||
const randUser = randHash();
|
||||
|
||||
describe("Stack", function () {
|
||||
const board = "TestBoard";
|
||||
const password = "pass123";
|
||||
const stack = "List 1";
|
||||
|
||||
before(function () {
|
||||
cy.nextcloudCreateUser(randUser, password)
|
||||
cy.deckCreateBoard({ user: randUser, password }, board)
|
||||
})
|
||||
|
||||
beforeEach(function () {
|
||||
cy.logout()
|
||||
cy.login(randUser, password)
|
||||
})
|
||||
|
||||
it("Can create a stack", function () {
|
||||
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("#stack-add button").first().click()
|
||||
cy.get("#stack-add form input#new-stack-input-main").type(stack)
|
||||
cy.get("#stack-add form input[type=submit]").first().click()
|
||||
|
||||
cy.get(".board .stack").eq(0).contains(stack).should("be.visible")
|
||||
})
|
||||
});
|
||||
Reference in New Issue
Block a user