1 import { $$, by, element } from 'protractor';
2 import { OSDsPageHelper } from './osds.po';
4 describe('OSDs page', () => {
5 let osds: OSDsPageHelper;
7 beforeAll(async () => {
8 osds = new OSDsPageHelper();
9 await osds.navigateTo();
12 afterEach(async () => {
13 await OSDsPageHelper.checkConsole();
16 describe('breadcrumb and tab tests', () => {
17 it('should open and show breadcrumb', async () => {
18 await osds.waitTextToBePresent(osds.getBreadcrumb(), 'OSDs');
21 it('should show two tabs', async () => {
22 await expect(osds.getTabsCount()).toEqual(2);
25 it('should show OSDs list tab at first', async () => {
26 await expect(osds.getTabText(0)).toEqual('OSDs List');
29 it('should show overall performance as a second tab', async () => {
30 await expect(osds.getTabText(1)).toEqual('Overall Performance');
34 describe('check existence of fields on OSD page', () => {
35 it('should check that number of rows and count in footer match', async () => {
36 await expect(osds.getTableTotalCount()).toEqual(osds.getTableRows().count());
39 it('should verify that buttons exist', async () => {
40 await expect(element(by.cssContainingText('button', 'Create')).isPresent()).toBe(true);
42 element(by.cssContainingText('button', 'Cluster-wide configuration')).isPresent()
46 describe('by selecting one row in OSDs List', () => {
47 beforeAll(async () => {
48 await osds.getFirstCell().click();
51 it('should verify that selected footer increases', async () => {
52 await expect(osds.getTableSelectedCount()).toEqual(1);
55 it('should show the correct text for the tab labels', async () => {
56 const tabHeadings = $$('#tabset-osd-details > div > tab').map((e) =>
57 e.getAttribute('heading')
59 await expect(tabHeadings).toEqual([
61 'Attributes (OSD map)',
64 'Performance counter',