Skip to content
Snippets Groups Projects
Verified Commit 3bce2bb6 authored by Mark's avatar Mark
Browse files

Refactor tests

parent 9b08c051
No related branches found
No related tags found
1 merge request!2Minimal frontend
module.exports = {
'Login' : function (browser) {
const index = browser.page.index();
const navbar = index.section.navbar;
const login = browser.page.login()
index
.navigate()
.waitForElementVisible('@loginButton')
.click("@loginButton")
login
.waitForElementVisible('@loginButton')
.click("@loginButton")
......@@ -16,10 +13,13 @@ module.exports = {
.setValue('input[name=username]', browser.globals.adminUsername)
.setValue('input[name=password]', browser.globals.adminPassword)
.click('input[name=submit]')
index
.waitForElementVisible('@logoutButton')
},
'Index page layout after login with admin user' : function (browser) {
const index = browser.page.index();
const navbar = index.section.navbar;
index.navigate()
navbar
.assert.elementPresent('@oidc')
.assert.elementPresent('@users')
......
......@@ -8,11 +8,10 @@ module.exports = {
.assert.containsText('@banner', 'Welcome to OpenAppStack')
navbar
.assert.containsText('@loginButton', 'Login')
.assert.containsText('@loginButton', 'Login')
.end();
},
'Login screen' : function (browser) {
'Navigate to login screen' : function (browser) {
const login = browser.page.login()
const index = browser.page.index();
index.navigate()
......
module.exports = {
'Login' : function (browser) {
const index = browser.page.index();
const navbar = index.section.navbar;
const usermenu = navbar.section.usermenu;
const login = browser.page.login()
index.navigate()
.waitForElementVisible('@loginButton')
......@@ -18,13 +16,17 @@ module.exports = {
index
.waitForElementVisible('@logoutButton')
.assert.containsText('@logoutButton', 'Logout')
},
'Index page layout after login' : function (browser) {
const index = browser.page.index();
const navbar = index.section.navbar;
const usermenu = navbar.section.usermenu;
index.navigate()
usermenu
.assert.containsText("@userNameLabel", browser.globals.userUsername)
.assert.elementNotPresent("@logoutButton")
.click("@userNameLabel")
.assert.visible("@logoutButton")
navbar
.assert.elementPresent('@oidc')
.assert.elementNotPresent('@users')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment