Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tests-Only] Add ui test for checking the browser session of deleted user #4543

Merged
merged 1 commit into from
Dec 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions tests/acceptance/expected-failures-with-oc10-server.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@
#
webUIPreview/imageMediaViewer.feature:70
webUIPreview/imageMediaViewer.feature:76

# https://github.com/owncloud/web/issues/4564 authentication dialog appears when user is deleted
webUILogin/login.feature:59
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@
#
webUIPreview/imageMediaViewer.feature:70
webUIPreview/imageMediaViewer.feature:76

# https://github.com/owncloud/web/issues/4564 authentication dialog appears when user is deleted
# https://github.com/owncloud/ocis/issues/1129 login error page loops when logged in user is deleted
webUILogin/login.feature:59
11 changes: 11 additions & 0 deletions tests/acceptance/features/webUILogin/login.feature
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,14 @@ Feature: login users
Then the files table should be displayed
# Then the warning 'Logon failed. Please verify your credentials and try again.' should be displayed on the login page

Scenario: the user session of a deleted user is cleared properly
Given these users have been created with default attributes:
| username |
| user1 |
And user "user1" has logged in using the webUI
And the user has browsed to the files page
And user "user1" has been deleted
When the user reloads the current page of the webUI
Then the user should be redirected to the login error page
When the user exits the login error page
Then the user should be redirected to the login page
27 changes: 27 additions & 0 deletions tests/acceptance/pageObjects/loginErrorPage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { join } from '../helpers/path'

module.exports = {
url: function() {
return join(this.api.launchUrl, '/#/access-denied')
},
elements: {
body: 'body',
loginErrorMessage: {
locateStrategy: 'xpath',
selector: '//span[@data-msgid="Login Error"]'
},
exitButton: {
selector: '#exitAnchor'
}
},
commands: {
waitTillLoaded: function() {
const element = this.elements.loginErrorMessage
return this.useStrategy(element).waitForElementVisible(element)
},
exit: function() {
const exitBtn = this.elements.exitButton
return this.waitForElementVisible(exitBtn).click(exitBtn)
}
}
}
8 changes: 8 additions & 0 deletions tests/acceptance/stepDefinitions/loginContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,11 @@ Then('the user should be redirected to the IdP login page', function() {

return client.page.ownCloudAuthorizePage().waitForPage()
})

Then('the user should be redirected to the login error page', function() {
return client.page.loginErrorPage().waitTillLoaded()
})

When('the user exits the login error page', function() {
return client.page.loginErrorPage().exit()
})
4 changes: 4 additions & 0 deletions tests/acceptance/stepDefinitions/provisioningContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ Given('user {string} has been created with default attributes', async function(u
await initUser(userId)
})

Given('user {string} has been deleted', function(userId) {
return deleteUser(userId)
})

Given('user {string} has been created with default attributes on remote server', function(userId) {
return backendHelper.runOnRemoteBackend(async function() {
await deleteUser()
Expand Down