Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-enable infra visual tests #51216

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/dev/ci_setup/load_env_keys.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ else
KIBANA_CI_REPORTER_KEY=$(retry 5 vault read -field=value secret/kibana-issues/dev/kibanamachine-reporter)
export KIBANA_CI_REPORTER_KEY

PERCY_TOKEN=$(retry 5 vault read -field=value secret/kibana-issues/dev/percy)
PERCY_TOKEN=$(retry 5 vault read -field=value secret/kibana-issues/dev/percy-dev)
export PERCY_TOKEN

# remove vault related secrets
Expand Down
9 changes: 9 additions & 0 deletions x-pack/test/functional/page_objects/infra_home_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,14 @@ export function InfraHomePageProvider({ getService }: FtrProviderContext) {
await testSubjects.click('configureSourceButton');
await testSubjects.exists('sourceConfigurationFlyout');
},

async waitForChartToLoad() {
await retry.try(async () => {
const renderComplete = await find.byCssSelector('[data-ech-render-complete="true"]');
if (!renderComplete) {
throw new Error('Chart did not render');
}
});
},
};
}
2 changes: 1 addition & 1 deletion x-pack/test/visual_regression/tests/infra/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
export default function ({ loadTestFile, getService }) {
const browser = getService('browser');

describe.skip('InfraUI Visual Regression', function () {
describe('InfraUI Visual Regression', function () {
before(async () => {
await browser.setWindowSize(1600, 1000);
});
Expand Down
28 changes: 24 additions & 4 deletions x-pack/test/visual_regression/tests/infra/saved_views.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,31 @@ import { DATES } from '../../../functional/apps/infra/constants';
const DATE_WITH_DATA = DATES.metricsAndLogs.hosts.withData;

export default function ({ getPageObjects, getService }) {
const PageObjects = getPageObjects(['common', 'infraHome', 'infraMetricExplorer']);
const PageObjects = getPageObjects(['common', 'header', 'infraHome', 'infraMetricExplorer', 'timePicker']);
const visualTesting = getService('visualTesting');
const esArchiver = getService('esArchiver');
const find = getService('find');

describe('saved views', () => {
before(() => esArchiver.load('infra/metrics_and_logs'));
after(() => esArchiver.unload('infra/metrics_and_logs'));
describe('Inverntory Test save functionality', () => {
it('should have save and load controls', async () => {

describe('Inventory Test save functionality', () => {
before(async function () {
await PageObjects.common.navigateToApp('infraOps');
await PageObjects.infraHome.goToTime(DATE_WITH_DATA);
await PageObjects.header.awaitGlobalLoadingIndicatorHidden();
});

it('should have save and load controls', async () => {
await PageObjects.infraHome.getSaveViewButton();
await PageObjects.infraHome.getLoadViewsButton();
await visualTesting.snapshot();
});

it('should open flyout list', async () => {
await PageObjects.infraHome.openSaveViewsFlyout();
await find.waitForDeletedByCssSelector('.euiBasicTable-loading', 5000);
await visualTesting.snapshot();
await PageObjects.infraHome.closeSavedViewFlyout();
});
Expand All @@ -36,26 +43,38 @@ export default function ({ getPageObjects, getService }) {

it('should be able to enter a view name', async () => {
await PageObjects.infraHome.openEnterViewNameAndSave();
await PageObjects.header.awaitGlobalLoadingIndicatorHidden();
await visualTesting.snapshot();
});

it('should see a saved view in list', async () => {
await PageObjects.infraHome.openSaveViewsFlyout();
await find.waitForDeletedByCssSelector('.euiBasicTable-loading', 5000);
await visualTesting.snapshot();
});
});

describe('Metric Explorer Test save functionality', () => {
it('should have save and load controls', async () => {
const fromTime = 'Oct 16, 2018 @ 00:00:00.000';
const toTime = 'Oct 18, 2018 @ 00:00:00.000';

before(async function () {
await PageObjects.common.navigateToApp('infraOps');
await PageObjects.infraHome.goToMetricExplorer();
await PageObjects.timePicker.setAbsoluteRange(fromTime, toTime);
await PageObjects.header.awaitGlobalLoadingIndicatorHidden();
await PageObjects.infraHome.waitForChartToLoad();
});

it('should have save and load controls', async () => {
await PageObjects.infraMetricExplorer.getSaveViewButton();
await PageObjects.infraMetricExplorer.getLoadViewsButton();
await visualTesting.snapshot();
});

it('should open flyout list', async () => {
await PageObjects.infraMetricExplorer.openSaveViewsFlyout();
await find.waitForDeletedByCssSelector('.euiBasicTable-loading', 5000);
await visualTesting.snapshot();
await PageObjects.infraMetricExplorer.closeSavedViewFlyout();
});
Expand All @@ -72,6 +91,7 @@ export default function ({ getPageObjects, getService }) {

it('should see a saved view in list', async () => {
await PageObjects.infraMetricExplorer.openSaveViewsFlyout();
await find.waitForDeletedByCssSelector('.euiBasicTable-loading', 5000);
await visualTesting.snapshot();
});
});
Expand Down