Mercurial > gemma
annotate client/tests/e2e/specs/login.js @ 637:e72229d54c42
chore: upgrade node packages
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Thu, 13 Sep 2018 09:12:50 +0200 |
parents | 7cada58cae2c |
children | 0c5cbbafbd94 |
rev | line source |
---|---|
164
7c40e9f28f94
test: Moved testfile. Established nightwatch tests
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
1 // For authoring Nightwatch tests, see |
7c40e9f28f94
test: Moved testfile. Established nightwatch tests
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
2 // http://nightwatchjs.org/guide#usage |
7c40e9f28f94
test: Moved testfile. Established nightwatch tests
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
3 |
7c40e9f28f94
test: Moved testfile. Established nightwatch tests
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
4 module.exports = { |
166
8f49ba6cddd9
test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents:
164
diff
changeset
|
5 "Page Load": browser => { |
164
7c40e9f28f94
test: Moved testfile. Established nightwatch tests
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
6 browser |
7c40e9f28f94
test: Moved testfile. Established nightwatch tests
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
7 .url(process.env.VUE_DEV_SERVER_URL) |
7c40e9f28f94
test: Moved testfile. Established nightwatch tests
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
8 .waitForElementVisible("#app", 5000) |
7c40e9f28f94
test: Moved testfile. Established nightwatch tests
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
9 .assert.elementPresent(".login") |
7c40e9f28f94
test: Moved testfile. Established nightwatch tests
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
10 .end(); |
166
8f49ba6cddd9
test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents:
164
diff
changeset
|
11 }, |
8f49ba6cddd9
test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents:
164
diff
changeset
|
12 "Login failed": browser => { |
8f49ba6cddd9
test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents:
164
diff
changeset
|
13 browser |
8f49ba6cddd9
test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents:
164
diff
changeset
|
14 .url(process.env.VUE_DEV_SERVER_URL) |
8f49ba6cddd9
test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents:
164
diff
changeset
|
15 .waitForElementVisible("#app", 5000) |
590
d85d5e286dc5
fix: e2e tests fixed
Thomas Junk <thomas.junk@intevation.de>
parents:
166
diff
changeset
|
16 .setValue("input[id='inputUsername']", "bla") |
166
8f49ba6cddd9
test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents:
164
diff
changeset
|
17 .setValue("input[id='inputPassword']", "bla") |
8f49ba6cddd9
test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents:
164
diff
changeset
|
18 .click("button[type='submit']") |
8f49ba6cddd9
test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents:
164
diff
changeset
|
19 .waitForElementVisible("#alert", 2000) |
590
d85d5e286dc5
fix: e2e tests fixed
Thomas Junk <thomas.junk@intevation.de>
parents:
166
diff
changeset
|
20 .assert.elementPresent(".alert-danger") |
166
8f49ba6cddd9
test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents:
164
diff
changeset
|
21 .end(); |
8f49ba6cddd9
test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents:
164
diff
changeset
|
22 }, |
8f49ba6cddd9
test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents:
164
diff
changeset
|
23 "Login oana success": browser => { |
8f49ba6cddd9
test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents:
164
diff
changeset
|
24 browser |
8f49ba6cddd9
test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents:
164
diff
changeset
|
25 .url(process.env.VUE_DEV_SERVER_URL) |
8f49ba6cddd9
test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents:
164
diff
changeset
|
26 .waitForElementVisible("#app", 5000) |
590
d85d5e286dc5
fix: e2e tests fixed
Thomas Junk <thomas.junk@intevation.de>
parents:
166
diff
changeset
|
27 .setValue("input[id='inputUsername']", "oana") |
166
8f49ba6cddd9
test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents:
164
diff
changeset
|
28 .setValue("input[id='inputPassword']", "oa2Na2") |
8f49ba6cddd9
test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents:
164
diff
changeset
|
29 .click("button[type='submit']") |
8f49ba6cddd9
test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents:
164
diff
changeset
|
30 .pause(1000) |
623
7cada58cae2c
fix: e2e for new UI adapted
Thomas Junk <thomas.junk@intevation.de>
parents:
590
diff
changeset
|
31 .click(".userpic") |
590
d85d5e286dc5
fix: e2e tests fixed
Thomas Junk <thomas.junk@intevation.de>
parents:
166
diff
changeset
|
32 .pause(1000) |
166
8f49ba6cddd9
test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents:
164
diff
changeset
|
33 .assert.elementPresent(".username") |
8f49ba6cddd9
test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents:
164
diff
changeset
|
34 .assert.containsText(".username", "oana") |
8f49ba6cddd9
test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents:
164
diff
changeset
|
35 .end(); |
8f49ba6cddd9
test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents:
164
diff
changeset
|
36 }, |
8f49ba6cddd9
test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents:
164
diff
changeset
|
37 "Login oana switch url": browser => { |
8f49ba6cddd9
test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents:
164
diff
changeset
|
38 browser |
8f49ba6cddd9
test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents:
164
diff
changeset
|
39 .url(process.env.VUE_DEV_SERVER_URL) |
8f49ba6cddd9
test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents:
164
diff
changeset
|
40 .waitForElementVisible("#app", 5000) |
590
d85d5e286dc5
fix: e2e tests fixed
Thomas Junk <thomas.junk@intevation.de>
parents:
166
diff
changeset
|
41 .setValue("input[id='inputUsername']", "oana") |
166
8f49ba6cddd9
test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents:
164
diff
changeset
|
42 .setValue("input[id='inputPassword']", "oa2Na2") |
8f49ba6cddd9
test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents:
164
diff
changeset
|
43 .click("button[type='submit']") |
8f49ba6cddd9
test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents:
164
diff
changeset
|
44 .pause(1000) |
623
7cada58cae2c
fix: e2e for new UI adapted
Thomas Junk <thomas.junk@intevation.de>
parents:
590
diff
changeset
|
45 .click(".userpic") |
590
d85d5e286dc5
fix: e2e tests fixed
Thomas Junk <thomas.junk@intevation.de>
parents:
166
diff
changeset
|
46 .pause(1000) |
166
8f49ba6cddd9
test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents:
164
diff
changeset
|
47 .assert.elementPresent(".username") |
8f49ba6cddd9
test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents:
164
diff
changeset
|
48 .assert.containsText(".username", "oana") |
8f49ba6cddd9
test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents:
164
diff
changeset
|
49 .url(process.env.VUE_DEV_SERVER_URL + "#/login") |
8f49ba6cddd9
test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents:
164
diff
changeset
|
50 .pause(1000) |
8f49ba6cddd9
test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents:
164
diff
changeset
|
51 .url(process.env.VUE_DEV_SERVER_URL + "#/") |
8f49ba6cddd9
test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents:
164
diff
changeset
|
52 .assert.elementPresent(".username") |
8f49ba6cddd9
test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents:
164
diff
changeset
|
53 .assert.containsText(".username", "oana") |
8f49ba6cddd9
test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents:
164
diff
changeset
|
54 .end(); |
8f49ba6cddd9
test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents:
164
diff
changeset
|
55 }, |
8f49ba6cddd9
test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents:
164
diff
changeset
|
56 "Login switch user from oana to vanja": browser => { |
8f49ba6cddd9
test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents:
164
diff
changeset
|
57 browser |
8f49ba6cddd9
test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents:
164
diff
changeset
|
58 .url(process.env.VUE_DEV_SERVER_URL) |
8f49ba6cddd9
test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents:
164
diff
changeset
|
59 .waitForElementVisible("#app", 5000) |
590
d85d5e286dc5
fix: e2e tests fixed
Thomas Junk <thomas.junk@intevation.de>
parents:
166
diff
changeset
|
60 .setValue("input[id='inputUsername']", "oana") |
166
8f49ba6cddd9
test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents:
164
diff
changeset
|
61 .setValue("input[id='inputPassword']", "oa2Na2") |
8f49ba6cddd9
test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents:
164
diff
changeset
|
62 .click("button[type='submit']") |
8f49ba6cddd9
test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents:
164
diff
changeset
|
63 .pause(1000) |
623
7cada58cae2c
fix: e2e for new UI adapted
Thomas Junk <thomas.junk@intevation.de>
parents:
590
diff
changeset
|
64 .click(".userpic") |
590
d85d5e286dc5
fix: e2e tests fixed
Thomas Junk <thomas.junk@intevation.de>
parents:
166
diff
changeset
|
65 .pause(1000) |
166
8f49ba6cddd9
test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents:
164
diff
changeset
|
66 .assert.elementPresent(".username") |
8f49ba6cddd9
test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents:
164
diff
changeset
|
67 .assert.containsText(".username", "oana") |
8f49ba6cddd9
test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents:
164
diff
changeset
|
68 .url(process.env.VUE_DEV_SERVER_URL + "#/login") |
590
d85d5e286dc5
fix: e2e tests fixed
Thomas Junk <thomas.junk@intevation.de>
parents:
166
diff
changeset
|
69 .setValue("input[id='inputUsername']", "sophie") |
d85d5e286dc5
fix: e2e tests fixed
Thomas Junk <thomas.junk@intevation.de>
parents:
166
diff
changeset
|
70 .setValue("input[id='inputPassword']", "so2Phie4") |
166
8f49ba6cddd9
test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents:
164
diff
changeset
|
71 .click("button[type='submit']") |
8f49ba6cddd9
test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents:
164
diff
changeset
|
72 .pause(1000) |
8f49ba6cddd9
test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents:
164
diff
changeset
|
73 .assert.elementPresent(".username") |
590
d85d5e286dc5
fix: e2e tests fixed
Thomas Junk <thomas.junk@intevation.de>
parents:
166
diff
changeset
|
74 .assert.containsText(".username", "sophie") |
166
8f49ba6cddd9
test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents:
164
diff
changeset
|
75 .end(); |
164
7c40e9f28f94
test: Moved testfile. Established nightwatch tests
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
76 } |
7c40e9f28f94
test: Moved testfile. Established nightwatch tests
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
77 }; |