Skip to content
Snippets Groups Projects
Commit 43680155 authored by Marie Verdonck's avatar Marie Verdonck
Browse files

e2e tests for community-list removed

parent e77866a0
No related branches found
No related tags found
No related merge requests found
import { CommunityListPageProtractor } from './community-list-page.po';
describe('protractor CommunityListPage', () => {
let page: CommunityListPageProtractor;
beforeEach(() => {
page = new CommunityListPageProtractor();
});
it('should contain page-limited top communities (at least 1 expandable community)', () => {
page.navigateToCommunityList();
expect<any>(page.anExpandableCommunityIsPresent()).toEqual(true)
});
describe('if expanded a node and navigating away, tree state gets saved', () => {
it('if navigating back, same node is expanded', () => {
page.navigateToCommunityList();
const linkOfSecondNodeBeforeExpanding = page.getLinkOfSecondNode();
page.toggleExpandFirstExpandableCommunity();
const linkOfSecondNodeAfterExpanding = page.getLinkOfSecondNode();
page.navigateToHome();
page.navigateToCommunityList();
expect<any>(page.getLinkOfSecondNode()).toEqual(linkOfSecondNodeAfterExpanding);
page.toggleExpandFirstExpandableCommunity();
expect<any>(page.getLinkOfSecondNode()).toEqual(linkOfSecondNodeBeforeExpanding);
});
});
});
import { browser, by, element, protractor } from 'protractor';
export class CommunityListPageProtractor {
HOMEPAGE = '/home';
COMMUNITY_LIST = '/community-list';
navigateToHome() {
return browser.get(this.HOMEPAGE);
}
navigateToCommunityList() {
browser.get(this.COMMUNITY_LIST);
const loading = element(by.css('.ds-loading'));
browser.wait(protractor.ExpectedConditions.invisibilityOf(loading), 10000);
return;
}
anExpandableCommunityIsPresent() {
console.log(element(by.css('body')));
return element(by.css('.expandable-node h5 a')).isPresent();
}
toggleExpandFirstExpandableCommunity() {
element(by.css('.expandable-node button')).click();
}
getLinkOfSecondNode() {
return element(by.css('.cdk-tree-node h5 a')).getAttribute('href');
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment