Mercurial > gemma
view client/tests/e2e/specs/login.js @ 1279:60e15c2d26a2
licensing info updated
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Thu, 22 Nov 2018 09:50:13 +0100 |
parents | 7cada58cae2c |
children | 0c5cbbafbd94 |
line wrap: on
line source
// For authoring Nightwatch tests, see // http://nightwatchjs.org/guide#usage module.exports = { "Page Load": browser => { browser .url(process.env.VUE_DEV_SERVER_URL) .waitForElementVisible("#app", 5000) .assert.elementPresent(".login") .end(); }, "Login failed": browser => { browser .url(process.env.VUE_DEV_SERVER_URL) .waitForElementVisible("#app", 5000) .setValue("input[id='inputUsername']", "bla") .setValue("input[id='inputPassword']", "bla") .click("button[type='submit']") .waitForElementVisible("#alert", 2000) .assert.elementPresent(".alert-danger") .end(); }, "Login oana success": browser => { browser .url(process.env.VUE_DEV_SERVER_URL) .waitForElementVisible("#app", 5000) .setValue("input[id='inputUsername']", "oana") .setValue("input[id='inputPassword']", "oa2Na2") .click("button[type='submit']") .pause(1000) .click(".userpic") .pause(1000) .assert.elementPresent(".username") .assert.containsText(".username", "oana") .end(); }, "Login oana switch url": browser => { browser .url(process.env.VUE_DEV_SERVER_URL) .waitForElementVisible("#app", 5000) .setValue("input[id='inputUsername']", "oana") .setValue("input[id='inputPassword']", "oa2Na2") .click("button[type='submit']") .pause(1000) .click(".userpic") .pause(1000) .assert.elementPresent(".username") .assert.containsText(".username", "oana") .url(process.env.VUE_DEV_SERVER_URL + "#/login") .pause(1000) .url(process.env.VUE_DEV_SERVER_URL + "#/") .assert.elementPresent(".username") .assert.containsText(".username", "oana") .end(); }, "Login switch user from oana to vanja": browser => { browser .url(process.env.VUE_DEV_SERVER_URL) .waitForElementVisible("#app", 5000) .setValue("input[id='inputUsername']", "oana") .setValue("input[id='inputPassword']", "oa2Na2") .click("button[type='submit']") .pause(1000) .click(".userpic") .pause(1000) .assert.elementPresent(".username") .assert.containsText(".username", "oana") .url(process.env.VUE_DEV_SERVER_URL + "#/login") .setValue("input[id='inputUsername']", "sophie") .setValue("input[id='inputPassword']", "so2Phie4") .click("button[type='submit']") .pause(1000) .assert.elementPresent(".username") .assert.containsText(".username", "sophie") .end(); } };