cy.login();
// Need pool for image testing
pools.navigateTo('create');
- pools.create(poolName, 8, 'rbd');
+ pools.create(poolName, 8, ['rbd']);
pools.existTableCell(poolName);
});
cy.ceph2Login();
cy.login();
pools.navigateTo('create');
- pools.create(poolName, 8, 'rbd');
+ pools.create(poolName, 8, ['rbd']);
pools.navigateTo();
pools.existTableCell(poolName, true);
mirroring.navigateTo();
// so writing the code to copy the token inside the origin manually
// rather than using a function call
// @ts-ignore
+ cy.ceph2Login();
cy.origin(url, { args }, ({ name, bootstrapToken }) => {
// Create an rbd pool in the second cluster
+ cy.visit('#/pool/create').wait(100);
// Login to the second cluster
// Somehow its not working with the cypress login function
- cy.visit('#/pool/create').wait(100);
-
cy.get('[name=username]').type('admin');
cy.get('#password').type('admin');
cy.get('[type=submit]').click();
+
cy.get('input[name=name]').clear().type(name);
cy.get(`select[name=poolType]`).select('replicated');
cy.get(`select[name=poolType] option:checked`).contains('replicated');
beforeEach(() => {
pools.navigateTo('create'); // Need pool for mirroring testing
- pools.create(poolName, 8, 'rbd');
+ pools.create(poolName, 8, ['rbd']);
pools.navigateTo();
pools.existTableCell(poolName, true);
});
describe('audit logs respond to pool creation and deletion test', () => {
it('should create pool and check audit logs reacted', () => {
pools.navigateTo('create');
- pools.create(poolname, 8, 'rbd');
+ pools.create(poolname, 8, ['rbd']);
pools.navigateTo();
pools.existTableCell(poolname, true);
logs.checkAuditForPoolFunction(poolname, 'create', hour, minute);
});
describe('Create, update and destroy', () => {
- it('should create a pool with mirroring enabled', () => {
+ it('should create a pool', () => {
pools.existTableCell(poolName, false);
pools.navigateTo('create');
- pools.create(poolName, 8, 'rbd');
+ pools.create(poolName, 8, ['rbd']);
pools.existTableCell(poolName);
});
- it('should edit a pools placement group and check if mirroring is enabled', () => {
+ it('should edit a pools placement group', () => {
pools.existTableCell(poolName);
pools.edit_pool_pg(poolName, 32);
});
pools.delete(poolName);
});
});
+
+ describe('Pool with mirroring', () => {
+ it('should create a pool with mirroring enabled', () => {
+ pools.existTableCell(poolName, false);
+ pools.navigateTo('create');
+ pools.create(poolName, 8, ['rbd'], true);
+ pools.existTableCell(poolName);
+ });
+
+ it('should edit a pools placement group with mirroring enabled', () => {
+ pools.existTableCell(poolName);
+ pools.edit_pool_pg(poolName, 32, true, true);
+ });
+
+ it('should delete the pool', () => {
+ pools.delete(poolName);
+ });
+ })
});
}
@PageHelper.restrictTo(pages.create.url)
- create(name: string, placement_groups: number, ...apps: string[]) {
+ create(name: string, placement_groups: number, apps: string[], mirroring = false) {
cy.get('input[name=name]').clear().type(name);
this.isPowerOf2(placement_groups);
this.selectOption('pgAutoscaleMode', 'off'); // To show pgNum field
cy.get('input[name=pgNum]').clear().type(`${placement_groups}`);
this.setApplications(apps);
- cy.get('#rbdMirroring').check({ force: true });
+ if (mirroring) {
+ cy.get('#rbdMirroring').check({ force: true });
+ }
cy.get('cd-submit-button').click();
}
- edit_pool_pg(name: string, new_pg: number, wait = true) {
+ edit_pool_pg(name: string, new_pg: number, wait = true, mirroring=false) {
this.isPowerOf2(new_pg);
this.navigateEdit(name);
- cy.get('#rbdMirroring').should('be.checked');
+ if (mirroring) {
+ cy.get('#rbdMirroring').should('be.checked');
+ }
cy.get('input[name=pgNum]').clear().type(`${new_pg}`);
cy.get('cd-submit-button').click();
}
getAllLanguages() {
- return cy.get('cd-language-selector cds-header-menu');
+ return cy.get('cd-language-selector cds-header-menu cds-header-item');
}
}
before(() => {
cy.login();
pools.navigateTo('create');
- pools.create(poolName, 8, 'rbd');
+ pools.create(poolName, 8, ['rbd']);
pools.edit_pool_pg(poolName, 4, false);
});
window.localStorage.setItem('user_pwd_expiration_date', auth.pwdExpirationDate);
window.localStorage.setItem('user_pwd_update_required', auth.pwdUpdateRequired);
window.localStorage.setItem('sso', auth.sso);
+ window.localStorage.setItem('telemetry_notification_hidden', 'true'); // disable telemetry notification in e2e
};
Cypress.Commands.add('login', (username, password) => {
window.localStorage.setItem('user_pwd_expiration_date', pwdExpirationDate);
window.localStorage.setItem('user_pwd_update_required', pwdUpdateRequired);
window.localStorage.setItem('sso', sso);
+ window.localStorage.setItem('telemetry_notification_hidden', 'true'); // disable telemetry notification in e2e
}
);
});