opt-cc/static/e2e/test.e2e-spec.ts

30 lines
858 B
TypeScript

import {browser, element, by} from 'protractor';
describe('Access Projectmanager Homepage', function () {
beforeEach(() => {
browser.get('/')
});
it('should start at Dashboard page and brand link should redirect there again', () => {
const startingPage = 'Dashboard';
function validatePage() {
const dashboardNavEntryCssClass = element(by.linkText(startingPage)).element(by.xpath('..')).getAttribute('class');
expect(dashboardNavEntryCssClass).toContain('active');
const heading = element(by.css('h1'));
const headingText = heading.getText();
expect(headingText).toBe(startingPage);
}
validatePage();
const navBarBrand = element(by.className('navbar-brand'));
expect(navBarBrand.getAttribute('href')).toBe(browser.baseUrl + '/#');
navBarBrand.click();
validatePage();
});
});