|
| 1 | +describe('Test page access', () => { |
| 2 | + it('Admin can access admin pages', () => { |
| 3 | + cy.login('admin@mail.com', 'admin'); |
| 4 | + cy.waitForReact(2000, '#root'); |
| 5 | + cy.visit('http://localhost:3000'); |
| 6 | + cy.wait(50).contains('Security'); |
| 7 | + cy.wait(50).contains('Data Management'); |
| 8 | + cy.wait(50).contains('Administration'); |
| 9 | + cy.wait(50).contains('Tenants'); |
| 10 | + cy.get('[href="/Tenant"] > .MuiButtonBase-root > .MuiListItemText-root > .MuiTypography-root').click(); |
| 11 | + cy.wait(50) |
| 12 | + .get( |
| 13 | + '[style="opacity: 1; transform: none; transform-origin: 0px 0px 0px; transition: opacity 0ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, transform 0ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;"] > .css-1jq2n4l > .MuiCardHeader-root > .MuiCardHeader-content > .MuiCardHeader-title' |
| 14 | + ) |
| 15 | + .should('have.text', 'Tenant1'); |
| 16 | + /* ==== End Cypress Studio ==== */ |
| 17 | + }); |
| 18 | + it('User1 cannot access Admin pages', () => { |
| 19 | + cy.login('user1@mail.com', 'user1'); |
| 20 | + cy.waitForReact(2000, '#root'); |
| 21 | + cy.visit('http://localhost:3000'); |
| 22 | + cy.wait(500).contains('Security'); |
| 23 | + cy.wait(500).contains('Data Management'); |
| 24 | + cy.visit('http://localhost:3000/Tenant'); |
| 25 | + cy.wait(500).contains('403'); |
| 26 | + cy.visit('http://localhost:3000/Service'); |
| 27 | + cy.wait(500).contains('403'); |
| 28 | + cy.visit('http://localhost:3000/ResourceType'); |
| 29 | + cy.wait(500).contains('403'); |
| 30 | + }); |
| 31 | + it('Not existing pages causes 404', () => { |
| 32 | + cy.login('admin@mail.com', 'admin'); |
| 33 | + cy.waitForReact(2000, '#root'); |
| 34 | + cy.visit('http://localhost:3000/myPage'); |
| 35 | + cy.wait(500).contains('404'); |
| 36 | + /* ==== End Cypress Studio ==== */ |
| 37 | + }); |
| 38 | +}); |
| 39 | + |
| 40 | +describe('Test Tenants', () => { |
| 41 | + //TODO |
| 42 | +}); |
| 43 | + |
| 44 | +describe('Test Services', () => { |
| 45 | + //TODO |
| 46 | +}); |
| 47 | + |
| 48 | +describe('Test Policies', () => { |
| 49 | + //TODO |
| 50 | +}); |
| 51 | + |
| 52 | +describe('Test Resource Type', () => { |
| 53 | + //TODO |
| 54 | +}); |
| 55 | + |
| 56 | +describe('Test Toolbar', () => { |
| 57 | + it('Change Tenant', () => { |
| 58 | + cy.login('admin@mail.com', 'admin'); |
| 59 | + /* ==== Generated with Cypress Studio ==== */ |
| 60 | + cy.visit('http://localhost:3000'); |
| 61 | + cy.waitForReact(2000, '#root'); |
| 62 | + //TODO |
| 63 | + /* ==== End Cypress Studio ==== */ |
| 64 | + }); |
| 65 | + it('Change Language', () => { |
| 66 | + cy.login('user1@mail.com', 'user1'); |
| 67 | + /* ==== Generated with Cypress Studio ==== */ |
| 68 | + cy.visit('http://localhost:3000'); |
| 69 | + cy.waitForReact(2000, '#root'); |
| 70 | + //TODO |
| 71 | + /* ==== End Cypress Studio ==== */ |
| 72 | + }); |
| 73 | +}); |
0 commit comments