Skip to content

Commit 3891981

Browse files
author
Eduard Brehm
committed
Add and delete entities
1 parent bbf75fa commit 3891981

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

conf.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@
4141
"views": {
4242
"user": {
4343
"path": "/entity/:id/user"
44+
},
45+
"addUser": {
46+
"path": "/add/user"
4447
}
4548
}
4649
}

cypress/integration/agile-ui.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,39 @@ describe('User view privileges', () => {
3737
cy.wait(3000) //Let react load all state objects
3838
})
3939

40+
it('Create and delete entities', () => {
41+
cy.get('#navigation').get('button').then(tabs => {
42+
var workingtab = conf.tabs.userlist
43+
tabs[workingtab.index].click()
44+
cy.get('#cypress-agile-local').should('not.exist')
45+
})
46+
cy.get('#navigation').get('button').then(tabs => {
47+
var workingtab = conf.tabs.userlist
48+
tabs[workingtab.index].click()
49+
var regex = new RegExp(workingtab.path.replace(/:[a-zA-Z]*/, '.*'))
50+
cy.url().should('match', regex)
51+
cy.wait(1500)
52+
cy.get('.container--app').get('a').then(viewbuttons => {
53+
viewbuttons[viewbuttons.length - 1].click()
54+
cy.location('pathname').should('eq', conf.views.addUser.path)
55+
cy.get('#root_user_name').type('cypress')
56+
cy.get('#root_auth_type').select('agile-local')
57+
cy.get('#root_password').type('secret')
58+
cy.get('#root_role').select('admin')
59+
cy.get('button[type="submit"]').click()
60+
cy.wait(3000)
61+
})
62+
})
63+
cy.get('#navigation').get('button').then(tabs => {
64+
var workingtab = conf.tabs.userlist
65+
tabs[workingtab.index].click()
66+
cy.get('#cypress-agile-local').should('exist')
67+
cy.get('#delete_cypress-agile-local').click()
68+
cy.wait(3000)
69+
cy.get('#cypress-agile-local').should('not.exist')
70+
})
71+
})
72+
4073
it('Add and update attribute to own user entity and delete it', () => {
4174
cy.get('#navigation').get('button').then(tabs => {
4275
var workingtab = conf.tabs.profile

0 commit comments

Comments
 (0)