Skip to content

Commit

Permalink
[7.17] Made fix to broken test. Deleted all existing pipelines before…
Browse files Browse the repository at this point in the history
… test starts. FLAKY: #118593 (#127102) (#127228)

* Made fix to broken test. Deleted all existing pipelines before test starts. FLAKY: #118593 (#127102)

(cherry picked from commit 81eec7c)

* Adjusted test to look for empty state header.

Co-authored-by: John Dorlus <[email protected]>
Co-authored-by: John Dorlus <[email protected]>
  • Loading branch information
3 people authored Mar 17, 2022
1 parent 55016b6 commit 59cf3b7
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
17 changes: 13 additions & 4 deletions x-pack/test/functional/apps/ingest_pipelines/ingest_pipelines.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,45 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { IngestDeletePipelineRequest } from '@elastic/elasticsearch/api/types';
import expect from '@kbn/expect';
import { FtrProviderContext } from '../../ftr_provider_context';

const PIPELINE = {
name: 'test_pipeline',
description: 'My pipeline description.',
version: 1,
emptyState: true,
};

export default ({ getPageObjects, getService }: FtrProviderContext) => {
const pageObjects = getPageObjects(['common', 'ingestPipelines']);
const log = getService('log');
const es = getService('es');
const security = getService('security');
const retry = getService('retry');

describe('Ingest Pipelines', function () {
this.tags('smoke');
this.onlyEsVersion('<=7');

before(async () => {
await security.testUser.setRoles(['ingest_pipelines_user']);
// Delete all existing pipelines
await es.ingest.deletePipeline({ id: '*' } as IngestDeletePipelineRequest);
await pageObjects.common.navigateToApp('ingestPipelines');
});

it('Loads the app', async () => {
log.debug('Checking for section heading to say Ingest Pipelines.');

const headingText = await pageObjects.ingestPipelines.sectionHeadingText();
expect(headingText).to.be('Ingest Pipelines');
await retry.waitForWithTimeout('empty section heading to be visible', 15000, async () => {
return (
(await await pageObjects.ingestPipelines.emptyStateHeaderText()) ===
'Start by creating a pipeline'
);
});
// const headingText = await pageObjects.ingestPipelines.sectionHeadingText();
// expect(headingText).to.be('Ingest Pipelines');
});

it('Creates a pipeline', async () => {
Expand Down
9 changes: 8 additions & 1 deletion x-pack/test/functional/page_objects/ingest_pipelines_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,21 @@ export function IngestPipelinesPageProvider({ getService, getPageObjects }: FtrP
version,
processors,
onFailureProcessors,
emptyState,
}: {
name: string;
description: string;
version?: number;
processors?: string;
onFailureProcessors?: string;
emptyState?: boolean;
}) {
await testSubjects.click('createPipelineButton');
if (emptyState) {
await testSubjects.click('emptyStateCreatePipelineButton');
} else {
await testSubjects.click('createPipelineButton');
}

await testSubjects.exists('pipelineForm');

await testSubjects.setValue('nameField > input', name);
Expand Down

0 comments on commit 59cf3b7

Please sign in to comment.