chore(testing): cleanup e2e for CE (#4349)

pull/4358/head
itsconquest 2020-09-29 11:01:49 +13:00 committed by GitHub
parent e479e41aee
commit a4fa44f831
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 1 additions and 81 deletions

View File

@ -1,40 +0,0 @@
context('Standard RBAC tests against docker standalone', () => {
before(() => {
cy.visit('/');
});
after(() => {});
describe('Validate endpoint admin functionality', function () {
beforeEach(() => {
cy.visit('/');
cy.auth('frontend', 'admin', 'portainer');
});
afterEach(() => {
// Cleanup remaining users and teams
cy.deleteUsers();
cy.deleteTeams();
// Clean Tokens
cy.clearUserTokens();
});
it('User assigned as endpoint-admin against an endpoint', function () {
// Create and assign user as the administrator
cy.createUser('frontend', 'adam', 'portainer');
cy.assignAccess('local', 'adam', 'user');
cy.clearBrowserToken();
// Login and create, read, update, delete resources as user
cy.visit('/');
cy.auth('frontend', 'adam', 'portainer');
cy.selectEndpoint('local');
// create resources
cy.modifyResources('frontend', 'create');
// modify resources
// delete resources
cy.modifyResources('frontend', 'delete');
});
});
});

View File

@ -1,40 +0,0 @@
context('Standard RBAC tests against docker swarm', () => {
before(() => {
cy.visit('/');
});
after(() => {});
describe('Validate endpoint admin functionality', function () {
beforeEach(() => {
cy.visit('/');
cy.auth('frontend', 'admin', 'portainer');
});
afterEach(() => {
// Cleanup remaining users and teams
cy.deleteUsers();
cy.deleteTeams();
// Clean Tokens
cy.clearUserTokens();
});
it('User assigned as endpoint-admin against an endpoint', function () {
// Create and assign user as the administrator
cy.createUser('frontend', 'adam', 'portainer');
cy.assignAccess('swarm', 'adam', 'user');
cy.clearBrowserToken();
// Login and create, read, update, delete resources as user
cy.visit('/');
cy.auth('frontend', 'adam', 'portainer');
cy.selectEndpoint('swarm');
// create resources
cy.modifyResources('frontend', 'create');
// modify resources
// delete resources
cy.modifyResources('frontend', 'delete');
});
});
});

View File

@ -564,7 +564,7 @@ Cypress.Commands.add('modifyResources', (location, action) => {
}
});
Cypress.Commands.add('clickLink', () => {
Cypress.Commands.add('clickLink', (label) => {
cy.waitUntil(() => cy.contains('a', label)).click();
});