Marta Bondyra 2024-08-27 22:12:59 +02:00 committed by GitHub
parent fae013926c
commit 2a033c1621
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 50 additions and 15 deletions

View file

@ -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']);

View file

@ -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();

View file

@ -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();

View file

@ -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'));

View file

@ -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([

View file

@ -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([

View file

@ -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();