[Dashboard] Unskip embed_mode screenshot tests (#160085)

Closes https://github.com/elastic/kibana/issues/160064

## Summary

This PR unskips the dashboard embed mode screenshot tests that were
added in https://github.com/elastic/kibana/pull/159754 - in order for
the tests to pass in the CI environment, I had to replace the baseline
images, which were previously generated locally, with the CI-generated
screenshots as described in the attached issue. As a result, these tests
will **not** pass locally.

[**Flaky test
runner**](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2443)


![image](4fa19bd1-1b60-4763-9e1a-2f634bbaca6a)

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios


### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
This commit is contained in:
Hannah Mudge 2023-06-22 13:49:58 -06:00 committed by GitHub
parent 329cc6add6
commit 40f49337bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 8 deletions

View file

@ -25,6 +25,15 @@ export default function ({
const log = getService('log');
describe('embed mode', () => {
/*
* Note: The baseline images used in all of the screenshot tests in this test suite were taken directly from the CI environment
* in order to overcome a known issue with the pixel density of fonts being significantly different when running locally versus
* when running these tests as part of CI.
*
* This was done so that the screenshot tests can pass during CI; however, as a consequence, they may fail locally. Be careful
* when running this test suite with the --updateBaselines flag.
*/
const urlParamExtensions = [
'show-top-menu=true',
'show-query-input=true',
@ -71,12 +80,7 @@ export default function ({
await testSubjects.existOrFail('globalQueryBar');
});
/**
* Skipping all render tests for now - there is a problem where the locally generated screenshots do not align with the
* CI screenshots due to (possibly) pixel density or something similar. This fix is super important to get in so we will
* have to resolve the issue with these new tests *after* FF for 8.9/8.8.2
*/
it.skip('renders as expected', async () => {
it('renders as expected', async () => {
await PageObjects.dashboard.waitForRenderComplete();
const percentDifference = await screenshot.compareAgainstBaseline(
'dashboard_embed_mode',
@ -99,7 +103,7 @@ export default function ({
await testSubjects.existOrFail('superDatePickerToggleQuickMenuButton');
});
it.skip('renders as expected', async () => {
it('renders as expected', async () => {
await PageObjects.dashboard.waitForRenderComplete();
const percentDifference = await screenshot.compareAgainstBaseline(
'dashboard_embed_mode_with_url_params',
@ -108,7 +112,7 @@ export default function ({
expect(percentDifference).to.be.lessThan(0.02);
});
it.skip('renders as expected when scrolling', async () => {
it('renders as expected when scrolling', async () => {
const panels = await PageObjects.dashboard.getDashboardPanels();
const lastPanel = panels[panels.length - 1];
const lastPanelHeight = -parseInt(await lastPanel.getComputedStyle('height'), 10);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 KiB

After

Width:  |  Height:  |  Size: 129 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 90 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 135 KiB

After

Width:  |  Height:  |  Size: 140 KiB

Before After
Before After