Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore webdriver-based functional test runner driver #31446

Merged
merged 14 commits into from
Mar 2, 2019
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
143 changes: 124 additions & 19 deletions .ci/jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,131 @@ JOB:
- kibana-intake
- x-pack-intake
# make sure all kibana-ciGRoups are listed in tasks/function_test_groups.js
- kibana-ciGroup1
- kibana-ciGroup2
- kibana-ciGroup3
- kibana-ciGroup4
- kibana-ciGroup5
- kibana-ciGroup6
- kibana-ciGroup7
- kibana-ciGroup8
- kibana-ciGroup9
- kibana-ciGroup10
- kibana-ciGroup11
- kibana-ciGroup12
- kibana-ciGroup1-1
- kibana-ciGroup2-1
- kibana-ciGroup3-1
- kibana-ciGroup4-1
- kibana-ciGroup5-1
- kibana-ciGroup6-1
- kibana-ciGroup7-1
- kibana-ciGroup8-1
- kibana-ciGroup9-1
- kibana-ciGroup10-1
- kibana-ciGroup11-1
- kibana-ciGroup12-1
# make sure all x-pack-ciGroups are listed in test/scripts/jenkins_xpack_ci_group.sh
- x-pack-ciGroup1
- x-pack-ciGroup2
- x-pack-ciGroup3
- x-pack-ciGroup4
- x-pack-ciGroup5
- x-pack-ciGroup6
- x-pack-ciGroup7
- x-pack-ciGroup1-1
- x-pack-ciGroup2-1
- x-pack-ciGroup3-1
- x-pack-ciGroup4-1
- x-pack-ciGroup5-1
- x-pack-ciGroup6-1
- x-pack-ciGroup7-1

- kibana-ciGroup1-2
- kibana-ciGroup2-2
- kibana-ciGroup3-2
- kibana-ciGroup4-2
- kibana-ciGroup5-2
- kibana-ciGroup6-2
- kibana-ciGroup7-2
- kibana-ciGroup8-2
- kibana-ciGroup9-2
- kibana-ciGroup10-2
- kibana-ciGroup11-2
- kibana-ciGroup12-2
# make sure all x-pack-ciGroups are listed in test/scripts/jenkins_xpack_ci_group.sh
- x-pack-ciGroup1-2
- x-pack-ciGroup2-2
- x-pack-ciGroup3-2
- x-pack-ciGroup4-2
- x-pack-ciGroup5-2
- x-pack-ciGroup6-2
- x-pack-ciGroup7-2

- kibana-ciGroup1-3
- kibana-ciGroup2-3
- kibana-ciGroup3-3
- kibana-ciGroup4-3
- kibana-ciGroup5-3
- kibana-ciGroup6-3
- kibana-ciGroup7-3
- kibana-ciGroup8-3
- kibana-ciGroup9-3
- kibana-ciGroup10-3
- kibana-ciGroup11-3
- kibana-ciGroup12-3
# make sure all x-pack-ciGroups are listed in test/scripts/jenkins_xpack_ci_group.sh
- x-pack-ciGroup1-3
- x-pack-ciGroup2-3
- x-pack-ciGroup3-3
- x-pack-ciGroup4-3
- x-pack-ciGroup5-3
- x-pack-ciGroup6-3
- x-pack-ciGroup7-3

- kibana-ciGroup1-4
- kibana-ciGroup2-4
- kibana-ciGroup3-4
- kibana-ciGroup4-4
- kibana-ciGroup5-4
- kibana-ciGroup6-4
- kibana-ciGroup7-4
- kibana-ciGroup8-4
- kibana-ciGroup9-4
- kibana-ciGroup10-4
- kibana-ciGroup11-4
- kibana-ciGroup12-4
# make sure all x-pack-ciGroups are listed in test/scripts/jenkins_xpack_ci_group.sh
- x-pack-ciGroup1-4
- x-pack-ciGroup2-4
- x-pack-ciGroup3-4
- x-pack-ciGroup4-4
- x-pack-ciGroup5-4
- x-pack-ciGroup6-4
- x-pack-ciGroup7-4

- kibana-ciGroup1-5
- kibana-ciGroup2-5
- kibana-ciGroup3-5
- kibana-ciGroup4-5
- kibana-ciGroup5-5
- kibana-ciGroup6-5
- kibana-ciGroup7-5
- kibana-ciGroup8-5
- kibana-ciGroup9-5
- kibana-ciGroup10-5
- kibana-ciGroup11-5
- kibana-ciGroup12-5
# make sure all x-pack-ciGroups are listed in test/scripts/jenkins_xpack_ci_group.sh
- x-pack-ciGroup1-5
- x-pack-ciGroup2-5
- x-pack-ciGroup3-5
- x-pack-ciGroup4-5
- x-pack-ciGroup5-5
- x-pack-ciGroup6-5
- x-pack-ciGroup7-5

- kibana-ciGroup1-6
- kibana-ciGroup2-6
- kibana-ciGroup3-6
- kibana-ciGroup4-6
- kibana-ciGroup5-6
- kibana-ciGroup6-6
- kibana-ciGroup7-6
- kibana-ciGroup8-6
- kibana-ciGroup9-6
- kibana-ciGroup10-6
- kibana-ciGroup11-6
- kibana-ciGroup12-6
# make sure all x-pack-ciGroups are listed in test/scripts/jenkins_xpack_ci_group.sh
- x-pack-ciGroup1-6
- x-pack-ciGroup2-6
- x-pack-ciGroup3-6
- x-pack-ciGroup4-6
- x-pack-ciGroup5-6
- x-pack-ciGroup6-6
- x-pack-ciGroup7-6

# `~` is yaml for `null`
exclude: ~
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/leadfoot_element_wrapper/scroll_into_view_if_necessary.js',
'test/functional/services/lib/web_element_wrapper/scroll_into_view_if_necessary.js',
'**/browser_exec_scripts/**/*',
],
rules: {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,6 @@
"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,6 +391,7 @@
"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: 1 addition & 0 deletions src/dev/jest/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ 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
6 changes: 4 additions & 2 deletions src/functional_test_runner/lib/mocha/setup_mocha.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@ export async function setupMocha(lifecycle, log, config, providers) {
filterSuitesByTags({
log,
mocha,
include: config.get('suiteTags.include'),
exclude: config.get('suiteTags.exclude'),
include: config.get('suiteTags.include')
.map(tag => tag.replace(/-\d+$/, '')),
exclude: config.get('suiteTags.exclude')
.map(tag => tag.replace(/-\d+$/, ''))
});

return mocha;
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 !== '__leadfoot__' && name !== 'log' && name !== 'config' && instance && typeof instance === 'object') {
if (name !== '__webdriver__' && name !== 'log' && name !== 'config' && instance && typeof instance === 'object') {
instance = createVerboseInstance(
this._log,
type === 'PageObject' ? `PageObjects.${name}` : name,
Expand Down
84 changes: 72 additions & 12 deletions tasks/function_test_groups.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,78 @@ import grunt from 'grunt';
* and to the list of jobs in .ci/jobs.yml
*/
const TEST_TAGS = [
'ciGroup1',
'ciGroup2',
'ciGroup3',
'ciGroup4',
'ciGroup5',
'ciGroup6',
'ciGroup7',
'ciGroup8',
'ciGroup9',
'ciGroup10',
'ciGroup11',
'ciGroup12'
'ciGroup1-1',
'ciGroup2-1',
'ciGroup3-1',
'ciGroup4-1',
'ciGroup5-1',
'ciGroup6-1',
'ciGroup7-1',
'ciGroup8-1',
'ciGroup9-1',
'ciGroup10-1',
'ciGroup11-1',
'ciGroup12-1',
'ciGroup1-2',
'ciGroup2-2',
'ciGroup3-2',
'ciGroup4-2',
'ciGroup5-2',
'ciGroup6-2',
'ciGroup7-2',
'ciGroup8-2',
'ciGroup9-2',
'ciGroup10-2',
'ciGroup11-2',
'ciGroup12-2',
'ciGroup1-3',
'ciGroup2-3',
'ciGroup3-3',
'ciGroup4-3',
'ciGroup5-3',
'ciGroup6-3',
'ciGroup7-3',
'ciGroup8-3',
'ciGroup9-3',
'ciGroup10-3',
'ciGroup11-3',
'ciGroup12-3',
'ciGroup1-4',
'ciGroup2-4',
'ciGroup3-4',
'ciGroup4-4',
'ciGroup5-4',
'ciGroup6-4',
'ciGroup7-4',
'ciGroup8-4',
'ciGroup9-4',
'ciGroup10-4',
'ciGroup11-4',
'ciGroup12-4',
'ciGroup1-5',
'ciGroup2-5',
'ciGroup3-5',
'ciGroup4-5',
'ciGroup5-5',
'ciGroup6-5',
'ciGroup7-5',
'ciGroup8-5',
'ciGroup9-5',
'ciGroup10-5',
'ciGroup11-5',
'ciGroup12-5',
'ciGroup1-6',
'ciGroup2-6',
'ciGroup3-6',
'ciGroup4-6',
'ciGroup5-6',
'ciGroup6-6',
'ciGroup7-6',
'ciGroup8-6',
'ciGroup9-6',
'ciGroup10-6',
'ciGroup11-6',
'ciGroup12-6',
];

export function getFunctionalTestGroupRunConfigs({ esFrom, kibanaInstallDir } = {}) {
Expand Down
5 changes: 2 additions & 3 deletions test/functional/apps/dashboard/_dashboard_grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@ export default function ({ getService, getPageObjects }) {
const lastVisTitle = 'Rendering Test: datatable';
const panelTitleBeforeMove = await dashboardPanelActions.getPanelHeading(lastVisTitle);
const position1 = await panelTitleBeforeMove.getPosition();

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

const panelTitleAfterMove = await dashboardPanelActions.getPanelHeading(lastVisTitle);
Expand Down
6 changes: 3 additions & 3 deletions test/functional/apps/dashboard/_dashboard_save.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default function ({ getPageObjects }) {

await PageObjects.dashboard.gotoDashboardLandingPage();
await PageObjects.dashboard.clickNewDashboard();
await PageObjects.dashboard.enterDashboardTitleAndClickSave(dashboardName);
await PageObjects.dashboard.enterDashboardTitleAndClickSave(dashboardName, { waitDialogIsClosed: false });
await PageObjects.dashboard.expectDuplicateTitleWarningDisplayed({ displayed: true });
});

Expand All @@ -55,7 +55,7 @@ export default function ({ getPageObjects }) {
it('Saves on confirm duplicate title warning', async function () {
await PageObjects.dashboard.gotoDashboardLandingPage();
await PageObjects.dashboard.clickNewDashboard();
await PageObjects.dashboard.enterDashboardTitleAndClickSave(dashboardName);
await PageObjects.dashboard.enterDashboardTitleAndClickSave(dashboardName, { waitDialogIsClosed: false });

await PageObjects.dashboard.clickSave();

Expand Down Expand Up @@ -96,7 +96,7 @@ export default function ({ getPageObjects }) {

it('Warns when case is different', async function () {
await PageObjects.dashboard.switchToEditMode();
await PageObjects.dashboard.enterDashboardTitleAndClickSave(dashboardName.toUpperCase());
await PageObjects.dashboard.enterDashboardTitleAndClickSave(dashboardName.toUpperCase(), { waitDialogIsClosed: false });

await PageObjects.dashboard.expectDuplicateTitleWarningDisplayed({ displayed: true });

Expand Down
14 changes: 8 additions & 6 deletions test/functional/page_objects/dashboard_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,9 +307,9 @@ export function DashboardPageProvider({ getService, getPageObjects }) {
* verify that the save was successful
*
* @param dashName {String}
* @param saveOptions {{storeTimeWithDashboard: boolean, saveAsNew: boolean, needsConfirm: false}}
* @param saveOptions {{storeTimeWithDashboard: boolean, saveAsNew: boolean, needsConfirm: false, waitDialogIsClosed: boolean }}
*/
async saveDashboard(dashName, saveOptions = {}) {
async saveDashboard(dashName, saveOptions = { waitDialogIsClosed: true }) {
await this.enterDashboardTitleAndClickSave(dashName, saveOptions);

if (saveOptions.needsConfirm) {
Expand Down Expand Up @@ -352,12 +352,11 @@ export function DashboardPageProvider({ getService, getPageObjects }) {
/**
*
* @param dashboardTitle {String}
* @param saveOptions {{storeTimeWithDashboard: boolean, saveAsNew: boolean}}
* @param saveOptions {{storeTimeWithDashboard: boolean, saveAsNew: boolean, waitDialogIsClosed: boolean}}
*/
async enterDashboardTitleAndClickSave(dashboardTitle, saveOptions = {}) {
async enterDashboardTitleAndClickSave(dashboardTitle, saveOptions = { waitDialogIsClosed: true }) {
await testSubjects.click('dashboardSaveMenuItem');

await PageObjects.header.waitUntilLoadingHasFinished();
const modalDialog = await testSubjects.find('savedObjectSaveModal');

log.debug('entering new title');
await testSubjects.setValue('savedObjectTitle', dashboardTitle);
Expand All @@ -371,6 +370,9 @@ export function DashboardPageProvider({ getService, getPageObjects }) {
}

await this.clickSave();
if (saveOptions.waitDialogIsClosed) {
await testSubjects.waitForDeleted(modalDialog);
}
}

async selectDashboard(dashName) {
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(
{ element: bars[from], xOffset: 0, yOffset: -5 },
{ element: bars[to], xOffset: 0, yOffset: -5 }
{ location: bars[from], offset: { x: 0, y: -5 } },
{ location: bars[to], offset: { x: 0, y: -5 } }
);
}

Expand Down
2 changes: 1 addition & 1 deletion test/functional/page_objects/settings_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ export function SettingsPageProvider({ getService, getPageObjects }) {
log.debug(`setIndexPatternField(${indexPatternName})`);
const field = await this.getIndexPatternField();
await field.clearValue();
await field.type(indexPatternName);
await field.type(indexPatternName, { charByChar: true });
const currentName = await field.getAttribute('value');
log.debug(`setIndexPatternField set to ${currentName}`);
expect(currentName).to.eql(`${indexPatternName}${expectWildcard ? '*' : ''}`);
Expand Down
Loading