fix: solve merge conflicts
Signed-off-by: Luka Trovic <luka@nextcloud.com>
This commit is contained in:
@@ -1,12 +0,0 @@
|
||||
describe('Files default view', function() {
|
||||
beforeEach(function() {
|
||||
cy.login('admin', 'admin')
|
||||
})
|
||||
|
||||
it('See the board title', function() {
|
||||
cy.get('.board-title h2')
|
||||
.should('have.length', 1)
|
||||
.first()
|
||||
.should('have.text', 'Upcoming cards')
|
||||
})
|
||||
})
|
||||
45
cypress/integration/deckDashboard.js
Normal file
45
cypress/integration/deckDashboard.js
Normal file
@@ -0,0 +1,45 @@
|
||||
import { randHash } from '../utils'
|
||||
const randUser = randHash()
|
||||
|
||||
describe('Deck dashboard', function() {
|
||||
before(function () {
|
||||
// Create a user
|
||||
cy.nextcloudCreateUser(randUser, 'pass123')
|
||||
})
|
||||
|
||||
beforeEach(function() {
|
||||
cy.login(randUser, 'pass123')
|
||||
})
|
||||
|
||||
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 () {
|
||||
cy.get('.app-navigation button.app-navigation-toggle')
|
||||
.click()
|
||||
|
||||
cy.get('.app-navigation__list .app-navigation-entry__children .app-navigation-entry')
|
||||
.first()
|
||||
.contains('Personal')
|
||||
}) */
|
||||
|
||||
it('Can create a board', function () {
|
||||
cy.get('#app-navigation-vue .app-navigation__list .app-navigation-entry')
|
||||
.eq(1)
|
||||
.find('a')
|
||||
.first()
|
||||
.click({force: true})
|
||||
|
||||
cy.get('.board-create form input[type=text]')
|
||||
.type('Test', {force: true})
|
||||
|
||||
cy.get('.board-create form input[type=submit]')
|
||||
.first()
|
||||
.click({force: true})
|
||||
|
||||
})
|
||||
})
|
||||
@@ -1,28 +1,24 @@
|
||||
// ***********************************************
|
||||
// This example commands.js shows you how to
|
||||
// create various custom commands and overwrite
|
||||
// existing commands.
|
||||
//
|
||||
// For more comprehensive examples of custom
|
||||
// commands please read more here:
|
||||
// https://on.cypress.io/custom-commands
|
||||
// ***********************************************
|
||||
//
|
||||
//
|
||||
// -- This is a parent command --
|
||||
// Cypress.Commands.add('login', (email, password) => { ... })
|
||||
//
|
||||
//
|
||||
// -- This is a child command --
|
||||
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
|
||||
//
|
||||
//
|
||||
// -- This is a dual command --
|
||||
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
|
||||
//
|
||||
//
|
||||
// -- This will overwrite an existing command --
|
||||
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
|
||||
/**
|
||||
* @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>
|
||||
*
|
||||
* @author John Molakvoæ <skjnldsv@protonmail.com>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
const url = Cypress.config('baseUrl').replace(/\/index.php\/?$/g, '')
|
||||
Cypress.env('baseUrl', url)
|
||||
@@ -38,3 +34,45 @@ Cypress.Commands.add('login', (user, password, route = '/apps/deck/') => {
|
||||
// in case the session already existed but we are on a different route...
|
||||
cy.visit(route)
|
||||
})
|
||||
|
||||
Cypress.Commands.add('logout', (route = '/') => {
|
||||
cy.session('_guest', function () {
|
||||
})
|
||||
})
|
||||
|
||||
Cypress.Commands.add('nextcloudCreateUser', (user, password) => {
|
||||
cy.clearCookies()
|
||||
cy.request({
|
||||
method: 'POST',
|
||||
url: `${Cypress.env('baseUrl')}/ocs/v1.php/cloud/users?format=json`,
|
||||
form: true,
|
||||
body: {
|
||||
userid: user,
|
||||
password: password
|
||||
},
|
||||
auth: { user: 'admin', pass: 'admin' },
|
||||
headers: {
|
||||
'OCS-ApiRequest': 'true',
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
}
|
||||
}).then(response => {
|
||||
cy.log(`Created user ${user}`, response.status)
|
||||
})
|
||||
})
|
||||
|
||||
Cypress.Commands.add('nextcloudUpdateUser', (user, password, key, value) => {
|
||||
cy.request({
|
||||
method: 'PUT',
|
||||
url: `${Cypress.env('baseUrl')}/ocs/v2.php/cloud/users/${user}`,
|
||||
form: true,
|
||||
body: { key, value },
|
||||
auth: { user, pass: password },
|
||||
headers: {
|
||||
'OCS-ApiRequest': 'true',
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
}
|
||||
}).then(response => {
|
||||
cy.log(`Updated user ${user} ${key} to ${value}`, response.status)
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
1
cypress/utils/index.js
Normal file
1
cypress/utils/index.js
Normal file
@@ -0,0 +1 @@
|
||||
export const randHash = () => Math.random().toString(36).replace(/[^a-z]+/g, '').slice(0, 10)
|
||||
2869
package-lock.json
generated
2869
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user