mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[Managed Content] fix flaky tests (#191388)
## Summary Fixes https://github.com/elastic/kibana/issues/190227 Fixes https://github.com/elastic/kibana/issues/190737 https://github.com/elastic/kibana/issues/190990 https://github.com/elastic/kibana/issues/190802 https://github.com/elastic/kibana/issues/179307 (couldn't find the rootcause so just decided to align the solution with other files that follow similar path and are not flaky) Fixes https://github.com/elastic/kibana/issues/191151 https://github.com/elastic/kibana/issues/191152 https://github.com/elastic/kibana/issues/191176 https://github.com/elastic/kibana/issues/191177 https://github.com/elastic/kibana/issues/191178 https://github.com/elastic/kibana/issues/191153 https://github.com/elastic/kibana/issues/191238 Fixes https://github.com/elastic/kibana/issues/190711
This commit is contained in:
parent
fae013926c
commit
2a033c1621
7 changed files with 50 additions and 15 deletions
|
@ -48,7 +48,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
await browser.switchToWindow(discoverWindowHandle);
|
||||
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
await testSubjects.existOrFail('unifiedHistogramChart');
|
||||
await PageObjects.discover.waitUntilSearchingHasFinished();
|
||||
await testSubjects.existOrFail('unifiedDataTableToolbar');
|
||||
// check the table columns
|
||||
const columns = await PageObjects.discover.getColumnHeaders();
|
||||
expect(columns).to.eql(['@timestamp', 'extension.raw', 'bytes']);
|
||||
|
|
|
@ -89,15 +89,20 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
|
||||
await dashboard.waitForRenderComplete();
|
||||
const originalEmbeddableCount = await canvas.getEmbeddableCount();
|
||||
await retry.try(async () => {
|
||||
await dashboardPanelActions.customizePanel();
|
||||
await dashboardCustomizePanel.enableCustomTimeRange();
|
||||
|
||||
await panelActions.customizePanel();
|
||||
await dashboardCustomizePanel.expectCustomizePanelSettingsFlyoutOpen();
|
||||
await dashboardCustomizePanel.enableCustomTimeRange();
|
||||
await retry.waitFor('quick menu', async () => {
|
||||
await dashboardCustomizePanel.openDatePickerQuickMenu();
|
||||
await dashboardCustomizePanel.clickCommonlyUsedTimeRange('Last_30 days');
|
||||
await dashboardCustomizePanel.clickSaveButton();
|
||||
await dashboard.waitForRenderComplete();
|
||||
await dashboardBadgeActions.expectExistsTimeRangeBadgeAction();
|
||||
return await testSubjects.exists('superDatePickerCommonlyUsed_Last_30 days');
|
||||
});
|
||||
await dashboardCustomizePanel.clickCommonlyUsedTimeRange('Last_30 days');
|
||||
await dashboardCustomizePanel.clickSaveButton();
|
||||
await dashboardCustomizePanel.expectCustomizePanelSettingsFlyoutClosed();
|
||||
await dashboard.waitForRenderComplete();
|
||||
await dashboardBadgeActions.expectExistsTimeRangeBadgeAction();
|
||||
|
||||
await panelActions.openContextMenu();
|
||||
await panelActions.clickEdit();
|
||||
|
||||
|
|
|
@ -112,7 +112,8 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
it('maps', async () => {
|
||||
await PageObjects.common.navigateToActualUrl(
|
||||
'maps',
|
||||
'map/managed-d7ab-46eb-a807-8fed28ed8566'
|
||||
'map/managed-d7ab-46eb-a807-8fed28ed8566',
|
||||
{ ensureCurrentUrl: false }
|
||||
);
|
||||
await PageObjects.maps.waitForLayerAddPanelClosed();
|
||||
|
||||
|
@ -120,7 +121,8 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
|
||||
await PageObjects.common.navigateToActualUrl(
|
||||
'maps',
|
||||
'map/unmanaged-d7ab-46eb-a807-8fed28ed8566'
|
||||
'map/unmanaged-d7ab-46eb-a807-8fed28ed8566',
|
||||
{ ensureCurrentUrl: false }
|
||||
);
|
||||
await PageObjects.maps.waitForLayerAddPanelClosed();
|
||||
|
||||
|
|
|
@ -1380,6 +1380,11 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont
|
|||
};
|
||||
},
|
||||
|
||||
async hoverOverDimensionButton(index = 0) {
|
||||
const dimensionButton = (await testSubjects.findAll('lns-dimensionTrigger'))[index];
|
||||
await dimensionButton.moveMouseTo();
|
||||
},
|
||||
|
||||
async getMetricVisualizationData() {
|
||||
const tiles = await this.getMetricTiles();
|
||||
const showingBar = Boolean(await findService.existsByCssSelector('.echSingleMetricProgress'));
|
||||
|
|
|
@ -21,9 +21,6 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
const kibanaServer = getService('kibanaServer');
|
||||
|
||||
describe('Goal', function describeIndexTests() {
|
||||
// fails on MKI, see https://github.com/elastic/kibana/issues/191238
|
||||
this.tags(['failsOnMKI']);
|
||||
|
||||
const fixture =
|
||||
'x-pack/test_serverless/functional/fixtures/kbn_archiver/lens/open_in_lens/agg_based/goal.json';
|
||||
|
||||
|
@ -49,6 +46,9 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
it('should convert to Lens', async () => {
|
||||
await panelActions.convertToLensByTitle('Goal - Basic');
|
||||
await lens.waitForVisualization('mtrVis');
|
||||
|
||||
// hovering over dimension button to make sure neither of metrics are hovered so the color is stable
|
||||
await lens.hoverOverDimensionButton();
|
||||
const data = await lens.getMetricVisualizationData();
|
||||
expect(data.length).to.be.equal(1);
|
||||
expect(data).to.eql([
|
||||
|
@ -76,6 +76,8 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
expect(await dimensions[0].getVisibleText()).to.be('Average machine.ram');
|
||||
expect(await dimensions[1].getVisibleText()).to.be('Static value: 1');
|
||||
|
||||
// hovering over dimension button to make sure neither of metrics are hovered so the color is stable
|
||||
await lens.hoverOverDimensionButton();
|
||||
const data = await lens.getMetricVisualizationData();
|
||||
expect(data.length).to.be.equal(1);
|
||||
expect(data).to.eql([
|
||||
|
@ -104,6 +106,8 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
expect(await dimensions[1].getVisibleText()).to.be('Static value: 1');
|
||||
expect(await dimensions[2].getVisibleText()).to.be('@timestamp');
|
||||
|
||||
// hovering over dimension button to make sure neither of metrics are hovered so the color is stable
|
||||
await lens.hoverOverDimensionButton();
|
||||
const data = await lens.getMetricVisualizationData();
|
||||
expect(data.length).to.be.equal(1);
|
||||
expect(data).to.eql([
|
||||
|
@ -132,6 +136,8 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
expect(await dimensions[1].getVisibleText()).to.be('Static value: 13300000000');
|
||||
expect(await dimensions[2].getVisibleText()).to.be('machine.os.raw: Descending');
|
||||
|
||||
// hovering over dimension button to make sure neither of metrics are hovered so the color is stable
|
||||
await lens.hoverOverDimensionButton();
|
||||
const data = await lens.getMetricVisualizationData();
|
||||
expect(data.length).to.be.equal(6);
|
||||
expect(data).to.eql([
|
||||
|
|
|
@ -20,8 +20,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
const panelActions = getService('dashboardPanelActions');
|
||||
const kibanaServer = getService('kibanaServer');
|
||||
|
||||
// Failing: See https://github.com/elastic/kibana/issues/191153
|
||||
describe.skip('Metric', function describeIndexTests() {
|
||||
describe('Metric', function describeIndexTests() {
|
||||
const fixture =
|
||||
'x-pack/test_serverless/functional/fixtures/kbn_archiver/lens/open_in_lens/agg_based/metric.json';
|
||||
|
||||
|
@ -44,6 +43,8 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
await panelActions.convertToLensByTitle('Metric - Basic');
|
||||
await lens.waitForVisualization('mtrVis');
|
||||
|
||||
// hovering over dimension button to make sure neither of metrics are hovered so the color is stable
|
||||
await lens.hoverOverDimensionButton();
|
||||
const data = await lens.getMetricVisualizationData();
|
||||
expect(data.length).to.be.equal(1);
|
||||
expect(data).to.eql([
|
||||
|
@ -70,6 +71,8 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
expect(dimensions).to.have.length(1);
|
||||
expect(await dimensions[0].getVisibleText()).to.be('Average machine.ram');
|
||||
|
||||
// hovering over dimension button to make sure neither of metrics are hovered so the color is stable
|
||||
await lens.hoverOverDimensionButton();
|
||||
const data = await lens.getMetricVisualizationData();
|
||||
expect(data.length).to.be.equal(1);
|
||||
expect(data).to.eql([
|
||||
|
@ -97,6 +100,8 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
expect(await dimensions[0].getVisibleText()).to.be('Overall Max of Count');
|
||||
expect(await dimensions[1].getVisibleText()).to.be('@timestamp');
|
||||
|
||||
// hovering over dimension button to make sure neither of metrics are hovered so the color is stable
|
||||
await lens.hoverOverDimensionButton();
|
||||
const data = await lens.getMetricVisualizationData();
|
||||
expect(data.length).to.be.equal(1);
|
||||
expect(data).to.eql([
|
||||
|
@ -129,6 +134,10 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
expect(dimensions).to.have.length(2);
|
||||
expect(await dimensions[0].getVisibleText()).to.be('Average machine.ram');
|
||||
expect(await dimensions[1].getVisibleText()).to.be('machine.os.raw: Descending');
|
||||
|
||||
// hovering over dimension button to make sure neither of metrics are hovered so the color is stable
|
||||
await lens.hoverOverDimensionButton();
|
||||
|
||||
const data = await lens.getMetricVisualizationData();
|
||||
expect(data.length).to.be.equal(6);
|
||||
expect(data).to.eql([
|
||||
|
|
|
@ -84,11 +84,18 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
|
||||
await dashboard.waitForRenderComplete();
|
||||
const originalEmbeddableCount = await canvas.getEmbeddableCount();
|
||||
|
||||
await dashboardPanelActions.customizePanel();
|
||||
await dashboardCustomizePanel.expectCustomizePanelSettingsFlyoutOpen();
|
||||
await dashboardCustomizePanel.enableCustomTimeRange();
|
||||
await dashboardCustomizePanel.openDatePickerQuickMenu();
|
||||
await retry.waitFor('quick menu', async () => {
|
||||
await dashboardCustomizePanel.openDatePickerQuickMenu();
|
||||
return await testSubjects.exists('superDatePickerCommonlyUsed_Last_30 days');
|
||||
});
|
||||
await dashboardCustomizePanel.clickCommonlyUsedTimeRange('Last_30 days');
|
||||
await dashboardCustomizePanel.clickSaveButton();
|
||||
await dashboardCustomizePanel.expectCustomizePanelSettingsFlyoutClosed();
|
||||
await dashboard.waitForRenderComplete();
|
||||
await dashboardBadgeActions.expectExistsTimeRangeBadgeAction();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue