});
it('should open and show breadcrumb', async () => {
- expect(await images.getBreadcrumbText()).toEqual('Images');
+ await expect(images.getBreadcrumbText()).toEqual('Images');
});
it('should show three tabs', async () => {
- expect(await images.getTabsCount()).toEqual(3);
+ await expect(images.getTabsCount()).toEqual(3);
});
it('should show text for all tabs', async () => {
- expect(await images.getTabText(0)).toEqual('Images');
- expect(await images.getTabText(1)).toEqual('Trash');
- expect(await images.getTabText(2)).toEqual('Overall Performance');
+ await expect(images.getTabText(0)).toEqual('Images');
+ await expect(images.getTabText(1)).toEqual('Trash');
+ await expect(images.getTabText(2)).toEqual('Overall Performance');
});
});
it('should create image', async () => {
await images.createImage(imageName, poolName, '1');
- expect(await images.getTableCell(imageName).isPresent()).toBe(true);
+ await expect(images.getTableCell(imageName).isPresent()).toBe(true);
});
it('should edit image', async () => {
await images.editImage(imageName, poolName, newImageName, '2');
- expect(await images.getTableCell(newImageName).isPresent()).toBe(true);
+ await expect(images.getTableCell(newImageName).isPresent()).toBe(true);
});
it('should delete image', async () => {
await images.deleteImage(newImageName);
- expect(await images.getTableCell(newImageName).isPresent()).toBe(false);
+ await expect(images.getTableCell(newImageName).isPresent()).toBe(false);
});
afterAll(async () => {
await element(by.id('pool')).click();
await element(by.cssContainingText('select[name=pool] option', pool)).click();
await $(getPoolName).click();
- expect(await element(by.id('pool')).getAttribute('class')).toContain('ng-valid'); // check if selected
+ await expect(element(by.id('pool')).getAttribute('class')).toContain('ng-valid'); // check if selected
// Enter in the size of the image
await element(by.id('size')).click();
await browser.wait(Helper.EC.elementToBeClickable(this.getTableCell(newName)), Helper.TIMEOUT);
// click edit button and wait to make sure new owner is present in table
await this.getTableCell(newName).click();
- expect(
- await element
+ await expect(
+ element
.all(by.css('.table.table-striped.table-bordered'))
.first()
.getText()
});
it('should open and show breadcrumb', async () => {
- expect(await iscsi.getBreadcrumbText()).toEqual('Overview');
+ await expect(iscsi.getBreadcrumbText()).toEqual('Overview');
});
});
it('should check that tables are displayed and legends are correct', async () => {
// Check tables are displayed
const dataTables = iscsi.getDataTables();
- expect(await dataTables.get(0).isDisplayed());
- expect(await dataTables.get(1).isDisplayed());
+ await expect(dataTables.get(0).isDisplayed());
+ await expect(dataTables.get(1).isDisplayed());
// Check that legends are correct
const legends = iscsi.getLegends();
- expect(await legends.get(0).getText()).toMatch('Gateways');
- expect(await legends.get(1).getText()).toMatch('Images');
+ await expect(legends.get(0).getText()).toMatch('Gateways');
+ await expect(legends.get(1).getText()).toMatch('Images');
});
});
});
});
it('should open and show breadcrumb', async () => {
- expect(await mirroring.getBreadcrumbText()).toEqual('Mirroring');
+ await expect(mirroring.getBreadcrumbText()).toEqual('Mirroring');
});
it('should show three tabs', async () => {
- expect(await mirroring.getTabsCount()).toEqual(3);
+ await expect(mirroring.getTabsCount()).toEqual(3);
});
it('should show text for all tabs', async () => {
- expect(await mirroring.getTabText(0)).toEqual('Issues');
- expect(await mirroring.getTabText(1)).toEqual('Syncing');
- expect(await mirroring.getTabText(2)).toEqual('Ready');
+ await expect(mirroring.getTabText(0)).toEqual('Issues');
+ await expect(mirroring.getTabText(1)).toEqual('Syncing');
+ await expect(mirroring.getTabText(2)).toEqual('Ready');
});
});
await mirroring.navigateTo();
await mirroring.editMirror(poolName, 'Pool');
- expect(await mirroring.getFirstTableCellWithText('pool').isPresent()).toBe(true);
+ await expect(mirroring.getFirstTableCellWithText('pool').isPresent()).toBe(true);
await mirroring.editMirror(poolName, 'Image');
- expect(await mirroring.getFirstTableCellWithText('image').isPresent()).toBe(true);
+ await expect(mirroring.getFirstTableCellWithText('image').isPresent()).toBe(true);
await mirroring.editMirror(poolName, 'Disabled');
- expect(await mirroring.getFirstTableCellWithText('disabled').isPresent()).toBe(true);
+ await expect(mirroring.getFirstTableCellWithText('disabled').isPresent()).toBe(true);
});
afterAll(async () => {
});
it('should open and show breadcrumb', async () => {
- expect(await alerts.getBreadcrumbText()).toEqual('Alerts');
+ await expect(alerts.getBreadcrumbText()).toEqual('Alerts');
});
});
});
});
it('should open and show breadcrumb', async () => {
- expect(await configuration.getBreadcrumbText()).toEqual('Configuration');
+ await expect(configuration.getBreadcrumbText()).toEqual('Configuration');
});
});
describe('edit configuration test', () => {
await this.getTableCell(name).click(); // click on the config to edit
await element(by.cssContainingText('button', 'Edit')).click(); // clicks button to edit
- expect(await this.getBreadcrumbText()).toEqual('Edit');
+ await expect(this.getBreadcrumbText()).toEqual('Edit');
for (let i = 0, valtuple; (valtuple = values[i]); i++) {
// Finds desired value based off given list
});
it('should open and show breadcrumb', async () => {
- expect(await crushmap.getBreadcrumbText()).toEqual('CRUSH map');
+ await expect(crushmap.getBreadcrumbText()).toEqual('CRUSH map');
});
});
describe('fields check', () => {
it('should check that title & table appears', async () => {
// Check that title (CRUSH map viewer) appears
- expect(await crushmap.getPageTitle()).toMatch('CRUSH map viewer');
+ await expect(crushmap.getPageTitle()).toMatch('CRUSH map viewer');
// Check that title appears once OSD is clicked
await crushmap.getCrushNode(1).click();
const label = await $('legend').getText(); // Get table label
- expect(await crushmap.getCrushNode(1).getText()).toEqual(label);
+ await expect(crushmap.getCrushNode(1).getText()).toEqual(label);
// Check that table appears once OSD is clicked
await browser.wait(Helper.EC.visibilityOf($('.datatable-body')));
- expect(await $('.datatable-body').isDisplayed()).toBe(true);
+ await expect($('.datatable-body').isDisplayed()).toBe(true);
});
});
});
});
it('should open and show breadcrumb', async () => {
- expect(await hosts.getBreadcrumbText()).toEqual('Hosts');
+ await expect(hosts.getBreadcrumbText()).toEqual('Hosts');
});
it('should show two tabs', async () => {
- expect(await hosts.getTabsCount()).toEqual(2);
+ await expect(hosts.getTabsCount()).toEqual(2);
});
it('should show hosts list tab at first', async () => {
- expect(await hosts.getTabText(0)).toEqual('Hosts List');
+ await expect(hosts.getTabText(0)).toEqual('Hosts List');
});
it('should show overall performance as a second tab', async () => {
- expect(await hosts.getTabText(1)).toEqual('Overall Performance');
+ await expect(hosts.getTabText(1)).toEqual('Overall Performance');
});
});
async check_for_host() {
await this.navigateTo();
- expect(await this.getTableTotalCount()).not.toBe(0);
+ await expect(this.getTableTotalCount()).not.toBe(0);
}
// function that checks all services links work for first
// check is any services links are present
const txt = await services.getText();
// check that text (links) is present in services box
- expect(txt.length).toBeGreaterThan(0, 'No services links exist on first host');
+ await expect(txt.length).toBeGreaterThan(0, 'No services links exist on first host');
if (txt.length === 0) {
return;
}
// click link, check it worked by looking for changed breadcrumb,
// navigate back to hosts page, repeat until all links checked
await links.get(i).click();
- expect(await this.getBreadcrumbText()).toEqual('Performance Counters');
+ await expect(this.getBreadcrumbText()).toEqual('Performance Counters');
await this.navigateTo();
- expect(await this.getBreadcrumbText()).toEqual('Hosts');
+ await expect(this.getBreadcrumbText()).toEqual('Hosts');
links_tested++;
}
// check if any links were actually tested
- expect(links_tested > 0).toBe(true, 'No links were tested. Test failed');
+ await expect(links_tested > 0).toBe(true, 'No links were tested. Test failed');
}
}
});
it('should open and show breadcrumb', async () => {
- expect(await logs.getBreadcrumbText()).toEqual('Logs');
+ await expect(logs.getBreadcrumbText()).toEqual('Logs');
});
it('should show two tabs', async () => {
- expect(await logs.getTabsCount()).toEqual(2);
+ await expect(logs.getTabsCount()).toEqual(2);
});
it('should show cluster logs tab at first', async () => {
- expect(await logs.getTabText(0)).toEqual('Cluster Logs');
+ await expect(logs.getTabText(0)).toEqual('Cluster Logs');
});
it('should show audit logs as a second tab', async () => {
- expect(await logs.getTabText(1)).toEqual('Audit Logs');
+ await expect(logs.getTabText(1)).toEqual('Audit Logs');
});
});
const audit_logs_body = audit_logs_tab.element(by.css('.card-body'));
const logs = audit_logs_body.all(by.cssContainingText('.ng-star-inserted', poolname));
- expect(await logs.getText()).toMatch(poolname);
- expect(await logs.getText()).toMatch(`pool ${poolfunction}`);
+ await expect(logs.getText()).toMatch(poolname);
+ await expect(logs.getText()).toMatch(`pool ${poolfunction}`);
}
async checkAuditForConfigChange(configname, setting, hour, minute) {
await browser.wait(Helper.EC.presenceOf(logs.first()), Helper.TIMEOUT);
- expect(await logs.getText()).toMatch(configname);
- expect(await logs.getText()).toMatch(setting);
+ await expect(logs.getText()).toMatch(configname);
+ await expect(logs.getText()).toMatch(setting);
}
}
});
it('should open and show breadcrumb', async () => {
- expect(await mgrmodules.getBreadcrumbText()).toEqual('Manager modules');
+ await expect(mgrmodules.getBreadcrumbText()).toEqual('Manager modules');
});
});
});
it('should open and show breadcrumb', async () => {
- expect(await monitors.getBreadcrumbText()).toEqual('Monitors');
+ await expect(monitors.getBreadcrumbText()).toEqual('Monitors');
});
});
it('should check status table is present', async () => {
// check for table header 'Status'
- expect(
- await monitors
+ await expect(
+ monitors
.getLegends()
.get(0)
.getText()
).toMatch('Status');
// check for fields in table
- expect(await monitors.getStatusTables().getText()).toMatch('Cluster ID');
- expect(await monitors.getStatusTables().getText()).toMatch('monmap modified');
- expect(await monitors.getStatusTables().getText()).toMatch('monmap epoch');
- expect(await monitors.getStatusTables().getText()).toMatch('quorum con');
- expect(await monitors.getStatusTables().getText()).toMatch('quorum mon');
- expect(await monitors.getStatusTables().getText()).toMatch('required con');
- expect(await monitors.getStatusTables().getText()).toMatch('required mon');
+ await expect(monitors.getStatusTables().getText()).toMatch('Cluster ID');
+ await expect(monitors.getStatusTables().getText()).toMatch('monmap modified');
+ await expect(monitors.getStatusTables().getText()).toMatch('monmap epoch');
+ await expect(monitors.getStatusTables().getText()).toMatch('quorum con');
+ await expect(monitors.getStatusTables().getText()).toMatch('quorum mon');
+ await expect(monitors.getStatusTables().getText()).toMatch('required con');
+ await expect(monitors.getStatusTables().getText()).toMatch('required mon');
});
it('should check In Quorum and Not In Quorum tables are present', async () => {
// check for there to be two tables
- expect(await monitors.getDataTables().count()).toEqual(2);
+ await expect(monitors.getDataTables().count()).toEqual(2);
// check for table header 'In Quorum'
- expect(
- await monitors
+ await expect(
+ monitors
.getLegends()
.get(1)
.getText()
).toMatch('In Quorum');
// check for table header 'Not In Quorum'
- expect(
- await monitors
+ await expect(
+ monitors
.getLegends()
.get(2)
.getText()
).toMatch('Not In Quorum');
// verify correct columns on In Quorum table
- expect(
- await monitors
+ await expect(
+ monitors
.getDataTableHeaders()
.get(0)
.getText()
).toMatch('Name');
- expect(
- await monitors
+ await expect(
+ monitors
.getDataTableHeaders()
.get(0)
.getText()
).toMatch('Rank');
- expect(
- await monitors
+ await expect(
+ monitors
.getDataTableHeaders()
.get(0)
.getText()
).toMatch('Public Address');
- expect(
- await monitors
+ await expect(
+ monitors
.getDataTableHeaders()
.get(0)
.getText()
).toMatch('Open Sessions');
// verify correct columns on Not In Quorum table
- expect(
- await monitors
+ await expect(
+ monitors
.getDataTableHeaders()
.get(1)
.getText()
).toMatch('Name');
- expect(
- await monitors
+ await expect(
+ monitors
.getDataTableHeaders()
.get(1)
.getText()
).toMatch('Rank');
- expect(
- await monitors
+ await expect(
+ monitors
.getDataTableHeaders()
.get(1)
.getText()
});
it('should open and show breadcrumb', async () => {
- expect(await osds.getBreadcrumbText()).toEqual('OSDs');
+ await expect(osds.getBreadcrumbText()).toEqual('OSDs');
});
it('should show two tabs', async () => {
- expect(await osds.getTabsCount()).toEqual(2);
+ await expect(osds.getTabsCount()).toEqual(2);
});
it('should show OSDs list tab at first', async () => {
- expect(await osds.getTabText(0)).toEqual('OSDs List');
+ await expect(osds.getTabText(0)).toEqual('OSDs List');
});
it('should show overall performance as a second tab', async () => {
- expect(await osds.getTabText(1)).toEqual('Overall Performance');
+ await expect(osds.getTabText(1)).toEqual('Overall Performance');
});
});
});
};
for (const [linkText, breadcrumbText] of Object.entries(expectationMap)) {
- expect(await browser.getCurrentUrl()).toContain('/#/dashboard');
+ await expect(browser.getCurrentUrl()).toContain('/#/dashboard');
await dashboard.clickInfoCardLink(linkText);
- expect(await dashboard.getBreadcrumbText()).toEqual(breadcrumbText);
+ await expect(dashboard.getBreadcrumbText()).toEqual(breadcrumbText);
await dashboard.navigateBack();
}
});
];
for (let i = 0; i < order.length; i++) {
- expect((await dashboard.infoCard(i)).getText()).toContain(
+ await expect((await dashboard.infoCard(i)).getText()).toContain(
order[i],
`Order of ${order[i]} seems to be wrong`
);
});
it('should verify that info card group titles are present and in the right order', async () => {
- expect(await browser.getCurrentUrl()).toContain('/#/dashboard');
- expect(await dashboard.infoGroupTitle(0)).toBe('Status');
- expect(await dashboard.infoGroupTitle(1)).toBe('Performance');
- expect(await dashboard.infoGroupTitle(2)).toBe('Capacity');
+ await expect(browser.getCurrentUrl()).toContain('/#/dashboard');
+ await expect(dashboard.infoGroupTitle(0)).toBe('Status');
+ await expect(dashboard.infoGroupTitle(1)).toBe('Performance');
+ await expect(dashboard.infoGroupTitle(2)).toBe('Capacity');
});
});
}
await spec.pageObject.navigateTo();
const tableCount = await spec.pageObject.getTableTotalCount();
- expect(dashCount).toBe(
+ await expect(dashCount).toBe(
tableCount,
`Text of card ${spec.cardName} and regex ${spec.regexMatcher} resulted in ${dashCount} ` +
`but did not match table count ${tableCount}`
});
it('should open and show breadcrumb', async () => {
- expect(await filesystems.getBreadcrumbText()).toEqual('Filesystems');
+ await expect(filesystems.getBreadcrumbText()).toEqual('Filesystems');
});
});
});
console.log('\n log: ' + require('util').inspect(browserLog));
}
- expect(browserLog.length).toEqual(0);
+ await expect(browserLog.length).toEqual(0);
}
}
});
it('should open and show breadcrumb', async () => {
- expect(await nfs.getBreadcrumbText()).toEqual('NFS');
+ await expect(nfs.getBreadcrumbText()).toEqual('NFS');
});
});
});
describe('breadcrumb and tab tests', () => {
it('should open and show breadcrumb', async () => {
- expect(await pools.getBreadcrumbText()).toEqual('Pools');
+ await expect(pools.getBreadcrumbText()).toEqual('Pools');
});
it('should show two tabs', async () => {
- expect(await pools.getTabsCount()).toEqual(2);
+ await expect(pools.getTabsCount()).toEqual(2);
});
it('should show pools list tab at first', async () => {
- expect(await pools.getTabText(0)).toEqual('Pools List');
+ await expect(pools.getTabText(0)).toEqual('Pools List');
});
it('should show overall performance as a second tab', async () => {
- expect(await pools.getTabText(1)).toEqual('Overall Performance');
+ await expect(pools.getTabText(1)).toEqual('Overall Performance');
});
});
await nameInput.sendKeys(name);
await element(by.cssContainingText('select[name=poolType] option', 'replicated')).click();
- expect(await element(by.css('select[name=poolType] option:checked')).getText()).toBe(
+ await expect(element(by.css('select[name=poolType] option:checked')).getText()).toBe(
' replicated '
);
await $('input[name=pgNum]').sendKeys(
const elem = await this.getTableCellByContent(name);
await elem.click(); // select pool from the table
await element(by.cssContainingText('button', 'Edit')).click(); // click edit button
- expect(await this.getBreadcrumbText()).toEqual('Edit'); // verify we are now on edit page
+ await expect(this.getBreadcrumbText()).toEqual('Edit'); // verify we are now on edit page
await $('input[name=pgNum]').sendKeys(protractor.Key.CONTROL, 'a', protractor.Key.NULL, new_pg);
await element(by.css('cd-submit-button')).click();
const str = `${new_pg} active+clean`;
it('should open and show breadcrumb', async () => {
await buckets.navigateTo();
- expect(await $('.breadcrumb-item.active').getText()).toBe('Buckets');
+ await expect($('.breadcrumb-item.active').getText()).toBe('Buckets');
});
it('should create bucket', async () => {
'0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef',
'default-placement'
);
- expect(await buckets.getTableCell('000test').isPresent()).toBe(true);
+ await expect(buckets.getTableCell('000test').isPresent()).toBe(true);
});
it('should edit bucket', async () => {
await buckets.navigateTo();
await buckets.edit('000test', 'dev');
- expect(await buckets.getTable().getText()).toMatch('dev');
+ await expect(buckets.getTable().getText()).toMatch('dev');
});
it('should delete bucket', async () => {
await buckets.navigateTo();
await buckets.delete('000test');
- expect(buckets.getTableCell('000test').isPresent()).toBe(false);
+ await expect(buckets.getTableCell('000test').isPresent()).toBe(false);
});
describe('Invalid Input in Create and Edit tests', () => {
// Select bucket owner
await element(by.id('owner')).click();
await element(by.cssContainingText('select[name=owner] option', owner)).click();
- expect(element(by.id('owner')).getAttribute('class')).toContain('ng-valid');
+ await expect(element(by.id('owner')).getAttribute('class')).toContain('ng-valid');
// Select bucket placement target:
await element(by.id('owner')).click();
await element(
by.cssContainingText('select[name=placement-target] option', placementTarget)
).click();
- expect(element(by.id('placement-target')).getAttribute('class')).toContain('ng-valid');
+ await expect(element(by.id('placement-target')).getAttribute('class')).toContain('ng-valid');
// Click the create button and wait for bucket to be made
const createButton = element(by.cssContainingText('button', 'Create Bucket'));
async edit(name: string, new_owner: string) {
await this.getTableCell(name).click(); // click on the bucket you want to edit in the table
await element(by.cssContainingText('button', 'Edit')).click(); // click button to move to edit page
- expect(await this.getBreadcrumbText()).toEqual('Edit');
- expect(element(by.css('input[name=placement-target]')).getAttribute('value')).toBe(
+ await expect(this.getBreadcrumbText()).toEqual('Edit');
+ await expect(element(by.css('input[name=placement-target]')).getAttribute('value')).toBe(
'default-placement'
);
await element(by.id('owner')).click(); // click owner dropdown menu
const element_details_table = element
.all(by.css('.table.table-striped.table-bordered'))
.first();
- expect(element_details_table.getText()).toMatch(new_owner);
+ await expect(element_details_table.getText()).toMatch(new_owner);
return promise;
}
);
// Check that name input field was marked invalid in the css
- expect(await nameInputField.getAttribute('class')).toContain('ng-invalid');
+ await expect(nameInputField.getAttribute('class')).toContain('ng-invalid');
// Check that error message was printed under name input field
- expect(await element(by.css('#bid + .invalid-feedback')).getText()).toMatch(
+ await expect(element(by.css('#bid + .invalid-feedback')).getText()).toMatch(
'The value is not valid.'
);
await nameInputField.click();
// Check that owner drop down field was marked invalid in the css
- expect(await element(by.id('owner')).getAttribute('class')).toContain('ng-invalid');
+ await expect(element(by.id('owner')).getAttribute('class')).toContain('ng-invalid');
// Check that error message was printed under owner drop down field
- expect(await element(by.css('#owner + .invalid-feedback')).getText()).toMatch(
+ await expect(element(by.css('#owner + .invalid-feedback')).getText()).toMatch(
'This field is required.'
);
by.cssContainingText('select[name=placement-target] option', 'Select a placement target')
).click();
await nameInputField.click(); // Trigger validation
- expect(await element(by.id('placement-target')).getAttribute('class')).toContain('ng-invalid');
- expect(await element(by.css('#placement-target + .invalid-feedback')).getText()).toMatch(
+ await expect(element(by.id('placement-target')).getAttribute('class')).toContain('ng-invalid');
+ await expect(element(by.css('#placement-target + .invalid-feedback')).getText()).toMatch(
'This field is required.'
);
// Clicks the Create Bucket button but the page doesn't move. Done by testing
// for the breadcrumb
await element(by.cssContainingText('button', 'Create Bucket')).click(); // Clicks Create Bucket button
- expect(await this.getBreadcrumbText()).toEqual('Create');
+ await expect(this.getBreadcrumbText()).toEqual('Create');
// content in fields seems to subsist through tests if not cleared, so it is cleared
await nameInputField.clear();
return element(by.cssContainingText('button', 'Cancel')).click();
await this.getTableCell(name).click(); // click on the bucket you want to edit in the table
await element(by.cssContainingText('button', 'Edit')).click(); // click button to move to edit page
- expect(await this.getBreadcrumbText()).toEqual('Edit');
+ await expect(this.getBreadcrumbText()).toEqual('Edit');
// Chooses 'Select a user' rather than a valid owner on Edit Bucket page
// and checks if it's an invalid input
await element(by.cssContainingText('button', 'Edit Bucket')).click();
// Check that owner drop down field was marked invalid in the css
- expect(await element(by.id('owner')).getAttribute('class')).toContain('ng-invalid');
+ await expect(element(by.id('owner')).getAttribute('class')).toContain('ng-invalid');
// Check that error message was printed under owner drop down field
- expect(await element(by.css('#owner + .invalid-feedback')).getText()).toMatch(
+ await expect(element(by.css('#owner + .invalid-feedback')).getText()).toMatch(
'This field is required.'
);
- expect(await this.getBreadcrumbText()).toEqual('Edit');
+ await expect(this.getBreadcrumbText()).toEqual('Edit');
}
}
});
it('should open and show breadcrumb', async () => {
- expect(await daemons.getBreadcrumbText()).toEqual('Daemons');
+ await expect(daemons.getBreadcrumbText()).toEqual('Daemons');
});
it('should show two tabs', async () => {
- expect(await daemons.getTabsCount()).toEqual(2);
+ await expect(daemons.getTabsCount()).toEqual(2);
});
it('should show daemons list tab at first', async () => {
- expect(await daemons.getTabText(0)).toEqual('Daemons List');
+ await expect(daemons.getTabText(0)).toEqual('Daemons List');
});
- it('should show overall performance as a second tab', () => {
- expect(daemons.getTabText(1)).toEqual('Overall Performance');
+ it('should show overall performance as a second tab', async () => {
+ await expect(daemons.getTabText(1)).toEqual('Overall Performance');
});
});
const performance_counters_table = tab_container.all(by.css('cd-table')).get(1);
// check details table is visible
- expect(await details_table.isDisplayed()).toBe(true);
+ await expect(details_table.isDisplayed()).toBe(true);
// check at least one field is present
- expect(await details_table.getText()).toMatch('ceph_version');
+ await expect(details_table.getText()).toMatch('ceph_version');
// check performance counters table is not currently visible
- expect(await performance_counters_table.isDisplayed()).toBe(false);
+ await expect(performance_counters_table.isDisplayed()).toBe(false);
// click on performance counters tab and check table is loaded
await element(by.cssContainingText('.nav-link', 'Performance Counters')).click();
- expect(await performance_counters_table.isDisplayed()).toBe(true);
+ await expect(performance_counters_table.isDisplayed()).toBe(true);
// check at least one field is present
- expect(await performance_counters_table.getText()).toMatch('objecter.op_r');
+ await expect(performance_counters_table.getText()).toMatch('objecter.op_r');
// check details table is not currently visible
- expect(await details_table.isDisplayed()).toBe(false);
+ await expect(details_table.isDisplayed()).toBe(false);
// click on performance details tab
await element(by.cssContainingText('.nav-link', 'Performance Details')).click();
// checks the other tabs' content isn't visible
- expect(await details_table.isDisplayed()).toBe(false);
- expect(await performance_counters_table.isDisplayed()).toBe(false);
+ await expect(details_table.isDisplayed()).toBe(false);
+ await expect(performance_counters_table.isDisplayed()).toBe(false);
// TODO: Expect Grafana iFrame
}
}
});
it('should open and show breadcrumb', async () => {
- expect(await users.getBreadcrumbText()).toEqual('Users');
+ await expect(users.getBreadcrumbText()).toEqual('Users');
});
});
it('should create user', async () => {
await users.create(user_name, 'Some Name', 'original@website.com', '1200');
- expect(await users.getTableCell(user_name).isPresent()).toBe(true);
+ await expect(users.getTableCell(user_name).isPresent()).toBe(true);
});
it('should edit users full name, email and max buckets', async () => {
it('should delete user', async () => {
await users.delete(user_name);
- expect(await users.getTableCell(user_name).isPresent()).toBe(false);
+ await expect(users.getTableCell(user_name).isPresent()).toBe(false);
});
});
await this.getTableCell(name).click(); // click on the bucket you want to edit in the table
await element(by.cssContainingText('button', 'Edit')).click(); // click button to move to edit page
- expect(await this.getBreadcrumbText()).toEqual('Edit');
+ await expect(this.getBreadcrumbText()).toEqual('Edit');
// Change the full name field
await element(by.id('display_name')).click();
await browser.wait(Helper.EC.elementToBeClickable(this.getTableCell(name)), 10000);
// Click the user and check its details table for updated content
await this.getTableCell(name).click();
- expect(await $('.active.tab-pane').getText()).toMatch(new_fullname); // check full name was changed
- expect(await $('.active.tab-pane').getText()).toMatch(new_email); // check email was changed
- expect(await $('.active.tab-pane').getText()).toMatch(new_maxbuckets); // check max buckets was changed
+ await expect($('.active.tab-pane').getText()).toMatch(new_fullname); // check full name was changed
+ await expect($('.active.tab-pane').getText()).toMatch(new_email); // check email was changed
+ await expect($('.active.tab-pane').getText()).toMatch(new_maxbuckets); // check max buckets was changed
}
async delete(name) {
const username_field = element(by.id('uid'));
// No username had been entered. Field should be invalid
- expect(await username_field.getAttribute('class')).toContain('ng-invalid');
+ await expect(username_field.getAttribute('class')).toContain('ng-invalid');
// Try to give user already taken name. Should make field invalid.
await username_field.clear();
async () => !(await username_field.getAttribute('class')).includes('ng-pending'),
6000
);
- expect(await username_field.getAttribute('class')).toContain('ng-invalid');
+ await expect(username_field.getAttribute('class')).toContain('ng-invalid');
await element(by.id('display_name')).click(); // trigger validation check
- expect(await element(by.css('#uid + .invalid-feedback')).getText()).toMatch(
+ await expect(element(by.css('#uid + .invalid-feedback')).getText()).toMatch(
'The chosen user ID is already in use.'
);
for (let i = 0; i < uname.length; i++) {
await username_field.sendKeys(protractor.Key.BACK_SPACE);
}
- expect(await username_field.getAttribute('class')).toContain('ng-invalid');
+ await expect(username_field.getAttribute('class')).toContain('ng-invalid');
await element(by.id('display_name')).click(); // trigger validation check
- expect(await element(by.css('#uid + .invalid-feedback')).getText()).toMatch(
+ await expect(element(by.css('#uid + .invalid-feedback')).getText()).toMatch(
'This field is required.'
);
// No display name has been given so field should be invalid
- expect(await element(by.id('display_name')).getAttribute('class')).toContain('ng-invalid');
+ await expect(element(by.id('display_name')).getAttribute('class')).toContain('ng-invalid');
// display name field should also be marked invalid if given input then emptied
await element(by.id('display_name')).click();
await element(by.id('display_name')).sendKeys('a');
await element(by.id('display_name')).sendKeys(protractor.Key.BACK_SPACE);
- expect(await element(by.id('display_name')).getAttribute('class')).toContain('ng-invalid');
+ await expect(element(by.id('display_name')).getAttribute('class')).toContain('ng-invalid');
await username_field.click(); // trigger validation check
- expect(await element(by.css('#display_name + .invalid-feedback')).getText()).toMatch(
+ await expect(element(by.css('#display_name + .invalid-feedback')).getText()).toMatch(
'This field is required.'
);
// put invalid email to make field invalid
await element(by.id('email')).click();
await element(by.id('email')).sendKeys('a');
- expect(await element(by.id('email')).getAttribute('class')).toContain('ng-invalid');
+ await expect(element(by.id('email')).getAttribute('class')).toContain('ng-invalid');
await username_field.click(); // trigger validation check
- expect(await element(by.css('#email + .invalid-feedback')).getText()).toMatch(
+ await expect(element(by.css('#email + .invalid-feedback')).getText()).toMatch(
'This is not a valid email address.'
);
await element(by.id('max_buckets')).click();
await element(by.id('max_buckets')).clear();
await element(by.id('max_buckets')).sendKeys('-5');
- expect(await element(by.id('max_buckets')).getAttribute('class')).toContain('ng-invalid');
+ await expect(element(by.id('max_buckets')).getAttribute('class')).toContain('ng-invalid');
await username_field.click(); // trigger validation check
- expect(await element(by.css('#max_buckets + .invalid-feedback')).getText()).toMatch(
+ await expect(element(by.css('#max_buckets + .invalid-feedback')).getText()).toMatch(
'The entered value must be >= 0.'
);
await this.getTableCell(uname).click(); // click on the bucket you want to edit in the table
await element(by.cssContainingText('button', 'Edit')).click(); // click button to move to edit page
- expect(await this.getBreadcrumbText()).toEqual('Edit');
+ await expect(this.getBreadcrumbText()).toEqual('Edit');
// put invalid email to make field invalid
await element(by.id('email')).click();
async () => !(await element(by.id('email')).getAttribute('class')).includes('ng-pending'),
6000
);
- expect(await element(by.id('email')).getAttribute('class')).toContain('ng-invalid');
+ await expect(element(by.id('email')).getAttribute('class')).toContain('ng-invalid');
await element(by.id('display_name')).click(); // trigger validation check
- expect(await element(by.css('#email + .invalid-feedback')).getText()).toMatch(
+ await expect(element(by.css('#email + .invalid-feedback')).getText()).toMatch(
'This is not a valid email address.'
);
for (let i = 0; i < 3; i++) {
await element(by.id('display_name')).sendKeys(protractor.Key.BACK_SPACE);
}
- expect(await element(by.id('display_name')).getAttribute('class')).toContain('ng-invalid');
+ await expect(element(by.id('display_name')).getAttribute('class')).toContain('ng-invalid');
await element(by.id('email')).click(); // trigger validation check
- expect(await element(by.css('#display_name + .invalid-feedback')).getText()).toMatch(
+ await expect(element(by.css('#display_name + .invalid-feedback')).getText()).toMatch(
'This field is required.'
);
await element(by.id('max_buckets')).click();
await element(by.id('max_buckets')).clear();
await element(by.id('max_buckets')).sendKeys('-5');
- expect(await element(by.id('max_buckets')).getAttribute('class')).toContain('ng-invalid');
+ await expect(element(by.id('max_buckets')).getAttribute('class')).toContain('ng-invalid');
await element(by.id('email')).click(); // trigger validation check
- expect(await element(by.css('#max_buckets + .invalid-feedback')).getText()).toMatch(
+ await expect(element(by.css('#max_buckets + .invalid-feedback')).getText()).toMatch(
'The entered value must be >= 0.'
);
describe('breadcrumb tests', () => {
it('should check breadcrumb on users tab of user management page', async () => {
await userManagement.navigateTo('users');
- expect(await userManagement.getBreadcrumbText()).toEqual('Users');
+ await expect(userManagement.getBreadcrumbText()).toEqual('Users');
});
it('should check breadcrumb on roles tab of user management page', async () => {
await userManagement.navigateTo('roles');
- expect(await userManagement.getBreadcrumbText()).toEqual('Roles');
+ await expect(userManagement.getBreadcrumbText()).toEqual('Roles');
});
it('should check breadcrumb on user creation page', async () => {
await userManagement.navigateTo('userCreate');
- expect(await userManagement.getBreadcrumbText()).toEqual('Create');
+ await expect(userManagement.getBreadcrumbText()).toEqual('Create');
});
it('should check breadcrumb on role creation page', async () => {
await userManagement.navigateTo('roleCreate');
- expect(await userManagement.getBreadcrumbText()).toEqual('Create');
+ await expect(userManagement.getBreadcrumbText()).toEqual('Create');
});
});