Skip to content

Commit

Permalink
Revert "Replace Leadfoot with WebDriver API (#26477)" (#31382)
Browse files Browse the repository at this point in the history
* Revert "Replace Leadfoot with WebDriver API (#26477)"

This reverts commit 0bd3b4f.

* leadfoot expectes execute args to be an array

* disable flaky graphql tests
  • Loading branch information
Spencer authored Feb 18, 2019
1 parent b4f3808 commit a48a03c
Show file tree
Hide file tree
Showing 32 changed files with 1,039 additions and 1,093 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ module.exports = {
*/
{
files: [
'test/functional/services/lib/web_element_wrapper/scroll_into_view_if_necessary.js',
'test/functional/services/lib/leadfoot_element_wrapper/scroll_into_view_if_necessary.js',
'**/browser_exec_scripts/**/*',
],
rules: {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@
"@types/eslint": "^4.16.2",
"@types/execa": "^0.9.0",
"@types/fetch-mock": "7.2.1",
"@types/json5": "^0.0.30",
"@types/getopts": "^2.0.0",
"@types/glob": "^5.0.35",
"@types/globby": "^8.0.0",
Expand All @@ -286,7 +287,6 @@
"@types/joi": "^13.4.2",
"@types/jquery": "^3.3.6",
"@types/js-yaml": "^3.11.1",
"@types/json5": "^0.0.30",
"@types/listr": "^0.13.0",
"@types/lodash": "^3.10.1",
"@types/minimatch": "^2.0.29",
Expand Down Expand Up @@ -373,6 +373,7 @@
"karma-junit-reporter": "1.2.0",
"karma-mocha": "1.3.0",
"karma-safari-launcher": "1.0.0",
"leadfoot": "1.7.5",
"license-checker": "^16.0.0",
"listr": "^0.14.1",
"load-grunt-config": "0.19.2",
Expand All @@ -392,7 +393,6 @@
"proxyquire": "1.7.11",
"regenerate": "^1.4.0",
"sass-lint": "^1.12.1",
"selenium-webdriver": "^4.0.0-alpha.1",
"simple-git": "1.37.0",
"sinon": "^5.0.7",
"strip-ansi": "^3.0.1",
Expand Down
1 change: 0 additions & 1 deletion src/dev/jest/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ export default {
'<rootDir>/src/setup_node_env',
'<rootDir>/packages',
'<rootDir>/src/test_utils',
'<rootDir>/test/functional/services/remote',
],
collectCoverageFrom: [
'packages/kbn-ui-framework/src/components/**/*.js',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export class ProviderCollection {
instance = createAsyncInstance(type, name, instance);
}

if (name !== '__webdriver__' && name !== 'log' && name !== 'config' && instance && typeof instance === 'object') {
if (name !== '__leadfoot__' && name !== 'log' && name !== 'config' && instance && typeof instance === 'object') {
instance = createVerboseInstance(
this._log,
type === 'PageObject' ? `PageObjects.${name}` : name,
Expand Down
5 changes: 3 additions & 2 deletions test/functional/apps/dashboard/_dashboard_grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ export default function ({ getService, getPageObjects }) {
const lastVisTitle = 'Rendering Test: datatable';
const panelTitleBeforeMove = await dashboardPanelActions.getPanelHeading(lastVisTitle);
const position1 = await panelTitleBeforeMove.getPosition();

await browser.dragAndDrop(
{ location: panelTitleBeforeMove },
{ location: { x: -20, y: -450 } }
{ element: panelTitleBeforeMove },
{ element: null, xOffset: -20, yOffset: -450 }
);

const panelTitleAfterMove = await dashboardPanelActions.getPanelHeading(lastVisTitle);
Expand Down
2 changes: 1 addition & 1 deletion test/functional/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export default async function ({ readConfigFile }) {
esArchiver: commonConfig.get('services.esArchiver'),
kibanaServer: commonConfig.get('services.kibanaServer'),
retry: commonConfig.get('services.retry'),
__webdriver__: RemoteProvider,
__leadfoot__: RemoteProvider,
filterBar: FilterBarProvider,
queryBar: QueryBarProvider,
find: FindProvider,
Expand Down
4 changes: 2 additions & 2 deletions test/functional/page_objects/discover_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ export function DiscoverPageProvider({ getService, getPageObjects }) {
async brushHistogram(from, to) {
const bars = await find.allByCssSelector('.series.histogram rect');
await browser.dragAndDrop(
{ location: bars[from], offset: { x: 0, y: -5 } },
{ location: bars[to], offset: { x: 0, y: -5 } }
{ element: bars[from], xOffset: 0, yOffset: -5 },
{ element: bars[to], xOffset: 0, yOffset: -5 }
);
}

Expand Down
14 changes: 0 additions & 14 deletions test/functional/page_objects/time_picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,6 @@ export function TimePickerPageProvider({ getService, getPageObjects }) {
return dateString.substring(0, 23);
}

async getTimePickerPanel() {
return await find.byCssSelector('div.euiPopover__panel-isOpen');
}

async waitPanelIsGone(panelElement) {
await find.waitForElementStale(panelElement);
}

/**
* @param {String} fromTime YYYY-MM-DD HH:mm:ss.SSS
* @param {String} fromTime YYYY-MM-DD HH:mm:ss.SSS
Expand All @@ -57,14 +49,11 @@ export function TimePickerPageProvider({ getService, getPageObjects }) {

// set to time
await testSubjects.click('superDatePickerendDatePopoverButton');
let panel = await this.getTimePickerPanel();
await testSubjects.click('superDatePickerAbsoluteTab');
await testSubjects.setValue('superDatePickerAbsoluteDateInput', toTime);

// set from time
await testSubjects.click('superDatePickerstartDatePopoverButton');
await this.waitPanelIsGone(panel);
panel = await this.getTimePickerPanel();
await testSubjects.click('superDatePickerAbsoluteTab');
await testSubjects.setValue('superDatePickerAbsoluteDateInput', fromTime);

Expand All @@ -79,7 +68,6 @@ export function TimePickerPageProvider({ getService, getPageObjects }) {
await testSubjects.click('querySubmitButton');
}

await this.waitPanelIsGone(panel);
await PageObjects.header.awaitGlobalLoadingIndicatorHidden();
}

Expand Down Expand Up @@ -157,13 +145,11 @@ export function TimePickerPageProvider({ getService, getPageObjects }) {

// get to time
await testSubjects.click('superDatePickerendDatePopoverButton');
const panel = await this.getTimePickerPanel();
await testSubjects.click('superDatePickerAbsoluteTab');
const end = await testSubjects.getAttribute('superDatePickerAbsoluteDateInput', 'value');

// get from time
await testSubjects.click('superDatePickerstartDatePopoverButton');
await this.waitPanelIsGone(panel);
await testSubjects.click('superDatePickerAbsoluteTab');
const start = await testSubjects.getAttribute('superDatePickerAbsoluteDateInput', 'value');

Expand Down
2 changes: 1 addition & 1 deletion test/functional/page_objects/visual_builder_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export function VisualBuilderPageProvider({ getService, getPageObjects }) {
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.pressKeys(browser.keys.BACKSPACE); // Delete all content
await input.type(markdown);
await PageObjects.visualize.waitForRenderingCount(prevRenderingCount + 1);
}
Expand Down
Loading

0 comments on commit a48a03c

Please sign in to comment.