When the cluster is busy it might take some time until the tested component has loaded it's data and is rendered in the browser. Waiting for the breadcrumb text to be present might help to fix errors in the e2e tests.
Signed-off-by: Volker Theile <vtheile@suse.com>
(cherry picked from commit
e28d7287bd109b5c1682dc832c4a77ea47505165)
Conflicts:
src/pybind/mgr/dashboard/frontend/e2e/block/images.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/e2e/block/iscsi.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/e2e/block/mirroring.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/e2e/cluster/alerts.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/e2e/cluster/configuration.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/e2e/cluster/configuration.po.ts
src/pybind/mgr/dashboard/frontend/e2e/cluster/crush-map.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/e2e/cluster/hosts.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/e2e/cluster/hosts.po.ts
src/pybind/mgr/dashboard/frontend/e2e/cluster/logs.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/e2e/cluster/mgr-modules.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/e2e/cluster/monitors.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/e2e/cluster/osds.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/e2e/dashboard.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/e2e/filesystems/filesystems.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/e2e/nfs/nfs.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/e2e/page-helper.po.ts
src/pybind/mgr/dashboard/frontend/e2e/pools/pools.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/e2e/pools/pools.po.ts
src/pybind/mgr/dashboard/frontend/e2e/rgw/buckets.po.ts
src/pybind/mgr/dashboard/frontend/e2e/rgw/daemons.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/e2e/rgw/users.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/e2e/rgw/users.po.ts
src/pybind/mgr/dashboard/frontend/e2e/user-mgmt.e2e-spec.ts
Conflicts are caused by E2E refactoring in master branch.
});
it('should open and show breadcrumb', () => {
- expect(Helper.getBreadcrumbText()).toEqual('Images');
+ Helper.waitTextToBePresent(Helper.getBreadcrumb(), 'Images');
});
it('should show three tabs', () => {
it('should open and show breadcrumb', () => {
page.navigateTo();
- expect(Helper.getBreadcrumbText()).toEqual('Overview');
+ Helper.waitTextToBePresent(Helper.getBreadcrumb(), 'Overview');
});
});
});
it('should open and show breadcrumb', () => {
- expect(Helper.getBreadcrumbText()).toEqual('Mirroring');
+ Helper.waitTextToBePresent(Helper.getBreadcrumb(), 'Mirroring');
});
it('should show three tabs', () => {
});
it('should open and show breadcrumb', () => {
- expect(Helper.getBreadcrumbText()).toEqual('Alerts');
+ Helper.waitTextToBePresent(Helper.getBreadcrumb(), 'Alerts');
});
});
});
it('should open and show breadcrumb', () => {
page.navigateTo();
- expect(Helper.getBreadcrumbText()).toEqual('Configuration');
+ Helper.waitTextToBePresent(Helper.getBreadcrumb(), 'Configuration');
});
});
it('should open and show breadcrumb', () => {
page.navigateTo();
- expect(Helper.getBreadcrumbText()).toEqual('CRUSH map');
+ Helper.waitTextToBePresent(Helper.getBreadcrumb(), 'CRUSH map');
});
});
it('should open and show breadcrumb', () => {
page.navigateTo();
- expect(Helper.getBreadcrumbText()).toEqual('Hosts');
+ Helper.waitTextToBePresent(Helper.getBreadcrumb(), 'Hosts');
});
it('should show two tabs', () => {
it('should open and show breadcrumb', () => {
page.navigateTo();
- expect(Helper.getBreadcrumbText()).toEqual('Logs');
+ Helper.waitTextToBePresent(Helper.getBreadcrumb(), 'Logs');
});
it('should show two tabs', () => {
});
it('should open and show breadcrumb', () => {
- expect(Helper.getBreadcrumbText()).toEqual('Manager modules');
+ Helper.waitTextToBePresent(Helper.getBreadcrumb(), 'Manager modules');
});
});
});
it('should open and show breadcrumb', () => {
page.navigateTo();
- expect(Helper.getBreadcrumbText()).toEqual('Monitors');
+ Helper.waitTextToBePresent(Helper.getBreadcrumb(), 'Monitors');
});
});
it('should open and show breadcrumb', () => {
page.navigateTo();
- expect(Helper.getBreadcrumbText()).toEqual('OSDs');
+ Helper.waitTextToBePresent(Helper.getBreadcrumb(), 'OSDs');
});
it('should show two tabs', () => {
});
it('should open and show breadcrumb', () => {
- expect(Helper.getBreadcrumbText()).toEqual('Filesystems');
+ Helper.waitTextToBePresent(Helper.getBreadcrumb(), 'Filesystems');
});
});
});
-import { $, $$, browser } from 'protractor';
+import { $, $$, browser, ElementFinder } from 'protractor';
export class Helper {
static EC = browser.ExpectedConditions;
});
}
- static getBreadcrumbText() {
- return $('.breadcrumb-item.active').getText();
+ static getBreadcrumb() {
+ return $('.breadcrumb-item.active');
}
static getTabText(idx) {
static getTabsCount() {
return $$('.nav.nav-tabs li').count();
}
+
+ static waitTextToBePresent(elem: ElementFinder, text: string, message?: string) {
+ return browser.wait(Helper.EC.textToBePresentInElement(elem, text), Helper.TIMEOUT, message);
+ }
}
});
it('should open and show breadcrumb', () => {
- expect(Helper.getBreadcrumbText()).toEqual('NFS');
+ Helper.waitTextToBePresent(Helper.getBreadcrumb(), 'NFS');
});
});
});
it('should open and show breadcrumb', () => {
page.navigateTo();
- expect(Helper.getBreadcrumbText()).toEqual('Pools');
+ Helper.waitTextToBePresent(Helper.getBreadcrumb(), 'Pools');
});
it('should show two tabs', () => {