Skip to content

Commit 994d939

Browse files
Merge pull request #138 from ui-router/travis2
add travis ci
2 parents 3ba5588 + c98effa commit 994d939

File tree

8 files changed

+2569
-799
lines changed

8 files changed

+2569
-799
lines changed

.travis.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
language: node_js
2+
node_js: 8.9.1
3+
services:
4+
- xvfb
5+
before_install:
6+
- sudo apt-get install libgconf-2-4
7+
- export DISPLAY=:99.0
8+
- export PATH=$HOME/.yarn/bin:$PATH
9+
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.5.1
10+
script: yarn build && yarn test && yarn e2e
11+
sudo: false
12+
git:
13+
depth: 3

e2e/app.e2e-spec.ts

+27-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,32 @@ describe('quickstart-angular App', () => {
99

1010
it('should display welcome message', () => {
1111
page.navigateTo();
12-
expect(page.getParagraphText()).toEqual('Welcome to app!');
12+
expect(page.getParagraphText()).toEqual('Welcome to ui-router!');
13+
});
14+
15+
it('should render 3 links', () => {
16+
page.navigateTo();
17+
expect(page.getLinks().count()).toEqual(3);
18+
});
19+
20+
it('should render Hello state', () => {
21+
page.navigateTo();
22+
page.getLink('Hello').click();
23+
expect(page.getUrl()).toEqual('/hello');
24+
expect(page.getViewContent()).toEqual('hello works!');
25+
});
26+
27+
it('should render World state', () => {
28+
page.navigateTo();
29+
page.getLink('World').click();
30+
expect(page.getUrl()).toEqual('/world');
31+
expect(page.getViewContent()).toEqual('world works!');
32+
});
33+
34+
it('should render World.nest state', () => {
35+
page.navigateTo();
36+
page.getLink('World.nest').click();
37+
expect(page.getUrl()).toEqual('/world/nest');
38+
expect(page.getViewContent()).toEqual('world works!\nnest works!');
1339
});
1440
});

e2e/app.po.ts

+16
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,23 @@ export class AppPage {
55
return browser.get('/');
66
}
77

8+
getUrl() {
9+
return browser.getCurrentUrl().then(result => result.replace(/^http:..[^/]*/, ''));
10+
}
11+
812
getParagraphText() {
913
return element(by.css('app-root h1')).getText();
1014
}
15+
16+
getLinks() {
17+
return element.all(by.tagName('a'));
18+
}
19+
20+
getLink(text: string) {
21+
return element.all(by.linkText(text));
22+
}
23+
24+
getViewContent() {
25+
return element.all(by.tagName('ui-view')).first().getText();
26+
}
1127
}

karma.conf.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ module.exports = function (config) {
2626
logLevel: config.LOG_INFO,
2727
autoWatch: true,
2828
browsers: ['Chrome'],
29-
singleRun: false
29+
singleRun: true
3030
});
3131
};

0 commit comments

Comments
 (0)