angular4-testing/project-manager/e2e/page-object/abstract-header.po.ts

24 lines
718 B
TypeScript
Raw Normal View History

2017-04-14 03:57:42 +02:00
import {element, by} from "protractor";
import {AbstractPage} from "./abstract-page.po";
export class AbstractHeaderPage extends AbstractPage {
validatePageHeadline(headline: string) {
const head = element(by.css('h1'));
expect(head.getText()).toBe(headline);
}
clickBrandLink(linkText: string) {
const headerEntry = element(by.linkText(linkText));
headerEntry.click()
}
clickSchnellzugriffFollowedBy(linkText: string) {
// starts with css Selector: https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors
const schnellzugriffBtn = element(by.className('dropdown'));
schnellzugriffBtn.click();
schnellzugriffBtn.element(by.linkText(linkText)).click();
}
}