e2e test fix, so it waits for the loading element to disappear (tree is rendered)

This commit is contained in:
Marie Verdonck
2019-12-04 11:09:00 +01:00
parent afcf897bbe
commit 8cacad3264
2 changed files with 10 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
import { browser, by, element } from 'protractor'; import { browser, by, element, protractor } from 'protractor';
export class CommunityListPageProtractor { export class CommunityListPageProtractor {
HOMEPAGE = '/home'; HOMEPAGE = '/home';
@@ -9,10 +9,15 @@ export class CommunityListPageProtractor {
} }
navigateToCommunityList() { navigateToCommunityList() {
return browser.get(this.COMMUNITY_LIST); browser.get(this.COMMUNITY_LIST);
const loading = element(by.css('.ds-loading'));
browser.wait(protractor.ExpectedConditions.invisibilityOf(loading), 10000);
return;
} }
anExpandableCommunityIsPresent() { anExpandableCommunityIsPresent() {
console.log(element(by.css('body')));
return element(by.css('.expandable-node h5 a')).isPresent(); return element(by.css('.expandable-node h5 a')).isPresent();
} }

View File

@@ -1,4 +1,4 @@
<ds-loading *ngIf="(dataSource.loading$ | async) && loadingNode === undefined "></ds-loading> <ds-loading *ngIf="(dataSource.loading$ | async) && loadingNode === undefined " class="ds-loading"></ds-loading>
<cdk-tree [dataSource]="dataSource" [treeControl]="treeControl"> <cdk-tree [dataSource]="dataSource" [treeControl]="treeControl">
<!-- This is the tree node template for show more node --> <!-- This is the tree node template for show more node -->
@@ -13,7 +13,7 @@
class="btn btn-outline-secondary btn-sm"> class="btn btn-outline-secondary btn-sm">
{{ 'communityList.showMore' | translate }} {{ 'communityList.showMore' | translate }}
</a> </a>
<ds-loading *ngIf="node===loadingNode && dataSource.loading$ | async"></ds-loading> <ds-loading *ngIf="node===loadingNode && dataSource.loading$ | async" class="ds-loading"></ds-loading>
</div> </div>
</div> </div>
<div class="text-muted" cdkTreeNodePadding> <div class="text-muted" cdkTreeNodePadding>
@@ -57,7 +57,7 @@
<span class="{{node.isExpanded ? 'fa fa-chevron-down' : 'fa fa-chevron-right'}}" <span class="{{node.isExpanded ? 'fa fa-chevron-down' : 'fa fa-chevron-right'}}"
aria-hidden="true"></span> aria-hidden="true"></span>
</button> </button>
<ds-loading></ds-loading> <ds-loading class="ds-loading"></ds-loading>
</div> </div>
</cdk-tree-node> </cdk-tree-node>
<!-- This is the tree node template for leaf nodes (collections and (sub)coms without children) --> <!-- This is the tree node template for leaf nodes (collections and (sub)coms without children) -->