Skip to content

Commit

Permalink
fix(permission_spec): add more guards
Browse files Browse the repository at this point in the history
see  #397
the spec currently fails in headless mode but passes in headed mode

see #513
  • Loading branch information
duncdrum committed Sep 14, 2021
1 parent 219e91e commit 2c2e723
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions cypress/integration/06_permission_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,24 @@ context('Permission Manager', () => {
.click()
})

// (DP)) we need frequent assertions to work around the fact that the tree collapes on new requests
// see #513 #397
it('should have user entries', () => {
cy.get('[node-id$=security]')
.click()
cy.get('.ReactVirtualized__Grid')
.contains('Users')
.click()
cy.get('[node-id$=user\\/guest]')
.should('be.visible')
.click()
.then(() => {
cy.get('[node-id$=security\\/user]')
.should('be.visible')
.click()
.then(() => {
cy.get(`[node-id=${CSS.escape('admin@' + Cypress.env('API_HOST'))}]`)
.should('be.visible')
.click()
cy.get('[node-id$=user\\/guest]')
.should('be.visible')
})
})
})

it('should have group entries', () => {
Expand All @@ -30,6 +40,7 @@ context('Permission Manager', () => {
describe('the user item', () => {
it('should let us create a new user', () => {
cy.get('[node-id$=security]')
.should('be.visible')
.rightclick()
cy.get('[data-command="fusion.add-user"]')
.contains('Add')
Expand All @@ -53,6 +64,7 @@ context('Permission Manager', () => {

it('should display user properties card', () => {
cy.get('[node-id$=user\\/guest]')
.should('be.visible')
.rightclick()
cy.get('.p-Menu > ul > .p-Menu-item')
.should('be.visible')
Expand All @@ -79,6 +91,7 @@ context('Permission Manager', () => {

it('should let us delete a user', () => {
cy.get('[node-id$=user\\/cy-usr]')
.should('be.visible')
.rightclick()
cy.get('[data-command="fusion.delete-user"]')
.click()
Expand All @@ -94,6 +107,7 @@ context('Permission Manager', () => {
describe('the groups item', () => {
it('should let us create a new group', () => {
cy.get('[node-id$=security]')
.should('be.visible')
.rightclick()
cy.get('[data-command="fusion.add-group"]')
.contains('Add')
Expand All @@ -107,6 +121,7 @@ context('Permission Manager', () => {

it('should display group properties card', () => {
cy.get('[node-id$=group\\/guest]')
.should('be.visible')
.rightclick()
cy.get('.p-Menu > ul > .p-Menu-item')
.should('be.visible')
Expand All @@ -129,6 +144,7 @@ context('Permission Manager', () => {

it('should let us delete a group', () => {
cy.get('[node-id$=group\\/cy-group]')
.should('be.visible')
.rightclick()
cy.get('[data-command="fusion.delete-group"]')
.click()
Expand Down

0 comments on commit 2c2e723

Please sign in to comment.