Skip to content

Commit 510d2ca

Browse files
Merge pull request #13931 from rabbitmq/fix-selenium-issue
Fix selenium issue closing popup warning dialog since recent upgrade
2 parents 6dd7447 + 27b3e21 commit 510d2ca

File tree

2 files changed

+21
-16
lines changed

2 files changed

+21
-16
lines changed

selenium/test/pageobjects/BasePage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const ADMIN_TAB = By.css('div#menu ul#tabs li#admin')
1414
const STREAM_CONNECTIONS_TAB = By.css('div#menu ul#tabs li#stream-connections')
1515

1616
const FORM_POPUP_WARNING = By.css('div.form-popup-warn')
17-
const FORM_POPUP_WARNING_CLOSE_BUTTON = By.css('div.form-popup-warn span#close')
17+
const FORM_POPUP_WARNING_CLOSE_BUTTON = By.css('div.form-popup-warn span')
1818

1919
const FORM_POPUP_OPTIONS = By.css('div.form-popup-options')
2020
const ADD_MINUS_BUTTON = By.css('div#main table.list thead tr th.plus-minus')

selenium/test/utils.js

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -64,28 +64,33 @@ module.exports = {
6464
let chromeCapabilities = Capabilities.chrome();
6565
const options = new chrome.Options()
6666
chromeCapabilities.setAcceptInsecureCerts(true);
67+
let seleniumArgs = [
68+
"--window-size=1920,1080",
69+
"--enable-automation",
70+
"guest",
71+
"disable-infobars",
72+
"--disable-notifications",
73+
"--lang=en",
74+
"--disable-search-engine-choice-screen",
75+
"disable-popup-blocking",
76+
"--credentials_enable_service=false",
77+
"profile.password_manager_enabled=false",
78+
"profile.reduce-security-for-testing",
79+
"profile.managed_default_content_settings.popups=1",
80+
"profile.managed_default_content_settings.notifications.popups=1",
81+
"profile.password_manager_leak_detection=false"
82+
]
83+
if (!runLocal) {
84+
seleniumArgs.push("--headless=new")
85+
}
6786
chromeCapabilities.set('goog:chromeOptions', {
6887
excludeSwitches: [ // disable info bar
6988
'enable-automation',
7089
],
7190
prefs: {
7291
'profile.password_manager_enabled' : false
7392
},
74-
args: [
75-
"--enable-automation",
76-
"guest",
77-
"disable-infobars",
78-
"--disable-notifications",
79-
"--lang=en",
80-
"--disable-search-engine-choice-screen",
81-
"disable-popup-blocking",
82-
"--credentials_enable_service=false",
83-
"profile.password_manager_enabled=false",
84-
"profile.reduce-security-for-testing",
85-
"profile.managed_default_content_settings.popups=1",
86-
"profile.managed_default_content_settings.notifications.popups=1",
87-
"profile.password_manager_leak_detection=false"
88-
]
93+
args: seleniumArgs
8994
});
9095
let driver = builder
9196
.forBrowser('chrome')

0 commit comments

Comments
 (0)