Skip to content

Commit 88eab4a

Browse files
committed
Fix e2e tests
1 parent ec3c9c7 commit 88eab4a

File tree

7 files changed

+52
-84
lines changed

7 files changed

+52
-84
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"@types/webpack": "^2.2.14",
6969
"aurelia-loader-nodejs": "^1.0.1",
7070
"aurelia-pal-nodejs": "1.0.0-beta.1.0.0",
71-
"aurelia-protractor-plugin": "^1.0.1",
71+
"aurelia-protractor-plugin": "^1.0.2",
7272
"aurelia-template-lint-webpack-loader": "^1.0.3",
7373
"aurelia-testing": "^1.0.0-beta.3.0.1",
7474
"aurelia-webpack-plugin": "^2.0.0-rc.2",

src/app/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export async function configure(aurelia: Aurelia): Promise<void> {
107107
: resolve());
108108

109109
await aurelia.start();
110-
aurelia.setRoot(PLATFORM.moduleName('app.vm'));
110+
await aurelia.setRoot(PLATFORM.moduleName('app.vm'));
111111

112112
// if you would like your website to work offline (Service Worker),
113113
// install and enable the @easy-webpack/config-offline package in webpack.config.js and uncomment the following code:

src/locales/en_US.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"TITLE": "Transaltion Title",
2+
"TITLE": "Translation Title",
33
"TR_ATTR": "...in English",
44
"TR_SIGNALER": "Signaler Example works..."
55
}

test/e2e/demo.e2e.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
import {PageObject_Welcome} from './welcome.po';
2-
import {PageObject_Skeleton} from './skeleton.po';
3-
import {browser, element, by, By, $, $$, ExpectedConditions} from 'aurelia-protractor-plugin/protractor';
4-
import {config} from '../protractor.conf'
1+
import { PageObject_Welcome } from './welcome.po';
2+
import { PageObject_Skeleton } from './skeleton.po';
3+
import { browser, element, by, By, $, $$, ExpectedConditions } from 'aurelia-protractor-plugin/protractor';
4+
import { config } from '../protractor.conf';
55

6-
describe('aurelia skeleton app', function() {
6+
describe('aurelia skeleton app', () => {
77
let po_welcome: PageObject_Welcome;
88
let po_skeleton: PageObject_Skeleton;
99

10-
beforeEach( () => {
10+
beforeEach(() => {
1111
po_skeleton = new PageObject_Skeleton();
1212
po_welcome = new PageObject_Welcome();
1313

1414
browser.loadAndWaitForAureliaPage(`http://localhost:${config.port}`);
1515
});
1616

17-
it('should load the page and display the initial page title', () => {
18-
expect(po_skeleton.getCurrentPageTitle()).toBe('Welcome | Aurelia');
17+
it('should load the page and display the initial page title', async () => {
18+
expect(po_skeleton.getCurrentPageTitle()).toBe('Welcome | Translation Title');
1919
});
2020

2121
it('should display greeting', () => {
@@ -37,8 +37,8 @@ describe('aurelia skeleton app', function() {
3737
});
3838

3939
it('should navigate to users page', () => {
40-
po_skeleton.navigateTo('#/users');
41-
browser.sleep(200);
42-
expect(po_skeleton.getCurrentPageTitle()).toBe('Github Users | Aurelia');
40+
po_skeleton.navigateTo('/users');
41+
browser.sleep(500);
42+
expect(po_skeleton.getCurrentPageTitle()).toBe('Github Users | Translation Title');
4343
});
4444
});

test/e2e/skeleton.po.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
1+
import { promise as wdpromise } from 'selenium-webdriver';
12
import {browser, element, by, By, $, $$, ExpectedConditions} from 'aurelia-protractor-plugin/protractor';
23

34
export class PageObject_Skeleton {
45

5-
constructor() {
6-
7-
}
8-
9-
getCurrentPageTitle() {
6+
public getCurrentPageTitle(): wdpromise.Promise<string> {
107
return browser.getTitle();
118
}
129

13-
navigateTo(href) {
10+
public navigateTo(href): wdpromise.Promise<any> {
1411
element(by.css('a[href="' + href + '"]')).click();
1512
return browser.waitForRouterComplete();
1613
}

test/e2e/welcome.po.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,40 @@
1+
import { promise as wdpromise } from 'selenium-webdriver';
12
import {browser, element, by, By, $, $$, ExpectedConditions} from 'aurelia-protractor-plugin/protractor';
23

34
export class PageObject_Welcome {
4-
getGreeting() {
5+
6+
public getGreeting(): wdpromise.Promise<string> {
57
return element(by.tagName('h2')).getText();
68
}
79

8-
setFirstname(value) {
10+
public setFirstname(value): wdpromise.Promise<void> {
911
let firstName = element(by.valueBind('firstName'));
1012
return firstName.clear().then(() => firstName.sendKeys(value));
1113
}
1214

13-
setLastname(value) {
15+
public setLastname(value): wdpromise.Promise<void> {
1416
let lastName = element(by.valueBind('lastName'));
1517
return lastName.clear().then(() => lastName.sendKeys(value));
1618
}
1719

18-
getFullname() {
20+
public getFullname(): wdpromise.Promise<string> {
1921
return element(by.css('.help-block')).getText();
2022
}
2123

22-
pressSubmitButton() {
24+
public pressSubmitButton(): wdpromise.Promise<void> {
2325
return element(by.css('button[type="submit"]')).click();
2426
}
2527

26-
openAlertDialog() {
28+
public openAlertDialog(): wdpromise.Promise<any> {
2729
return browser.wait(async () => {
2830
await this.pressSubmitButton();
2931

3032
await browser.wait(ExpectedConditions.alertIsPresent(), 5000);
3133

3234
return browser.switchTo().alert().then(
3335
// use alert.accept instead of alert.dismiss which results in a browser crash
34-
function(alert) { alert.accept(); return true; },
35-
function() { return false; }
36+
(alert) => { alert.accept(); return true; },
37+
() => false
3638
);
3739
});
3840
}

yarn.lock

Lines changed: 25 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -210,14 +210,14 @@ ansi-html@0.0.7:
210210
version "0.0.7"
211211
resolved "https://registry.yarnpkg.com/ansi-html/-/ansi-html-0.0.7.tgz#813584021962a9e9e6fd039f940d12f56ca7859e"
212212

213-
ansi-regex@*, ansi-regex@^2.0.0:
214-
version "2.1.1"
215-
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df"
216-
217213
ansi-regex@^0.2.0, ansi-regex@^0.2.1:
218214
version "0.2.1"
219215
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-0.2.1.tgz#0d8e946967a3d8143f93e24e298525fc1b2235f9"
220216

217+
ansi-regex@^2.0.0:
218+
version "2.1.1"
219+
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df"
220+
221221
ansi-styles@^1.1.0:
222222
version "1.1.0"
223223
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-1.1.0.tgz#eaecbf66cd706882760b2f4691582b8f55d7a7de"
@@ -634,9 +634,9 @@ aurelia-polyfills@^1.0.0, aurelia-polyfills@^1.2.1:
634634
dependencies:
635635
aurelia-pal "^1.0.0"
636636

637-
aurelia-protractor-plugin@^1.0.1:
638-
version "1.0.1"
639-
resolved "https://registry.yarnpkg.com/aurelia-protractor-plugin/-/aurelia-protractor-plugin-1.0.1.tgz#f2b4532dbe9a2b46bc87cc94052d2d5dbe539433"
637+
aurelia-protractor-plugin@^1.0.2:
638+
version "1.0.2"
639+
resolved "https://registry.yarnpkg.com/aurelia-protractor-plugin/-/aurelia-protractor-plugin-1.0.2.tgz#a1e20307078fa338ef138b000f5d52a3645f5d43"
640640
dependencies:
641641
"@types/selenium-webdriver" "^2.53.33"
642642

@@ -2367,7 +2367,7 @@ debug@0.7.4:
23672367
version "0.7.4"
23682368
resolved "https://registry.yarnpkg.com/debug/-/debug-0.7.4.tgz#06e1ea8082c2cb14e39806e22e2f6f757f92af39"
23692369

2370-
debug@2, debug@2.6.3, debug@^2.1.1, debug@^2.2.0, debug@^2.3.2:
2370+
debug@2, debug@^2.1.1, debug@^2.2.0, debug@^2.3.2:
23712371
version "2.6.3"
23722372
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.3.tgz#0f7eb8c30965ec08c72accfa0130c8b79984141d"
23732373
dependencies:
@@ -3257,7 +3257,7 @@ fill-range@^2.1.0:
32573257
repeat-element "^1.1.2"
32583258
repeat-string "^1.5.2"
32593259

3260-
finalhandler@1.0.0:
3260+
finalhandler@1.0.0, finalhandler@~1.0.0:
32613261
version "1.0.0"
32623262
resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.0.0.tgz#b5691c2c0912092f18ac23e9416bde5cd7dc6755"
32633263
dependencies:
@@ -3269,18 +3269,6 @@ finalhandler@1.0.0:
32693269
statuses "~1.3.1"
32703270
unpipe "~1.0.0"
32713271

3272-
finalhandler@~1.0.0:
3273-
version "1.0.1"
3274-
resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.0.1.tgz#bcd15d1689c0e5ed729b6f7f541a6df984117db8"
3275-
dependencies:
3276-
debug "2.6.3"
3277-
encodeurl "~1.0.1"
3278-
escape-html "~1.0.3"
3279-
on-finished "~2.3.0"
3280-
parseurl "~1.3.1"
3281-
statuses "~1.3.1"
3282-
unpipe "~1.0.0"
3283-
32843272
find-up@^1.0.0:
32853273
version "1.1.2"
32863274
resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f"
@@ -3746,7 +3734,7 @@ got@^6.7.1:
37463734
unzip-response "^2.0.1"
37473735
url-parse-lax "^1.0.0"
37483736

3749-
graceful-fs@^4.0.0, graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.4, graceful-fs@^4.1.6, graceful-fs@^4.1.9, graceful-fs@~4.1.6:
3737+
graceful-fs@^4.0.0, graceful-fs@^4.1.2, graceful-fs@^4.1.4, graceful-fs@^4.1.6, graceful-fs@^4.1.9, graceful-fs@~4.1.6:
37503738
version "4.1.11"
37513739
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658"
37523740

@@ -3960,14 +3948,14 @@ home-or-tmp@^2.0.0:
39603948
os-homedir "^1.0.0"
39613949
os-tmpdir "^1.0.1"
39623950

3963-
hosted-git-info@^2.1.4, hosted-git-info@^2.4.2:
3964-
version "2.4.2"
3965-
resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.4.2.tgz#0076b9f46a270506ddbaaea56496897460612a67"
3966-
3967-
hosted-git-info@~2.1.5:
3951+
hosted-git-info@^2.1.4, hosted-git-info@~2.1.5:
39683952
version "2.1.5"
39693953
resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.1.5.tgz#0ba81d90da2e25ab34a332e6ec77936e1598118b"
39703954

3955+
hosted-git-info@^2.4.2:
3956+
version "2.4.2"
3957+
resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.4.2.tgz#0076b9f46a270506ddbaaea56496897460612a67"
3958+
39713959
hpack.js@^2.1.6:
39723960
version "2.1.6"
39733961
resolved "https://registry.yarnpkg.com/hpack.js/-/hpack.js-2.1.6.tgz#87774c0949e513f42e84575b3c45681fade2a0b2"
@@ -4238,7 +4226,7 @@ img-loader@^2.0.0:
42384226
imagemin-svgo "^5.2.0"
42394227
loader-utils "^1.0.4"
42404228

4241-
imurmurhash@*, imurmurhash@^0.1.4:
4229+
imurmurhash@^0.1.4:
42424230
version "0.1.4"
42434231
resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea"
42444232

@@ -5843,7 +5831,7 @@ minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1:
58435831
dependencies:
58445832
brace-expansion "^1.0.0"
58455833

5846-
minimist@0.0.8:
5834+
minimist@0.0.8, minimist@~0.0.1:
58475835
version "0.0.8"
58485836
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"
58495837

@@ -5855,10 +5843,6 @@ minimist@^1.1.0, minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0:
58555843
version "1.2.0"
58565844
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"
58575845

5858-
minimist@~0.0.1:
5859-
version "0.0.10"
5860-
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf"
5861-
58625846
mixin-object@^2.0.1:
58635847
version "2.0.1"
58645848
resolved "https://registry.yarnpkg.com/mixin-object/-/mixin-object-2.0.1.tgz#4fb949441dab182540f1fe035ba60e1947a5e57e"
@@ -6141,15 +6125,15 @@ node-zopfli@^2.0.0:
61416125
nan "^2.0.0"
61426126
node-pre-gyp "^0.6.4"
61436127

6144-
"nopt@2 || 3", nopt@3.0.1:
6145-
version "3.0.1"
6146-
resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.1.tgz#bce5c42446a3291f47622a370abbf158fbbacbfd"
6128+
"nopt@2 || 3", nopt@3.x, nopt@^3.0.6, nopt@~3.0.6:
6129+
version "3.0.6"
6130+
resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9"
61476131
dependencies:
61486132
abbrev "1"
61496133

6150-
nopt@3.x, nopt@^3.0.6, nopt@~3.0.6:
6151-
version "3.0.6"
6152-
resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9"
6134+
nopt@3.0.1:
6135+
version "3.0.1"
6136+
resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.1.tgz#bce5c42446a3291f47622a370abbf158fbbacbfd"
61536137
dependencies:
61546138
abbrev "1"
61556139

@@ -9708,36 +9692,21 @@ wrappy@1, wrappy@~1.0.2:
97089692
version "1.0.2"
97099693
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
97109694

9711-
write-file-atomic@^1.1.2:
9712-
version "1.3.1"
9713-
resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-1.3.1.tgz#7d45ba32316328dd1ec7d90f60ebc0d845bb759a"
9714-
dependencies:
9715-
graceful-fs "^4.1.11"
9716-
imurmurhash "^0.1.4"
9717-
slide "^1.1.5"
9718-
9719-
write-file-atomic@~1.1.4:
9695+
write-file-atomic@^1.1.2, write-file-atomic@~1.1.4:
97209696
version "1.1.4"
97219697
resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-1.1.4.tgz#b1f52dc2e8dc0e3cb04d187a25f758a38a90ca3b"
97229698
dependencies:
97239699
graceful-fs "^4.1.2"
97249700
imurmurhash "^0.1.4"
97259701
slide "^1.1.5"
97269702

9727-
ws@1.1.2:
9703+
ws@1.1.2, ws@^1.0.1:
97289704
version "1.1.2"
97299705
resolved "https://registry.yarnpkg.com/ws/-/ws-1.1.2.tgz#8a244fa052401e08c9886cf44a85189e1fd4067f"
97309706
dependencies:
97319707
options ">=0.0.5"
97329708
ultron "1.0.x"
97339709

9734-
ws@^1.0.1:
9735-
version "1.1.4"
9736-
resolved "https://registry.yarnpkg.com/ws/-/ws-1.1.4.tgz#57f40d036832e5f5055662a397c4de76ed66bf61"
9737-
dependencies:
9738-
options ">=0.0.5"
9739-
ultron "1.0.x"
9740-
97419710
wtf-8@1.0.0:
97429711
version "1.0.0"
97439712
resolved "https://registry.yarnpkg.com/wtf-8/-/wtf-8-1.0.0.tgz#392d8ba2d0f1c34d1ee2d630f15d0efb68e1048a"

0 commit comments

Comments
 (0)