-
Notifications
You must be signed in to change notification settings - Fork 240
/
catalogusPage.e2e-spec.ts
50 lines (42 loc) · 1.52 KB
/
catalogusPage.e2e-spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import {CatalogusPage} from '../page-objects/catalogusPage';
import {browser, logging} from 'protractor';
describe('Catalogus Page', () => {
let catalogusPage: CatalogusPage;
beforeEach(() => {
catalogusPage = new CatalogusPage();
catalogusPage.navigateTo();
});
it('url should be : /catalogus', () => {
const url = browser.getCurrentUrl();
expect(url).toContain('/catalogus');
});
it('header should have banner', () => {
const banner = catalogusPage.getBanner();
expect(banner.isPresent()).toBeTruthy();
});
it('menu should contain winkelwagen', () => {
const winkelwagen = catalogusPage.getWinkelwagen();
expect(winkelwagen.isPresent()).toBeTruthy();
});
it('menu should contain all menu-items', () => {
const menuItems = catalogusPage.getMenuItems();
expect(menuItems.getText()).toContain('Catalogus');
});
it('footer address element should be present', () => {
const footer = catalogusPage.getFooter();
expect(footer.isPresent()).toBeTruthy();
});
describe('Test catalogus', () => {
it('catalogus should be empty', () => {
const emptyMessage = catalogusPage.getEmptyCatalogusMessage();
expect(emptyMessage).toBe('Geen artikelen gevonden.');
});
});
afterEach(async () => {
// Assert that there are no errors emitted from the browser
const logs = await browser.manage().logs().get(logging.Type.BROWSER);
expect(logs).not.toContain(jasmine.objectContaining({
level: logging.Level.SEVERE,
} as logging.Entry));
});
});