From aaa41a45cd9e4c163342928d876eec9d8ee301be Mon Sep 17 00:00:00 2001 From: Marcial Rosales Date: Tue, 14 May 2024 11:59:36 +0200 Subject: [PATCH 1/3] Reproduce issue Select not to refresh (cherry picked from commit 4323dcf120f661e2a10c2418c1fdc0b736905fb5) --- deps/rabbitmq_management/selenium/test/basic-auth/logout.js | 1 + .../selenium/test/pageobjects/BasePage.js | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/deps/rabbitmq_management/selenium/test/basic-auth/logout.js b/deps/rabbitmq_management/selenium/test/basic-auth/logout.js index 1a3ab8881e06..6493c7059654 100644 --- a/deps/rabbitmq_management/selenium/test/basic-auth/logout.js +++ b/deps/rabbitmq_management/selenium/test/basic-auth/logout.js @@ -22,6 +22,7 @@ describe('When a logged in user', function () { it('logs out', async function () { await loginPage.login('guest', 'guest') await overview.isLoaded() + await overview.selectRefreshOption("Do not refresh") await overview.logout() await loginPage.isLoaded() }) diff --git a/deps/rabbitmq_management/selenium/test/pageobjects/BasePage.js b/deps/rabbitmq_management/selenium/test/pageobjects/BasePage.js index f44697d926d4..d8b620931033 100644 --- a/deps/rabbitmq_management/selenium/test/pageobjects/BasePage.js +++ b/deps/rabbitmq_management/selenium/test/pageobjects/BasePage.js @@ -4,7 +4,7 @@ const MENU_TABS = By.css('div#menu ul#tabs') const USER = By.css('li#logout') const LOGOUT_FORM = By.css('li#logout form') const SELECT_VHOSTS = By.css('select#show-vhost') - +const SELECT_REFRESH = By.css('ul#topnav li#interval select#update-every') const OVERVIEW_TAB = By.css('div#menu ul#tabs li#overview') const CONNECTIONS_TAB = By.css('div#menu ul#tabs li#connections') const CHANNELS_TAB = By.css('div#menu ul#tabs li#channels') @@ -36,7 +36,9 @@ module.exports = class BasePage { async getUser () { return this.getText(USER) } - + async selectRefreshOption(option) { + return this.selectOption(SELECT_REFRESH, option) + } async waitForOverviewTab() { return this.waitForDisplayed(OVERVIEW_TAB) } From ed6842537cbbdd46700cc4027fcbc15be32c9a27 Mon Sep 17 00:00:00 2001 From: Marcial Rosales Date: Tue, 14 May 2024 12:07:44 +0200 Subject: [PATCH 2/3] Reload page so that it takes the user to the home page (cherry picked from commit 4026c3bd038157ce3e4997c64d19780c9d6137de) --- deps/rabbitmq_management/priv/www/js/dispatcher.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deps/rabbitmq_management/priv/www/js/dispatcher.js b/deps/rabbitmq_management/priv/www/js/dispatcher.js index 0a472c8c391a..1d3f1a83f1f4 100644 --- a/deps/rabbitmq_management/priv/www/js/dispatcher.js +++ b/deps/rabbitmq_management/priv/www/js/dispatcher.js @@ -340,8 +340,8 @@ dispatcher_add(function(sammy) { oauth.logged_in = false; oauth_initiateLogout(); }else { - go_to_home() -// location.reload(); +// go_to_home() + location.reload(); } }); From 4bf66abec4820838f15d1408cb74bc5487f6cd1b Mon Sep 17 00:00:00 2001 From: Marcial Rosales Date: Tue, 14 May 2024 12:13:16 +0200 Subject: [PATCH 3/3] Add missing function It was not backported from v3.11 (cherry picked from commit f015f34be089eb256577ab898be37f66df5e7fad) --- deps/rabbitmq_management/priv/www/js/dispatcher.js | 3 +-- deps/rabbitmq_management/priv/www/js/oidc-oauth/helper.js | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/deps/rabbitmq_management/priv/www/js/dispatcher.js b/deps/rabbitmq_management/priv/www/js/dispatcher.js index 1d3f1a83f1f4..e0e520715fe4 100644 --- a/deps/rabbitmq_management/priv/www/js/dispatcher.js +++ b/deps/rabbitmq_management/priv/www/js/dispatcher.js @@ -340,8 +340,7 @@ dispatcher_add(function(sammy) { oauth.logged_in = false; oauth_initiateLogout(); }else { -// go_to_home() - location.reload(); + go_to_home() } }); diff --git a/deps/rabbitmq_management/priv/www/js/oidc-oauth/helper.js b/deps/rabbitmq_management/priv/www/js/oidc-oauth/helper.js index 03820e1a544e..cd364022f97b 100644 --- a/deps/rabbitmq_management/priv/www/js/oidc-oauth/helper.js +++ b/deps/rabbitmq_management/priv/www/js/oidc-oauth/helper.js @@ -225,6 +225,9 @@ function oauth_redirectToHome(oauth) { function go_to(path) { location.href = rabbit_path_prefix() + "/" + path } +function go_to_home() { + location.href = rabbit_path_prefix() + "/" +} function go_to_authority() { location.href = oauth.authority }