forked from theintern/example-angular
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.e2e-spec.ts
30 lines (24 loc) · 835 Bytes
/
app.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
const { describe, it, before } = intern.getPlugin('interface.bdd');
const { expect } = intern.getPlugin('chai');
import Home from './pages/Home';
describe('E2E Tests', () => {
let page: Home;
before(async ({ remote }) => {
page = new Home(remote);
await page.load();
});
it('should begin at /dashboard', async () => {
expect(await page.getCurrentUrl()).to.match(/\/dashboard$/);
expect(await page.getDashboard()).to.exist;
});
it('should navigate to /heroes when clicking Heroes', async () => {
await page.clickHeroesNav();
await page.waitForHeroes();
expect(await page.getCurrentUrl()).to.match(/\/heroes$/);
});
it('should navigate to /about when clicking About', async () => {
await page.clickAboutNav();
await page.waitForAbout();
expect(await page.getCurrentUrl()).to.match(/\/about$/);
});
});