Fix tests for permission check and role selection

This commit is contained in:
Benedikt Kulmann
2020-10-08 18:02:22 +02:00
committed by Michael Barz
parent 4716cd704b
commit 853642a805
4 changed files with 11 additions and 10 deletions

File diff suppressed because one or more lines are too long

View File

@@ -17,12 +17,12 @@
</oc-grid>
</template>
<template v-else-if="hasFailed">
<oc-alert variation="warning" no-close class="oc-m">
<oc-alert variation="warning" no-close class="oc-m" id="accounts-list-loading-failed">
<oc-icon name="warning" variation="warning" class="uk-float-left oc-mr-s" />
<translate>You don't have permissions to manage accounts.</translate>
</oc-alert>
</template>
<oc-loader v-else />
<oc-loader id="accounts-list-loader" v-else />
</div>
</div>
</template>

View File

@@ -117,7 +117,7 @@ module.exports = {
locateStrategy: 'xpath'
},
roleInRolesDropdown: {
selector: '//label[contains(@class, "accounts-roles-dropdown-role") and normalize-space()="%s"]',
selector: '//label[contains(@class, "accounts-roles-dropdown-role")]/span[normalize-space()="%s"]',
locateStrategy: 'xpath'
},
rolesDropdownTrigger: {
@@ -125,8 +125,10 @@ module.exports = {
locateStrategy: 'xpath'
},
loadingAccountsList: {
selector: '//div[contains(@class, "oc-loader")]',
locateStrategy: 'xpath'
selector: '#accounts-list-loader'
},
loadingAccountsListFailed: {
selector: '#accounts-list-loading-failed'
},
rowCheckbox: {
selector: '//input[@class="oc-checkbox"]',

View File

@@ -33,8 +33,7 @@ Then('the displayed role of user {string} should be {string} on the WebUI', func
Then('the user should not be able to see the accounts list on the WebUI', async function () {
return client.page.accountsPage()
.waitForAjaxCallsToStartAndFinish()
.waitForElementVisible('@loadingAccountsList')
.waitForElementNotPresent('@accountsListTable')
.waitForElementVisible('@loadingAccountsListFailed')
})
When('the user disables user/users {string} using the WebUI', function (usernames) {