Skip to content

Commit 7c58649

Browse files
Reduce by 5 seconds every oauth2 test
clickToLogin sbould only check that the login button exists and not that the warning messages is not visible
1 parent b409d97 commit 7c58649

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

deps/rabbitmq_management/selenium/test/oauth/with-sp-initiated/logout.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const { By, Key, until, Builder } = require('selenium-webdriver')
22
require('chromedriver')
33
const assert = require('assert')
4-
const { buildDriver, goToHome, captureScreensFor, teardown } = require('../../utils')
4+
const { buildDriver, goToHome, captureScreensFor, teardown, log } = require('../../utils')
55

66
const SSOHomePage = require('../../pageobjects/SSOHomePage')
77
const UAALoginPage = require('../../pageobjects/UAALoginPage')
@@ -27,6 +27,7 @@ describe('When a logged in user', function () {
2727
await overview.isLoaded()
2828
await overview.logout()
2929
await homePage.isLoaded()
30+
3031
})
3132

3233
after(async function () {

deps/rabbitmq_management/selenium/test/pageobjects/BasePage.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ module.exports = class BasePage {
2222
this.driver = webdriver
2323
// this is another timeout (--timeout 10000) which is the maximum test execution time
2424
this.timeout = parseInt(process.env.TIMEOUT) || 5000 // max time waiting to locate an element. Should be less that test timeout
25-
this.polling = parseInt(process.env.POLLING) || 1000 // how frequent selenium searches for an element
25+
this.polling = parseInt(process.env.POLLING) || 500 // how frequent selenium searches for an element
2626
}
2727

2828
async isLoaded () {
@@ -181,6 +181,9 @@ module.exports = class BasePage {
181181
await this.driver.sleep(250)
182182
return alert.accept();
183183
}
184+
log(message) {
185+
console.log(new Date() + " " + message)
186+
}
184187

185188
capture () {
186189
this.driver.takeScreenshot().then(

deps/rabbitmq_management/selenium/test/pageobjects/SSOHomePage.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module.exports = class SSOHomePage extends BasePage {
1212

1313
async clickToLogin () {
1414
await this.isLoaded()
15-
if (!await this.isWarningVisible()) {
15+
if (await this.waitForDisplayed(LOGIN_BUTTON)) {
1616
return this.click(LOGIN_BUTTON)
1717
} else {
1818
this.capture()
@@ -27,7 +27,7 @@ module.exports = class SSOHomePage extends BasePage {
2727

2828
async isWarningVisible () {
2929
try {
30-
await this.getText(WARNING)
30+
await this.waitForDisplayed(WARNING)
3131
return Promise.resolve(true)
3232
} catch (e) {
3333
return Promise.resolve(false)

deps/rabbitmq_management/selenium/test/utils.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ class CaptureScreenshot {
3232
}
3333

3434
module.exports = {
35+
log: (message) => {
36+
console.log(new Date() + " " + message)
37+
},
38+
3539
buildDriver: (caps) => {
3640
builder = new Builder()
3741
if (!runLocal) {

0 commit comments

Comments
 (0)