annotate client/tests/e2e/specs/login.js @ 166:8f49ba6cddd9

test: login now as e2e test Basic functionality for login is tested with nightwatch
author Thomas Junk <thomas.junk@intevation.de>
date Fri, 06 Jul 2018 12:00:08 +0200
parents client/tests/e2e/specs/test.js@7c40e9f28f94
children d85d5e286dc5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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)
8f49ba6cddd9 test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents: 164
diff changeset
16 .setValue("input[id='inputEmail']", "bla")
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)
8f49ba6cddd9 test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents: 164
diff changeset
20 .assert.elementPresent(".loginerror")
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)
8f49ba6cddd9 test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents: 164
diff changeset
27 .setValue("input[id='inputEmail']", "oana")
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)
8f49ba6cddd9 test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents: 164
diff changeset
31 .assert.elementPresent(".username")
8f49ba6cddd9 test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents: 164
diff changeset
32 .assert.containsText(".username", "oana")
8f49ba6cddd9 test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents: 164
diff changeset
33 .end();
8f49ba6cddd9 test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents: 164
diff changeset
34 },
8f49ba6cddd9 test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents: 164
diff changeset
35 "Login oana switch url": browser => {
8f49ba6cddd9 test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents: 164
diff changeset
36 browser
8f49ba6cddd9 test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents: 164
diff changeset
37 .url(process.env.VUE_DEV_SERVER_URL)
8f49ba6cddd9 test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents: 164
diff changeset
38 .waitForElementVisible("#app", 5000)
8f49ba6cddd9 test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents: 164
diff changeset
39 .setValue("input[id='inputEmail']", "oana")
8f49ba6cddd9 test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents: 164
diff changeset
40 .setValue("input[id='inputPassword']", "oa2Na2")
8f49ba6cddd9 test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents: 164
diff changeset
41 .click("button[type='submit']")
8f49ba6cddd9 test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents: 164
diff changeset
42 .pause(1000)
8f49ba6cddd9 test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents: 164
diff changeset
43 .assert.elementPresent(".username")
8f49ba6cddd9 test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents: 164
diff changeset
44 .assert.containsText(".username", "oana")
8f49ba6cddd9 test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents: 164
diff changeset
45 .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
46 .pause(1000)
8f49ba6cddd9 test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents: 164
diff changeset
47 .url(process.env.VUE_DEV_SERVER_URL + "#/")
8f49ba6cddd9 test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents: 164
diff changeset
48 .assert.elementPresent(".username")
8f49ba6cddd9 test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents: 164
diff changeset
49 .assert.containsText(".username", "oana")
8f49ba6cddd9 test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents: 164
diff changeset
50 .end();
8f49ba6cddd9 test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents: 164
diff changeset
51 },
8f49ba6cddd9 test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents: 164
diff changeset
52 "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
53 browser
8f49ba6cddd9 test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents: 164
diff changeset
54 .url(process.env.VUE_DEV_SERVER_URL)
8f49ba6cddd9 test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents: 164
diff changeset
55 .waitForElementVisible("#app", 5000)
8f49ba6cddd9 test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents: 164
diff changeset
56 .setValue("input[id='inputEmail']", "oana")
8f49ba6cddd9 test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents: 164
diff changeset
57 .setValue("input[id='inputPassword']", "oa2Na2")
8f49ba6cddd9 test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents: 164
diff changeset
58 .click("button[type='submit']")
8f49ba6cddd9 test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents: 164
diff changeset
59 .pause(1000)
8f49ba6cddd9 test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents: 164
diff changeset
60 .assert.elementPresent(".username")
8f49ba6cddd9 test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents: 164
diff changeset
61 .assert.containsText(".username", "oana")
8f49ba6cddd9 test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents: 164
diff changeset
62 .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
63 .setValue("input[id='inputEmail']", "vanja")
8f49ba6cddd9 test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents: 164
diff changeset
64 .setValue("input[id='inputPassword']", "va2Nja3")
8f49ba6cddd9 test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents: 164
diff changeset
65 .click("button[type='submit']")
8f49ba6cddd9 test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents: 164
diff changeset
66 .pause(1000)
8f49ba6cddd9 test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents: 164
diff changeset
67 .assert.elementPresent(".username")
8f49ba6cddd9 test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents: 164
diff changeset
68 .assert.containsText(".username", "vanja")
8f49ba6cddd9 test: login now as e2e test
Thomas Junk <thomas.junk@intevation.de>
parents: 164
diff changeset
69 .end();
164
7c40e9f28f94 test: Moved testfile. Established nightwatch tests
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
70 }
7c40e9f28f94 test: Moved testfile. Established nightwatch tests
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
71 };