Mercurial > gemma
view client/tests/e2e/specs/login.js @ 326:a7b2db8b3d18
Added type for roles.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Thu, 02 Aug 2018 18:39:01 +0200 |
parents | 8f49ba6cddd9 |
children | d85d5e286dc5 |
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='inputEmail']", "bla") .setValue("input[id='inputPassword']", "bla") .click("button[type='submit']") .waitForElementVisible("#alert", 2000) .assert.elementPresent(".loginerror") .end(); }, "Login oana success": browser => { browser .url(process.env.VUE_DEV_SERVER_URL) .waitForElementVisible("#app", 5000) .setValue("input[id='inputEmail']", "oana") .setValue("input[id='inputPassword']", "oa2Na2") .click("button[type='submit']") .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='inputEmail']", "oana") .setValue("input[id='inputPassword']", "oa2Na2") .click("button[type='submit']") .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='inputEmail']", "oana") .setValue("input[id='inputPassword']", "oa2Na2") .click("button[type='submit']") .pause(1000) .assert.elementPresent(".username") .assert.containsText(".username", "oana") .url(process.env.VUE_DEV_SERVER_URL + "#/login") .setValue("input[id='inputEmail']", "vanja") .setValue("input[id='inputPassword']", "va2Nja3") .click("button[type='submit']") .pause(1000) .assert.elementPresent(".username") .assert.containsText(".username", "vanja") .end(); } };