Skip to content

Commit

Permalink
Apply changes to transform tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pheyos committed Aug 18, 2020
1 parent ee4f8a5 commit d64dc9c
Show file tree
Hide file tree
Showing 6 changed files with 172 additions and 200 deletions.
90 changes: 41 additions & 49 deletions x-pack/test/functional/apps/transform/cloning.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,138 +87,130 @@ export default function ({ getService }: FtrProviderContext) {
await transform.testResources.deleteIndexPatternByTitle(testData.destinationIndex);
});

it('should load the home page', async () => {
it('opens the existing transform in the wizard', async () => {
await transform.testExecution.logTestStep('should load the home page');
await transform.navigation.navigateTo();
await transform.management.assertTransformListPageExists();
});

it('should display the transforms table', async () => {
await transform.testExecution.logTestStep('should display the transforms table');
await transform.management.assertTransformsTableExists();
});

it('should display the original transform in the transform list', async () => {
await transform.testExecution.logTestStep(
'should display the original transform in the transform list'
);
await transform.table.refreshTransformList();
await transform.table.filterWithSearchString(transformConfig.id);
const rows = await transform.table.parseTransformTable();
expect(rows.filter((row) => row.id === transformConfig.id)).to.have.length(1);
});

it('should show the actions popover', async () => {
await transform.testExecution.logTestStep('should show the actions popover');
await transform.table.assertTransformRowActions(false);
});

it('should display the define pivot step', async () => {
await transform.testExecution.logTestStep('should display the define pivot step');
await transform.table.clickTransformRowAction('Clone');
await transform.wizard.assertDefineStepActive();
});

it('should load the index preview', async () => {
it('navigates through the wizard, checks and sets all needed fields', async () => {
await transform.testExecution.logTestStep('should load the index preview');
await transform.wizard.assertIndexPreviewLoaded();
});

it('should show the index preview', async () => {
await transform.testExecution.logTestStep('should show the index preview');
await transform.wizard.assertIndexPreview(
testData.expected.indexPreview.columns,
testData.expected.indexPreview.rows
);
});

it('should display the query input', async () => {
await transform.testExecution.logTestStep('should display the query input');
await transform.wizard.assertQueryInputExists();
await transform.wizard.assertQueryValue('');
});

it('should show the pre-filled group-by configuration', async () => {
await transform.testExecution.logTestStep(
'should show the pre-filled group-by configuration'
);
await transform.wizard.assertGroupByEntryExists(
testData.expected.groupBy.index,
testData.expected.groupBy.label
);
});

it('should show the pre-filled aggs configuration', async () => {
await transform.testExecution.logTestStep(
'should show the pre-filled aggs configuration'
);
await transform.wizard.assertAggregationEntryExists(
testData.expected.aggs.index,
testData.expected.aggs.label
);
});

it('should show the pivot preview', async () => {
await transform.testExecution.logTestStep('should show the pivot preview');
await transform.wizard.assertPivotPreviewChartHistogramButtonMissing();
await transform.wizard.assertPivotPreviewColumnValues(
testData.expected.pivotPreview.column,
testData.expected.pivotPreview.values
);
});

it('should load the details step', async () => {
await transform.testExecution.logTestStep('should load the details step');
await transform.wizard.advanceToDetailsStep();
});

it('should input the transform id', async () => {
await transform.testExecution.logTestStep('should input the transform id');
await transform.wizard.assertTransformIdInputExists();
await transform.wizard.assertTransformIdValue('');
await transform.wizard.setTransformId(testData.transformId);
});

it('should input the transform description', async () => {
await transform.testExecution.logTestStep('should input the transform description');
await transform.wizard.assertTransformDescriptionInputExists();
await transform.wizard.assertTransformDescriptionValue('');
await transform.wizard.setTransformDescription(testData.transformDescription);
});

it('should input the destination index', async () => {
await transform.testExecution.logTestStep('should input the destination index');
await transform.wizard.assertDestinationIndexInputExists();
await transform.wizard.assertDestinationIndexValue('');
await transform.wizard.setDestinationIndex(testData.destinationIndex);
});

it('should display the create index pattern switch', async () => {
await transform.testExecution.logTestStep(
'should display the create index pattern switch'
);
await transform.wizard.assertCreateIndexPatternSwitchExists();
await transform.wizard.assertCreateIndexPatternSwitchCheckState(true);
});

it('should display the continuous mode switch', async () => {
await transform.testExecution.logTestStep('should display the continuous mode switch');
await transform.wizard.assertContinuousModeSwitchExists();
await transform.wizard.assertContinuousModeSwitchCheckState(false);
});

it('should load the create step', async () => {
await transform.testExecution.logTestStep('should load the create step');
await transform.wizard.advanceToCreateStep();
});

it('should display the create and start button', async () => {
await transform.testExecution.logTestStep('should display the create and start button');
await transform.wizard.assertCreateAndStartButtonExists();
await transform.wizard.assertCreateAndStartButtonEnabled(true);
});

it('should display the create button', async () => {
await transform.testExecution.logTestStep('should display the create button');
await transform.wizard.assertCreateButtonExists();
await transform.wizard.assertCreateButtonEnabled(true);
});

it('should display the copy to clipboard button', async () => {
await transform.testExecution.logTestStep('should display the copy to clipboard button');
await transform.wizard.assertCopyToClipboardButtonExists();
await transform.wizard.assertCopyToClipboardButtonEnabled(true);
});

it('should create the transform', async () => {
it('runs the clone transform and displays it correctly in the job list', async () => {
await transform.testExecution.logTestStep('should create the transform');
await transform.wizard.createTransform();
});

it('should start the transform and finish processing', async () => {
await transform.testExecution.logTestStep(
'should start the transform and finish processing'
);
await transform.wizard.startTransform();
await transform.wizard.waitForProgressBarComplete();
});

it('should return to the management page', async () => {
await transform.testExecution.logTestStep('should return to the management page');
await transform.wizard.returnToManagement();
});

it('should display the transforms table', async () => {
await transform.testExecution.logTestStep('should display the transforms table');
await transform.management.assertTransformsTableExists();
});

it('should display the created transform in the transform list', async () => {
await transform.testExecution.logTestStep(
'should display the created transform in the transform list'
);
await transform.table.refreshTransformList();
await transform.table.filterWithSearchString(testData.transformId);
const rows = await transform.table.parseTransformTable();
Expand Down
106 changes: 41 additions & 65 deletions x-pack/test/functional/apps/transform/creation_index_pattern.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,63 +260,54 @@ export default function ({ getService }: FtrProviderContext) {
await transform.testResources.deleteIndexPatternByTitle(testData.destinationIndex);
});

it('loads the home page', async () => {
it('loads the wizard for the source data', async () => {
await transform.testExecution.logTestStep('loads the home page');
await transform.navigation.navigateTo();
await transform.management.assertTransformListPageExists();
});

it('displays the stats bar', async () => {
await transform.testExecution.logTestStep('displays the stats bar');
await transform.management.assertTransformStatsBarExists();
});

it('loads the source selection modal', async () => {
await transform.testExecution.logTestStep('loads the source selection modal');
await transform.management.startTransformCreation();
});

it('selects the source data', async () => {
await transform.testExecution.logTestStep('selects the source data');
await transform.sourceSelection.selectSource(testData.source);
});

it('displays the define pivot step', async () => {
it('navigates through the wizard and sets all needed fields', async () => {
await transform.testExecution.logTestStep('displays the define pivot step');
await transform.wizard.assertDefineStepActive();
});

it('loads the index preview', async () => {
await transform.testExecution.logTestStep('loads the index preview');
await transform.wizard.assertIndexPreviewLoaded();
});

it('shows the index preview', async () => {
await transform.testExecution.logTestStep('shows the index preview');
await transform.wizard.assertIndexPreview(
testData.expected.indexPreview.columns,
testData.expected.indexPreview.rows
);
});

it('displays an empty pivot preview', async () => {
await transform.testExecution.logTestStep('displays an empty pivot preview');
await transform.wizard.assertPivotPreviewEmpty();
});

it('displays the query input', async () => {
await transform.testExecution.logTestStep('displays the query input');
await transform.wizard.assertQueryInputExists();
await transform.wizard.assertQueryValue('');
});

it('displays the advanced query editor switch', async () => {
await transform.testExecution.logTestStep('displays the advanced query editor switch');
await transform.wizard.assertAdvancedQueryEditorSwitchExists();
await transform.wizard.assertAdvancedQueryEditorSwitchCheckState(false);
});

it('enables the index preview histogram charts', async () => {
await transform.testExecution.logTestStep('enables the index preview histogram charts');
await transform.wizard.enableIndexPreviewHistogramCharts();
});

it('displays the index preview histogram charts', async () => {
await transform.testExecution.logTestStep('displays the index preview histogram charts');
await transform.wizard.assertIndexPreviewHistogramCharts(
testData.expected.histogramCharts
);
});

it('adds the group by entries', async () => {
await transform.testExecution.logTestStep('adds the group by entries');
for (const [index, entry] of testData.groupByEntries.entries()) {
await transform.wizard.assertGroupByInputExists();
await transform.wizard.assertGroupByInputValue([]);
Expand All @@ -327,112 +318,97 @@ export default function ({ getService }: FtrProviderContext) {
entry.intervalLabel
);
}
});

it('adds the aggregation entries', async () => {
await transform.testExecution.logTestStep('adds the aggregation entries');
await transform.wizard.addAggregationEntries(testData.aggregationEntries);
});

it('displays the advanced pivot editor switch', async () => {
await transform.testExecution.logTestStep('displays the advanced pivot editor switch');
await transform.wizard.assertAdvancedPivotEditorSwitchExists();
await transform.wizard.assertAdvancedPivotEditorSwitchCheckState(false);
});

it('displays the advanced configuration', async () => {
await transform.testExecution.logTestStep('displays the advanced configuration');
await transform.wizard.enabledAdvancedPivotEditor();
await transform.wizard.assertAdvancedPivotEditorContent(
testData.expected.pivotAdvancedEditorValueArr
);
});

it('loads the pivot preview', async () => {
await transform.testExecution.logTestStep('loads the pivot preview');
await transform.wizard.assertPivotPreviewLoaded();
});

it('shows the pivot preview', async () => {
await transform.testExecution.logTestStep('shows the pivot preview');
await transform.wizard.assertPivotPreviewChartHistogramButtonMissing();
await transform.wizard.assertPivotPreviewColumnValues(
testData.expected.pivotPreview.column,
testData.expected.pivotPreview.values
);
});

it('loads the details step', async () => {
await transform.testExecution.logTestStep('loads the details step');
await transform.wizard.advanceToDetailsStep();
});

it('inputs the transform id', async () => {
await transform.testExecution.logTestStep('inputs the transform id');
await transform.wizard.assertTransformIdInputExists();
await transform.wizard.assertTransformIdValue('');
await transform.wizard.setTransformId(testData.transformId);
});

it('inputs the transform description', async () => {
await transform.testExecution.logTestStep('inputs the transform description');
await transform.wizard.assertTransformDescriptionInputExists();
await transform.wizard.assertTransformDescriptionValue('');
await transform.wizard.setTransformDescription(testData.transformDescription);
});

it('inputs the destination index', async () => {
await transform.testExecution.logTestStep('inputs the destination index');
await transform.wizard.assertDestinationIndexInputExists();
await transform.wizard.assertDestinationIndexValue('');
await transform.wizard.setDestinationIndex(testData.destinationIndex);
});

it('displays the create index pattern switch', async () => {
await transform.testExecution.logTestStep('displays the create index pattern switch');
await transform.wizard.assertCreateIndexPatternSwitchExists();
await transform.wizard.assertCreateIndexPatternSwitchCheckState(true);
});

it('displays the continuous mode switch', async () => {
await transform.testExecution.logTestStep('displays the continuous mode switch');
await transform.wizard.assertContinuousModeSwitchExists();
await transform.wizard.assertContinuousModeSwitchCheckState(false);
});

it('loads the create step', async () => {
await transform.testExecution.logTestStep('loads the create step');
await transform.wizard.advanceToCreateStep();
});

it('displays the create and start button', async () => {
await transform.testExecution.logTestStep('displays the create and start button');
await transform.wizard.assertCreateAndStartButtonExists();
await transform.wizard.assertCreateAndStartButtonEnabled(true);
});

it('displays the create button', async () => {
await transform.testExecution.logTestStep('displays the create button');
await transform.wizard.assertCreateButtonExists();
await transform.wizard.assertCreateButtonEnabled(true);
});

it('displays the copy to clipboard button', async () => {
await transform.testExecution.logTestStep('displays the copy to clipboard button');
await transform.wizard.assertCopyToClipboardButtonExists();
await transform.wizard.assertCopyToClipboardButtonEnabled(true);
});

it('creates the transform', async () => {
it('runs the transform and displays it correctly in the job list', async () => {
await transform.testExecution.logTestStep('creates the transform');
await transform.wizard.createTransform();
});

it('starts the transform and finishes processing', async () => {
await transform.testExecution.logTestStep('starts the transform and finishes processing');
await transform.wizard.startTransform();
await transform.wizard.waitForProgressBarComplete();
});

it('returns to the management page', async () => {
await transform.testExecution.logTestStep('returns to the management page');
await transform.wizard.returnToManagement();
});

it('displays the transforms table', async () => {
await transform.testExecution.logTestStep('displays the transforms table');
await transform.management.assertTransformsTableExists();
});

it('displays the created transform in the transform list', async () => {
await transform.testExecution.logTestStep(
'displays the created transform in the transform list'
);
await transform.table.refreshTransformList();
await transform.table.filterWithSearchString(testData.transformId);
const rows = await transform.table.parseTransformTable();
expect(rows.filter((row) => row.id === testData.transformId)).to.have.length(1);
});

it('transform creation displays details for the created transform in the transform list', async () => {
await transform.testExecution.logTestStep(
'transform creation displays details for the created transform in the transform list'
);
await transform.table.assertTransformRowFields(testData.transformId, {
id: testData.transformId,
description: testData.transformDescription,
Expand Down
Loading

0 comments on commit d64dc9c

Please sign in to comment.