Skip to content

Commit

Permalink
Move the isOss flag inside the test
Browse files Browse the repository at this point in the history
  • Loading branch information
stratoula committed Feb 2, 2021
1 parent 7e500b6 commit 8e8ada1
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 27 deletions.
61 changes: 38 additions & 23 deletions test/functional/apps/management/_scripted_fields.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import expect from '@kbn/expect';
export default function ({ getService, getPageObjects }) {
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer');
const deployment = getService('deployment');
const log = getService('log');
const browser = getService('browser');
const retry = getService('retry');
Expand Down Expand Up @@ -186,13 +187,16 @@ export default function ({ getService, getPageObjects }) {
});

it('should visualize scripted field in vertical bar chart', async function () {
await filterBar.removeAllFilters();
await PageObjects.discover.clickFieldListItemVisualize(scriptedPainlessFieldName);
await PageObjects.header.waitUntilLoadingHasFinished();
// verify Lens opens a visualization
expect(await testSubjects.getVisibleTextAll('lns-dimensionTrigger')).to.contain(
'Average of ram_Pain1'
);
const isOss = await deployment.isOss();
if (!isOss) {
await filterBar.removeAllFilters();
await PageObjects.discover.clickFieldListItemVisualize(scriptedPainlessFieldName);
await PageObjects.header.waitUntilLoadingHasFinished();
// verify Lens opens a visualization
expect(await testSubjects.getVisibleTextAll('lns-dimensionTrigger')).to.contain(
'Average of ram_Pain1'
);
}
});
});

Expand Down Expand Up @@ -273,12 +277,15 @@ export default function ({ getService, getPageObjects }) {
});

it('should visualize scripted field in vertical bar chart', async function () {
await PageObjects.discover.clickFieldListItemVisualize(scriptedPainlessFieldName2);
await PageObjects.header.waitUntilLoadingHasFinished();
// verify Lens opens a visualization
expect(await testSubjects.getVisibleTextAll('lns-dimensionTrigger')).to.contain(
'Top values of painString'
);
const isOss = await deployment.isOss();
if (!isOss) {
await PageObjects.discover.clickFieldListItemVisualize(scriptedPainlessFieldName2);
await PageObjects.header.waitUntilLoadingHasFinished();
// verify Lens opens a visualization
expect(await testSubjects.getVisibleTextAll('lns-dimensionTrigger')).to.contain(
'Top values of painString'
);
}
});
});

Expand Down Expand Up @@ -360,12 +367,15 @@ export default function ({ getService, getPageObjects }) {
});

it('should visualize scripted field in vertical bar chart', async function () {
await PageObjects.discover.clickFieldListItemVisualize(scriptedPainlessFieldName2);
await PageObjects.header.waitUntilLoadingHasFinished();
// verify Lens opens a visualization
expect(await testSubjects.getVisibleTextAll('lns-dimensionTrigger')).to.contain(
'Top values of painBool'
);
const isOss = await deployment.isOss();
if (!isOss) {
await PageObjects.discover.clickFieldListItemVisualize(scriptedPainlessFieldName2);
await PageObjects.header.waitUntilLoadingHasFinished();
// verify Lens opens a visualization
expect(await testSubjects.getVisibleTextAll('lns-dimensionTrigger')).to.contain(
'Top values of painBool'
);
}
});
});

Expand Down Expand Up @@ -450,10 +460,15 @@ export default function ({ getService, getPageObjects }) {
});

it('should visualize scripted field in vertical bar chart', async function () {
await PageObjects.discover.clickFieldListItemVisualize(scriptedPainlessFieldName2);
await PageObjects.header.waitUntilLoadingHasFinished();
// verify Lens opens a visualization
expect(await testSubjects.getVisibleTextAll('lns-dimensionTrigger')).to.contain('painDate');
const isOss = await deployment.isOss();
if (!isOss) {
await PageObjects.discover.clickFieldListItemVisualize(scriptedPainlessFieldName2);
await PageObjects.header.waitUntilLoadingHasFinished();
// verify Lens opens a visualization
expect(await testSubjects.getVisibleTextAll('lns-dimensionTrigger')).to.contain(
'painDate'
);
}
});
});
});
Expand Down
5 changes: 1 addition & 4 deletions test/functional/apps/management/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,7 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) {
loadTestFile(require.resolve('./_scripted_fields_preview'));
loadTestFile(require.resolve('./_mgmt_import_saved_objects'));
loadTestFile(require.resolve('./_index_patterns_empty'));
// Remove this flag when ci doesn't run on OSS
if (!isOss) {
loadTestFile(require.resolve('./_scripted_fields'));
}
loadTestFile(require.resolve('./_scripted_fields'));
});

describe('', function () {
Expand Down

0 comments on commit 8e8ada1

Please sign in to comment.