[7.x] bump chromedriver to 2.46.0 (#27302) (#35009)

* bump chromedriver to 2.46.0 (#27302)

* bump chromedriver up to 2.46.0

* print chromedriver version

* [services/web_element_wrapper] use js to clear input field

* add clearValueWithKeyboard

* fix clearing datePattern input

* fix scripted fileds preview tests

* [tests/infra] fix input clearing (#35028)
This commit is contained in:
Dmitry Lemeshko 2019-04-13 12:51:32 +02:00 committed by GitHub
parent c570923067
commit 9cfe1ee839
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 81 additions and 30 deletions

View file

@ -332,7 +332,7 @@
"chance": "1.0.10",
"cheerio": "0.22.0",
"chokidar": "1.6.0",
"chromedriver": "2.42.1",
"chromedriver": "2.46.0",
"classnames": "2.2.5",
"dedent": "^0.7.0",
"delete-empty": "^2.0.0",

View file

@ -262,7 +262,7 @@ export function SettingsPageProvider({ getService, getPageObjects }) {
async increasePopularity() {
const field = await testSubjects.find('editorFieldCount');
await field.clearValue();
await field.clearValueWithKeyboard();
await field.type('1');
}
@ -487,7 +487,9 @@ export function SettingsPageProvider({ getService, getPageObjects }) {
const datePatternField = await find.byCssSelector(
'input[data-test-subj="dateEditorPattern"]'
);
await datePatternField.clearValue();
// Both clearValue & clearValueWithKeyboard does not work here
// Send Backspace event for each char in value string to clear field
await datePatternField.clearValueWithKeyboard({ charByChar: true });
await datePatternField.type(datePattern);
}
@ -508,7 +510,11 @@ export function SettingsPageProvider({ getService, getPageObjects }) {
async setScriptedFieldScript(script) {
log.debug('set scripted field script = ' + script);
const field = await testSubjects.find('editorFieldScript');
await field.clearValue();
const currentValue = await field.getAttribute('value');
if (script === currentValue) {
return;
}
await field.clearValueWithKeyboard({ charByChar: true });
await field.type(script);
}
@ -541,7 +547,9 @@ export function SettingsPageProvider({ getService, getPageObjects }) {
await this.openScriptedFieldHelp('testTab');
if (additionalField) {
await comboBox.set('additionalFieldsSelect', additionalField);
await testSubjects.find('scriptedFieldPreview');
await testSubjects.click('runScriptButton');
await testSubjects.waitForDeleted('.euiLoadingSpinner');
}
let scriptResults;
await retry.try(async () => {

View file

@ -91,13 +91,7 @@ export function VisualBuilderPageProvider({ getService, getPageObjects }: FtrPro
// Since we use ACE editor and that isn't really storing its value inside
// a textarea we must really select all text and remove it, and cannot use
// clearValue().
if (process.platform === 'darwin') {
await input.pressKeys([browser.keys.COMMAND, 'a']); // Select all Mac
} else {
await input.pressKeys([browser.keys.CONTROL, 'a']); // Select all for everything else
}
await input.pressKeys(browser.keys.NULL); // Release modifier keys
await input.pressKeys(browser.keys.BACK_SPACE); // Delete all content
await input.clearValueWithKeyboard();
}
public async getMarkdownText() {

View file

@ -116,7 +116,28 @@ export class WebElementWrapper {
* @return {Promise<void>}
*/
async clearValue() {
await this._webElement.clear();
// https://bugs.chromium.org/p/chromedriver/issues/detail?id=2702
// await this._webElement.clear();
await this._driver.executeScript(`arguments[0].value=''`, this._webElement);
}
/**
* Clear the value of this element using Keyboard
* @param { charByChar: false } options
*/
async clearValueWithKeyboard(options = { charByChar: false }) {
if (options.charByChar === true) {
const value = await this.getAttribute('value');
for (let i = 1; i <= value.length; i++) {
await this.pressKeys(this._Keys.BACK_SPACE);
await delay(100);
}
} else {
const selectionKey = this._Keys[process.platform === 'darwin' ? 'COMMAND' : 'CONTROL'];
await this.pressKeys([selectionKey, 'a']);
await this.pressKeys(this._Keys.NULL); // Release modifier keys
await this.pressKeys(this._Keys.BACK_SPACE); // Delete all content
}
}
/**

View file

@ -38,6 +38,10 @@ export async function RemoteProvider({ getService }: FtrProviderContext) {
log.info(`Remote initialized: ${caps.get('browserName')} ${browserVersion}`);
if (browserType === 'chrome') {
log.info(`Chromedriver version: ${caps.get('chrome').chromedriverVersion}`);
}
lifecycle.on('beforeTests', async () => {
// hard coded default, can be overridden per suite using `browser.setWindowSize()`
// and will be automatically reverted after each suite

View file

@ -37,11 +37,11 @@ export default ({ getPageObjects, getService }: KibanaFunctionalTestDefaultProvi
await pageObjects.infraLogs.openSourceConfigurationFlyout();
const nameInput = await infraSourceConfigurationFlyout.getNameInput();
await nameInput.clearValue();
await nameInput.clearValueWithKeyboard({ charByChar: true });
await nameInput.type('Modified Source');
const logIndicesInput = await infraSourceConfigurationFlyout.getLogIndicesInput();
await logIndicesInput.clearValue();
await logIndicesInput.clearValueWithKeyboard({ charByChar: true });
await logIndicesInput.type('does-not-exist-*');
await infraSourceConfigurationFlyout.saveConfiguration();
@ -56,7 +56,7 @@ export default ({ getPageObjects, getService }: KibanaFunctionalTestDefaultProvi
await pageObjects.infraLogs.openSourceConfigurationFlyout();
const logIndicesInput = await infraSourceConfigurationFlyout.getLogIndicesInput();
await logIndicesInput.clearValue();
await logIndicesInput.clearValueWithKeyboard({ charByChar: true });
await logIndicesInput.type('filebeat-*');
await infraSourceConfigurationFlyout.saveConfiguration();

View file

@ -41,11 +41,11 @@ export default ({ getPageObjects, getService }: KibanaFunctionalTestDefaultProvi
await pageObjects.infraHome.openSourceConfigurationFlyout();
const nameInput = await infraSourceConfigurationFlyout.getNameInput();
await nameInput.clearValue();
await nameInput.clearValueWithKeyboard({ charByChar: true });
await nameInput.type('Modified Source');
const metricIndicesInput = await infraSourceConfigurationFlyout.getMetricIndicesInput();
await metricIndicesInput.clearValue();
await metricIndicesInput.clearValueWithKeyboard({ charByChar: true });
await metricIndicesInput.type('does-not-exist-*');
await infraSourceConfigurationFlyout.saveConfiguration();
@ -60,7 +60,7 @@ export default ({ getPageObjects, getService }: KibanaFunctionalTestDefaultProvi
await pageObjects.infraHome.openSourceConfigurationFlyout();
const metricIndicesInput = await infraSourceConfigurationFlyout.getMetricIndicesInput();
await metricIndicesInput.clearValue();
await metricIndicesInput.clearValueWithKeyboard({ charByChar: true });
await metricIndicesInput.type('metricbeat-*');
await infraSourceConfigurationFlyout.saveConfiguration();

View file

@ -6748,16 +6748,16 @@ chrome-trace-event@^1.0.0:
dependencies:
tslib "^1.9.0"
chromedriver@2.42.1:
version "2.42.1"
resolved "https://registry.yarnpkg.com/chromedriver/-/chromedriver-2.42.1.tgz#566964c1221fbd9fd1ce836734dd92735f1ff8fb"
integrity sha512-ciiSoIZH3Pq3UNvNgITb717MP5aldpvte4BO5sLi/FBeahMoo6QZiQ7kDIG1LQY6yZh7N8dqjjiYENq2/J+Xlw==
chromedriver@2.46.0:
version "2.46.0"
resolved "https://registry.yarnpkg.com/chromedriver/-/chromedriver-2.46.0.tgz#3d78e7eb9bb65dd804fe327a6bf76fced12be053"
integrity sha512-dLtKIJW3y/PuFrPmcw6Mb8Nh+HwSqgVrK1rWgTARXhHfWvV822X2VRkx2meU/tg2+YQL6/nNgT6n5qWwIDHbwg==
dependencies:
del "^3.0.0"
extract-zip "^1.6.7"
kew "^0.7.0"
mkdirp "^0.5.1"
request "^2.87.0"
request "^2.88.0"
tcp-port-used "^1.0.1"
ci-info@^1.0.0:
version "1.1.2"
@ -8564,6 +8564,13 @@ debug@3.X, debug@^3.1.0, debug@^3.2.5:
dependencies:
ms "^2.1.1"
debug@4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.0.tgz#373687bffa678b38b1cd91f861b63850035ddc87"
integrity sha512-heNPJUJIqC+xB6ayLAMHaIrmN9HKa7aQO8MGqKpvCA+uJYVcvR6l5kgdrhRuwPFHU7P5/A1w0BjByPHwpfTDKg==
dependencies:
ms "^2.1.1"
debug@^4.0.1, debug@^4.1.0, debug@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791"
@ -8680,7 +8687,7 @@ deep-extend@^0.6.0:
resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac"
integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==
deep-is@~0.1.3:
deep-is@^0.1.3, deep-is@~0.1.3:
version "0.1.3"
resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34"
integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=
@ -14354,6 +14361,11 @@ is-upper-case@^1.1.0:
dependencies:
upper-case "^1.1.0"
is-url@^1.2.2:
version "1.2.4"
resolved "https://registry.yarnpkg.com/is-url/-/is-url-1.2.4.tgz#04a4df46d28c4cff3d73d01ff06abeb318a1aa52"
integrity sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww==
is-utf8@^0.2.0, is-utf8@^0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72"
@ -14396,6 +14408,15 @@ is-wsl@^1.1.0:
resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d"
integrity sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=
is2@2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/is2/-/is2-2.0.1.tgz#8ac355644840921ce435d94f05d3a94634d3481a"
integrity sha512-+WaJvnaA7aJySz2q/8sLjMb2Mw14KTplHmSwcSpZ/fWJPkUmqw3YTzSWbPJ7OAwRvdYTWF2Wg+yYJ1AdP5Z8CA==
dependencies:
deep-is "^0.1.3"
ip-regex "^2.1.0"
is-url "^1.2.2"
isarray@0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf"
@ -15560,11 +15581,6 @@ kdbush@^3.0.0:
resolved "https://registry.yarnpkg.com/kdbush/-/kdbush-3.0.0.tgz#f8484794d47004cc2d85ed3a79353dbe0abc2bf0"
integrity sha512-hRkd6/XW4HTsA9vjVpY9tuXJYLSlelnkTmVFu4M9/7MIYQtFcHpbugAU7UbOfjOiVSVYl2fqgBuJ32JUmRo5Ew==
kew@^0.7.0:
version "0.7.0"
resolved "https://registry.yarnpkg.com/kew/-/kew-0.7.0.tgz#79d93d2d33363d6fdd2970b335d9141ad591d79b"
integrity sha1-edk9LTM2PW/dKXCzNdkUGtWR15s=
keycode@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/keycode/-/keycode-2.2.0.tgz#3d0af56dc7b8b8e5cba8d0a97f107204eec22b04"
@ -23859,6 +23875,14 @@ tar@^4:
safe-buffer "^5.1.2"
yallist "^3.0.2"
tcp-port-used@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/tcp-port-used/-/tcp-port-used-1.0.1.tgz#46061078e2d38c73979a2c2c12b5a674e6689d70"
integrity sha512-rwi5xJeU6utXoEIiMvVBMc9eJ2/ofzB+7nLOdnZuFTmNCLqRiQh2sMG9MqCxHU/69VC/Fwp5dV9306Qd54ll1Q==
dependencies:
debug "4.1.0"
is2 "2.0.1"
teamwork@3.x.x:
version "3.0.1"
resolved "https://registry.yarnpkg.com/teamwork/-/teamwork-3.0.1.tgz#ff38c7161f41f8070b7813716eb6154036ece196"