From 25bc6995cc3ade994d9f2c7c1f53ad4a53a67c9e Mon Sep 17 00:00:00 2001 From: saw-jan Date: Fri, 18 Feb 2022 12:41:04 +0545 Subject: [PATCH] do not wait for oC authorize page remove authorizePage, fix steps --- .../features/webUILogin/oauthLogin.feature | 1 - tests/acceptance/helpers/loginHelper.js | 1 - .../pageObjects/ownCloudAuthorizePage.js | 57 ------------------- .../stepDefinitions/loginContext.js | 12 +--- 4 files changed, 1 insertion(+), 70 deletions(-) delete mode 100644 tests/acceptance/pageObjects/ownCloudAuthorizePage.js diff --git a/tests/acceptance/features/webUILogin/oauthLogin.feature b/tests/acceptance/features/webUILogin/oauthLogin.feature index dbb5f7eb3a6..0f2454fc4e7 100644 --- a/tests/acceptance/features/webUILogin/oauthLogin.feature +++ b/tests/acceptance/features/webUILogin/oauthLogin.feature @@ -15,7 +15,6 @@ Feature: login users Scenario: admin login Given the user has browsed to the login page When the user logs in with username "admin" and password "admin" using the webUI - And the user authorizes access to web Then the files table should be displayed And the files table should not be empty diff --git a/tests/acceptance/helpers/loginHelper.js b/tests/acceptance/helpers/loginHelper.js index dbc97a9d5da..4e5cfd60ac5 100644 --- a/tests/acceptance/helpers/loginHelper.js +++ b/tests/acceptance/helpers/loginHelper.js @@ -21,7 +21,6 @@ module.exports = { await client.page.ocisLoginPage().login(userId, password) } else { await client.page.ownCloudLoginPage().login(userId, password) - await client.page.ownCloudAuthorizePage().authorize() } await client.page .webPage() diff --git a/tests/acceptance/pageObjects/ownCloudAuthorizePage.js b/tests/acceptance/pageObjects/ownCloudAuthorizePage.js deleted file mode 100644 index 1eece00b57c..00000000000 --- a/tests/acceptance/pageObjects/ownCloudAuthorizePage.js +++ /dev/null @@ -1,57 +0,0 @@ -module.exports = { - url: function () { - return this.api.launchUrl - }, - elements: { - body: { - selector: '#body-login' - }, - authorizeButton: { - selector: 'button[type=submit]' - }, - inputUsername: { - selector: '//input[@id="user"]', - locateStrategy: 'xpath' - } - }, - commands: [ - { - authorize: function () { - return this.waitForElementVisible('@authorizeButton') - .click('@authorizeButton') - .waitForElementNotPresent( - { - selector: '@authorizeButton', - abortOnFailure: false - }, - (result) => { - if (result.value.length > 0) { - // click failed - console.log( - "WARNING: looks like I'm still on auth page. " + - 'I will click the auth button again' - ) - this.click('@authorizeButton').waitForElementNotPresent('@authorizeButton') - } - } - ) - }, - waitForPage: async function () { - let isLoginPageVisible = false - - await this.waitForElementVisible('@body') - await this.api.element('@inputUsername', (result) => { - if (result.status > -1) { - isLoginPageVisible = true - } - }) - - if (isLoginPageVisible) { - return this.assert.ok(isLoginPageVisible) - } - - return this.api.expect.element(this.elements.authorizeButton.selector).to.be.visible - } - } - ] -} diff --git a/tests/acceptance/stepDefinitions/loginContext.js b/tests/acceptance/stepDefinitions/loginContext.js index 812269815ed..4c60f33b04d 100644 --- a/tests/acceptance/stepDefinitions/loginContext.js +++ b/tests/acceptance/stepDefinitions/loginContext.js @@ -7,8 +7,6 @@ Given(/^the user has browsed to the login page$/, () => { return client.page.loginPage().navigate() }) -Given('the user has clicked the authenticate button', () => client.page.loginPage().authenticate()) - When('the user clicks the authenticate button', () => client.page.loginPage().authenticate()) When( @@ -33,10 +31,6 @@ When( When('user {string} logs in using the webUI', (username) => loginHelper.loginAsUser(username)) -When('the user authorizes access to web', () => { - return client.page.ownCloudAuthorizePage().authorize() -}) - Then('the files table should not be empty', () => { return ( client.page.FilesPageElement.filesList() @@ -110,11 +104,7 @@ Then('the user should be redirected to the user disabled page', function () { }) Then('the user should be redirected to the IdP login page', function () { - if (client.globals.openid_login) { - return client.page.ocisLoginPage().waitForPage() - } - - return client.page.ownCloudAuthorizePage().waitForPage() + return client.page.ocisLoginPage().waitForPage() }) Then('the user should be redirected to the login error page', function () {