|
1 | 1 | const { By, Key, until, Builder } = require('selenium-webdriver') |
2 | 2 | require('chromedriver') |
3 | 3 | const assert = require('assert') |
4 | | -const { buildDriver, goToHome, captureScreensFor, teardown, idpLoginPage } = require('../../utils') |
| 4 | +const { buildDriver, goToHome, captureScreensFor, teardown, idpLoginPage, log } = require('../../utils') |
5 | 5 |
|
6 | 6 | const SSOHomePage = require('../../pageobjects/SSOHomePage') |
7 | 7 | const OverviewPage = require('../../pageobjects/OverviewPage') |
@@ -40,6 +40,46 @@ describe('An user with administrator tag', function () { |
40 | 40 | await overview.logout() |
41 | 41 | }) |
42 | 42 |
|
| 43 | + describe("and logged in via OAuth 2.0", function() { |
| 44 | + before(async function() { |
| 45 | + await homePage.clickToLogin() |
| 46 | + await idpLogin.login('rabbit_admin', 'rabbit_admin') |
| 47 | + if (!await overview.isLoaded()) { |
| 48 | + throw new Error('Failed to login via OAuth 2.0') |
| 49 | + } |
| 50 | + }) |
| 51 | + it ('can reload page without being logged out', async function() { |
| 52 | + log("About to refresh page") |
| 53 | + await overview.refresh() |
| 54 | + if (!await overview.isLoaded()) { |
| 55 | + throw new Error('Failed to keep session opened') |
| 56 | + } |
| 57 | + }) |
| 58 | + after(async function () { |
| 59 | + await overview.logout() |
| 60 | + }) |
| 61 | + }) |
| 62 | + |
| 63 | + describe("and logged in via basic auth", function() { |
| 64 | + before(async function() { |
| 65 | + await homePage.toggleBasicAuthSection() |
| 66 | + await homePage.basicAuthLogin('guest', 'guest') |
| 67 | + if (!await overview.isLoaded()) { |
| 68 | + throw new Error('Failed to login') |
| 69 | + } |
| 70 | + }) |
| 71 | + it ('can reload page without being logged out', async function() { |
| 72 | + log("About to refresh page") |
| 73 | + await overview.refresh() |
| 74 | + if (!await overview.isLoaded()) { |
| 75 | + throw new Error('Failed to keep session opened') |
| 76 | + } |
| 77 | + }) |
| 78 | + after(async function () { |
| 79 | + await overview.logout() |
| 80 | + }) |
| 81 | + }) |
| 82 | + |
43 | 83 | after(async function () { |
44 | 84 | await teardown(driver, this, captureScreen) |
45 | 85 | }) |
|
0 commit comments