Skip to content

Commit

Permalink
increase e2e test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
ccrowhurstram committed Sep 17, 2016
1 parent c650ffb commit 44a4eb8
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 35 deletions.
24 changes: 0 additions & 24 deletions demo-apps/index.html

This file was deleted.

14 changes: 14 additions & 0 deletions e2e/demo-ng-table.po.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { ElementArrayFinder, ElementFinder } from 'protractor';
import { browser, by, element } from 'protractor/globals';

export class DemoNgTablePage {
dataRows: ElementArrayFinder;
table: ElementFinder;
constructor(private url: string) {
this.table = element(by.css('table[ng-table]'));
this.dataRows = element.all(by.repeater('user in $data'));
}
open() {
browser.get(this.url);
}
}
44 changes: 36 additions & 8 deletions e2e/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,40 @@
import { browser, element, by } from 'protractor/globals';
import { DemoNgTablePage } from './demo-ng-table.po';

describe('ng-table - ts+webpack', () => {
it('should render ng-table', () => {
browser.get('http://localhost:8080');
describe('ng-table', () => {

const table = element(by.css('table[ng-table]'));
expect(table.isPresent()).toBe(true);
const dataRows = element.all(by.repeater('user in $data'));
expect(dataRows.count()).toBeGreaterThan(0);
describe('es5', () => {
const demoPageUrl = 'es5/index.html';
it('should render ng-table', () => {
renderTableSpec(demoPageUrl);
});
});

describe('es6-systemjs', () => {
const demoPageUrl = 'es6-systemjs/index.html';
it('should render ng-table', () => {
renderTableSpec(demoPageUrl);
});
});

describe('es6-webpack', () => {
const demoPageUrl = 'es6-webpack/build/index.html';
it('should render ng-table', () => {
renderTableSpec(demoPageUrl);
});
});

describe('ts-webpack', () => {
const demoPageUrl = 'ts-webpack/build/index.html';
it('should render ng-table', () => {
renderTableSpec(demoPageUrl);
});
});


function renderTableSpec(url: string) {
const demoPage = new DemoNgTablePage(url);
demoPage.open();
expect(demoPage.table.isPresent()).toBe(true);
expect(demoPage.dataRows.count()).toBeGreaterThan(0);
}
});
9 changes: 7 additions & 2 deletions e2e/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,15 @@
"experimentalDecorators": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"suppressImplicitAnyIndexErrors": true
"suppressImplicitAnyIndexErrors": true,
"typeRoots": [
"../node_modules/@types"
]
},
"include": [
"./**/*"
],
"exclude": ["node_modules"]
"exclude": [
"node_modules"
]
}
1 change: 0 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"suppressImplicitAnyIndexErrors": true
},
"include": [
"e2e/**/*",
"src/**/*",
"test/**/*",
"./*"
Expand Down

0 comments on commit 44a4eb8

Please sign in to comment.