Merge pull request #13931 from rabbitmq/fix-selenium-issue

Fix selenium issue closing popup warning dialog since recent upgrade
This commit is contained in:
Michael Klishin 2025-05-23 03:22:44 +04:00 committed by GitHub
commit 510d2ca0ab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 21 additions and 16 deletions

View File

@ -14,7 +14,7 @@ const ADMIN_TAB = By.css('div#menu ul#tabs li#admin')
const STREAM_CONNECTIONS_TAB = By.css('div#menu ul#tabs li#stream-connections')
const FORM_POPUP_WARNING = By.css('div.form-popup-warn')
const FORM_POPUP_WARNING_CLOSE_BUTTON = By.css('div.form-popup-warn span#close')
const FORM_POPUP_WARNING_CLOSE_BUTTON = By.css('div.form-popup-warn span')
const FORM_POPUP_OPTIONS = By.css('div.form-popup-options')
const ADD_MINUS_BUTTON = By.css('div#main table.list thead tr th.plus-minus')

View File

@ -64,6 +64,25 @@ module.exports = {
let chromeCapabilities = Capabilities.chrome();
const options = new chrome.Options()
chromeCapabilities.setAcceptInsecureCerts(true);
let seleniumArgs = [
"--window-size=1920,1080",
"--enable-automation",
"guest",
"disable-infobars",
"--disable-notifications",
"--lang=en",
"--disable-search-engine-choice-screen",
"disable-popup-blocking",
"--credentials_enable_service=false",
"profile.password_manager_enabled=false",
"profile.reduce-security-for-testing",
"profile.managed_default_content_settings.popups=1",
"profile.managed_default_content_settings.notifications.popups=1",
"profile.password_manager_leak_detection=false"
]
if (!runLocal) {
seleniumArgs.push("--headless=new")
}
chromeCapabilities.set('goog:chromeOptions', {
excludeSwitches: [ // disable info bar
'enable-automation',
@ -71,21 +90,7 @@ module.exports = {
prefs: {
'profile.password_manager_enabled' : false
},
args: [
"--enable-automation",
"guest",
"disable-infobars",
"--disable-notifications",
"--lang=en",
"--disable-search-engine-choice-screen",
"disable-popup-blocking",
"--credentials_enable_service=false",
"profile.password_manager_enabled=false",
"profile.reduce-security-for-testing",
"profile.managed_default_content_settings.popups=1",
"profile.managed_default_content_settings.notifications.popups=1",
"profile.password_manager_leak_detection=false"
]
args: seleniumArgs
});
let driver = builder
.forBrowser('chrome')