Skip to content

Commit

Permalink
Use different selectors for account info and do not switch window whe…
Browse files Browse the repository at this point in the history
…n checking account page
  • Loading branch information
LukasHirt committed Jun 16, 2020
1 parent 86d13d7 commit b60ed51
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 18 deletions.
4 changes: 3 additions & 1 deletion src/components/UserMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
>
<ul class="uk-list">
<li>
<router-link v-translate to="/account">Manage your account</router-link>
<router-link id="oc-topbar-account-manage" v-translate to="/account"
>Manage your account</router-link
>
</li>
<li>
<router-link v-translate to="/" @click.native.prevent="logout">Log out</router-link>
Expand Down
9 changes: 3 additions & 6 deletions tests/acceptance/pageObjects/accountPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,12 @@ module.exports = {
return this.waitForElementVisible('@logoutButton').click('@logoutButton')
},
isPageVisible: async function() {
let isVisible = false
const handle = []
await this.api.windowHandles(function(result) {
handle.push(result.value[1])
})
await this.api.switchWindow(handle[0])
let isVisible = true

await this.api.element('@accountDisplay', result => {
isVisible = Object.keys(result.value).length > 0
})

return isVisible
}
},
Expand Down
18 changes: 7 additions & 11 deletions tests/acceptance/pageObjects/profilePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,26 @@ module.exports = {
commands: {
getUserProfileName: async function() {
let userInfo
await this.waitForElementVisible('@profileInfoContainer')
.waitForElementVisible('@userProfileName')
.api.element('@userProfileName', result => {
await this.waitForElementVisible('@userProfileName').api.element(
'@userProfileName',
result => {
this.api.elementIdText(result.value.ELEMENT, text => {
userInfo = text.value
})
})
}
)
return userInfo
},
browseToManageAccount: function() {
return this.waitForElementVisible('@manageAccount').click('@manageAccount')
}
},
elements: {
profileInfoContainer: {
selector: '#account-info-container'
},
userProfileName: {
selector: '//div/h3[@class="uk-card-title"]',
locateStrategy: 'xpath'
selector: '.oc-topbar-personal-label'
},
manageAccount: {
selector: '//div//span[.="Manage your account"]',
locateStrategy: 'xpath'
selector: '#oc-topbar-account-manage'
}
}
}

0 comments on commit b60ed51

Please sign in to comment.