-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* e2e updated * e2e.yml updated * Update workflow --------- Co-authored-by: Mikhail Volkov <[email protected]>
- Loading branch information
1 parent
3a3bb6a
commit 5beeaa5
Showing
6 changed files
with
28 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,25 @@ | ||
import { test, expect } from '@grafana/plugin-e2e'; | ||
import { TEST_IDS } from '../src/constants/tests'; | ||
|
||
test.describe('Business Charts Panel', () => { | ||
test('should display empty chart without data and Bar Chart', async ({ | ||
readProvisionedDashboard, | ||
gotoDashboardPage, | ||
page, | ||
}) => { | ||
test('should display empty chart without data and Bar Chart', async ({ gotoDashboardPage, dashboardPage }) => { | ||
/** | ||
* Use e2e.json dashboard | ||
* Go To E2E dashboard | ||
* return dashboardPage | ||
*/ | ||
const dashboard = await readProvisionedDashboard({ fileName: 'e2e.json' }); | ||
await gotoDashboardPage({ uid: 'fdd5dbe3-794c-4441-9d1c-024a537bbe99' }); | ||
|
||
/** | ||
* Go to e2e dashboard | ||
* Find panel by title with chart | ||
* Should be visible | ||
*/ | ||
await gotoDashboardPage(dashboard); | ||
await expect(dashboardPage.getPanelByTitle('Bar Chart').locator).toBeVisible(); | ||
|
||
/** | ||
* Wait canvas is visible and animation is finished | ||
* Check and compare image | ||
*/ | ||
await page.waitForTimeout(3000); | ||
|
||
await expect(page.getByTestId('data-testid Panel header Bar Chart').locator('canvas')).toBeVisible(); | ||
await expect(page.getByRole('heading', { name: 'Bar Chart' })).toBeVisible(); | ||
await expect(page.getByRole('heading', { name: 'Empty Chart' })).toBeVisible(); | ||
|
||
/** | ||
* Check screenshot | ||
*/ | ||
// await expect(page).toHaveScreenshot('actual-screenshot.png'); | ||
|
||
/** | ||
* Compare screenshot actual | ||
*/ | ||
// await expect(await page.screenshot()).toMatchSnapshot('actual-screenshot.png', { threshold: 0.3 }); | ||
await expect(dashboardPage.getPanelByTitle('Bar Chart').locator.getByTestId(TEST_IDS.panel.chart)).toHaveScreenshot( | ||
'actual-screenshot.png' | ||
); | ||
}); | ||
}); |
Binary file modified
BIN
-23.9 KB
(32%)
test/panel.spec.ts-snapshots/actual-screenshot-run-tests-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.