diff --git a/packages/desktop-client/e2e/page-models/custom-report-page.js b/packages/desktop-client/e2e/page-models/custom-report-page.js new file mode 100644 index 00000000000..493160b5590 --- /dev/null +++ b/packages/desktop-client/e2e/page-models/custom-report-page.js @@ -0,0 +1,33 @@ +export class CustomReportPage { + constructor(page) { + this.page = page; + this.pageContent = page.getByTestId('reports-page'); + + this.showLegendButton = this.pageContent.getByRole('button', { + name: 'Show Legend', + }); + this.showSummaryButton = this.pageContent.getByRole('button', { + name: 'Show Summary', + }); + this.showLabelsButton = this.pageContent.getByRole('button', { + name: 'Show Labels', + }); + } + + async selectViz(vizName) { + await this.pageContent.getByRole('button', { name: vizName }).click(); + } + + async selectMode(mode) { + switch (mode) { + case 'total': + await this.pageContent.getByRole('button', { name: 'Total' }).click(); + break; + case 'time': + await this.pageContent.getByRole('button', { name: 'Time' }).click(); + break; + default: + throw new Error(`Unrecognized mode: ${mode}`); + } + } +} diff --git a/packages/desktop-client/e2e/page-models/reports-page.js b/packages/desktop-client/e2e/page-models/reports-page.js index 00933b4699a..d6f6705268a 100644 --- a/packages/desktop-client/e2e/page-models/reports-page.js +++ b/packages/desktop-client/e2e/page-models/reports-page.js @@ -1,3 +1,5 @@ +import { CustomReportPage } from './custom-report-page'; + export class ReportsPage { constructor(page) { this.page = page; @@ -18,6 +20,13 @@ export class ReportsPage { return new ReportsPage(this.page); } + async goToCustomReportPage() { + await this.pageContent + .getByRole('button', { name: 'Create new custom report' }) + .click(); + return new CustomReportPage(this.page); + } + async getAvailableReportList() { return this.pageContent .getByRole('button') diff --git a/packages/desktop-client/e2e/reports.test.js b/packages/desktop-client/e2e/reports.test.js index 1dc4b88047a..dc052e0698f 100644 --- a/packages/desktop-client/e2e/reports.test.js +++ b/packages/desktop-client/e2e/reports.test.js @@ -3,7 +3,7 @@ import { test, expect } from '@playwright/test'; import { ConfigurationPage } from './page-models/configuration-page'; import { Navigation } from './page-models/navigation'; -test.describe('Reports', () => { +test.describe.parallel('Reports', () => { let page; let navigation; let reportsPage; @@ -43,4 +43,66 @@ test.describe('Reports', () => { await reportsPage.goToCashFlowPage(); await expect(page).toMatchThemeScreenshots(); }); + + test.describe.parallel('custom reports', () => { + let customReportPage; + + test.beforeEach(async () => { + customReportPage = await reportsPage.goToCustomReportPage(); + }); + + test('Switches to Data Table and checks the visuals', async () => { + await customReportPage.selectMode('time'); + await customReportPage.selectViz('Data Table'); + await expect(page).toMatchThemeScreenshots(); + }); + + test('Switches to Bar Graph and checks the visuals', async () => { + await customReportPage.selectMode('time'); + await customReportPage.selectViz('Bar Graph'); + await expect(page).toMatchThemeScreenshots(); + }); + + test('Switches to Line Graph and checks the visuals', async () => { + await customReportPage.selectMode('time'); + await customReportPage.selectViz('Line Graph'); + await expect(page).toMatchThemeScreenshots(); + }); + + test('Switches to Area Graph and checks the visuals', async () => { + await customReportPage.selectMode('total'); + await customReportPage.selectViz('Area Graph'); + await expect(page).toMatchThemeScreenshots(); + }); + + test('Switches to Donut Graph and checks the visuals', async () => { + await customReportPage.selectMode('total'); + await customReportPage.selectViz('Donut Graph'); + await expect(page).toMatchThemeScreenshots(); + }); + + test('Validates that "show legend" button shows the legend side-bar', async () => { + await customReportPage.selectViz('Bar Graph'); + await customReportPage.showLegendButton.click(); + await expect(page).toMatchThemeScreenshots(); + + await customReportPage.showLegendButton.click(); + }); + + test('Validates that "show summary" button shows the summary', async () => { + await customReportPage.selectViz('Bar Graph'); + await customReportPage.showSummaryButton.click(); + await expect(page).toMatchThemeScreenshots(); + + await customReportPage.showSummaryButton.click(); + }); + + test('Validates that "show labels" button shows the labels', async () => { + await customReportPage.selectViz('Bar Graph'); + await customReportPage.showLabelsButton.click(); + await expect(page).toMatchThemeScreenshots(); + + await customReportPage.showLabelsButton.click(); + }); + }); }); diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Area-Graph-and-checks-the-visuals-1-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Area-Graph-and-checks-the-visuals-1-chromium-linux.png new file mode 100644 index 00000000000..e7583e1f79b Binary files /dev/null and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Area-Graph-and-checks-the-visuals-1-chromium-linux.png differ diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Area-Graph-and-checks-the-visuals-2-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Area-Graph-and-checks-the-visuals-2-chromium-linux.png new file mode 100644 index 00000000000..0b8a148c384 Binary files /dev/null and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Area-Graph-and-checks-the-visuals-2-chromium-linux.png differ diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Area-Graph-and-checks-the-visuals-3-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Area-Graph-and-checks-the-visuals-3-chromium-linux.png new file mode 100644 index 00000000000..d1323d505ec Binary files /dev/null and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Area-Graph-and-checks-the-visuals-3-chromium-linux.png differ diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Bar-Graph-and-checks-the-visuals-1-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Bar-Graph-and-checks-the-visuals-1-chromium-linux.png new file mode 100644 index 00000000000..4b716b2c6e4 Binary files /dev/null and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Bar-Graph-and-checks-the-visuals-1-chromium-linux.png differ diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Bar-Graph-and-checks-the-visuals-2-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Bar-Graph-and-checks-the-visuals-2-chromium-linux.png new file mode 100644 index 00000000000..b96890c51ee Binary files /dev/null and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Bar-Graph-and-checks-the-visuals-2-chromium-linux.png differ diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Bar-Graph-and-checks-the-visuals-3-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Bar-Graph-and-checks-the-visuals-3-chromium-linux.png new file mode 100644 index 00000000000..4492d7a45e8 Binary files /dev/null and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Bar-Graph-and-checks-the-visuals-3-chromium-linux.png differ diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Data-Table-and-checks-the-visuals-1-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Data-Table-and-checks-the-visuals-1-chromium-linux.png new file mode 100644 index 00000000000..0542f1345f6 Binary files /dev/null and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Data-Table-and-checks-the-visuals-1-chromium-linux.png differ diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Data-Table-and-checks-the-visuals-2-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Data-Table-and-checks-the-visuals-2-chromium-linux.png new file mode 100644 index 00000000000..ca61d3446e7 Binary files /dev/null and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Data-Table-and-checks-the-visuals-2-chromium-linux.png differ diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Data-Table-and-checks-the-visuals-3-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Data-Table-and-checks-the-visuals-3-chromium-linux.png new file mode 100644 index 00000000000..605ea6845c4 Binary files /dev/null and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Data-Table-and-checks-the-visuals-3-chromium-linux.png differ diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Donut-Graph-and-checks-the-visuals-1-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Donut-Graph-and-checks-the-visuals-1-chromium-linux.png new file mode 100644 index 00000000000..36533ee8584 Binary files /dev/null and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Donut-Graph-and-checks-the-visuals-1-chromium-linux.png differ diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Donut-Graph-and-checks-the-visuals-2-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Donut-Graph-and-checks-the-visuals-2-chromium-linux.png new file mode 100644 index 00000000000..9444c4a6506 Binary files /dev/null and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Donut-Graph-and-checks-the-visuals-2-chromium-linux.png differ diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Donut-Graph-and-checks-the-visuals-3-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Donut-Graph-and-checks-the-visuals-3-chromium-linux.png new file mode 100644 index 00000000000..ad263db1c29 Binary files /dev/null and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Donut-Graph-and-checks-the-visuals-3-chromium-linux.png differ diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Line-Graph-and-checks-the-visuals-1-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Line-Graph-and-checks-the-visuals-1-chromium-linux.png new file mode 100644 index 00000000000..9e571511b6d Binary files /dev/null and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Line-Graph-and-checks-the-visuals-1-chromium-linux.png differ diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Line-Graph-and-checks-the-visuals-2-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Line-Graph-and-checks-the-visuals-2-chromium-linux.png new file mode 100644 index 00000000000..11ce2c83779 Binary files /dev/null and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Line-Graph-and-checks-the-visuals-2-chromium-linux.png differ diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Line-Graph-and-checks-the-visuals-3-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Line-Graph-and-checks-the-visuals-3-chromium-linux.png new file mode 100644 index 00000000000..051ddc64d52 Binary files /dev/null and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Line-Graph-and-checks-the-visuals-3-chromium-linux.png differ diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-labels-button-shows-the-labels-1-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-labels-button-shows-the-labels-1-chromium-linux.png new file mode 100644 index 00000000000..c7f9ded996e Binary files /dev/null and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-labels-button-shows-the-labels-1-chromium-linux.png differ diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-labels-button-shows-the-labels-2-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-labels-button-shows-the-labels-2-chromium-linux.png new file mode 100644 index 00000000000..af581605170 Binary files /dev/null and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-labels-button-shows-the-labels-2-chromium-linux.png differ diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-labels-button-shows-the-labels-3-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-labels-button-shows-the-labels-3-chromium-linux.png new file mode 100644 index 00000000000..9be2b3a92c5 Binary files /dev/null and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-labels-button-shows-the-labels-3-chromium-linux.png differ diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-legend-button-shows-the-legend-side-bar-1-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-legend-button-shows-the-legend-side-bar-1-chromium-linux.png new file mode 100644 index 00000000000..088bffbb80a Binary files /dev/null and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-legend-button-shows-the-legend-side-bar-1-chromium-linux.png differ diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-legend-button-shows-the-legend-side-bar-2-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-legend-button-shows-the-legend-side-bar-2-chromium-linux.png new file mode 100644 index 00000000000..6a128879d50 Binary files /dev/null and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-legend-button-shows-the-legend-side-bar-2-chromium-linux.png differ diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-legend-button-shows-the-legend-side-bar-3-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-legend-button-shows-the-legend-side-bar-3-chromium-linux.png new file mode 100644 index 00000000000..81f6ea2264f Binary files /dev/null and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-legend-button-shows-the-legend-side-bar-3-chromium-linux.png differ diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-summary-button-shows-the-summary-1-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-summary-button-shows-the-summary-1-chromium-linux.png new file mode 100644 index 00000000000..4e1278d1d5f Binary files /dev/null and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-summary-button-shows-the-summary-1-chromium-linux.png differ diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-summary-button-shows-the-summary-2-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-summary-button-shows-the-summary-2-chromium-linux.png new file mode 100644 index 00000000000..795961cbb23 Binary files /dev/null and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-summary-button-shows-the-summary-2-chromium-linux.png differ diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-summary-button-shows-the-summary-3-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-summary-button-shows-the-summary-3-chromium-linux.png new file mode 100644 index 00000000000..d9639fb249e Binary files /dev/null and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-summary-button-shows-the-summary-3-chromium-linux.png differ diff --git a/packages/desktop-client/src/components/reports/GraphButton.tsx b/packages/desktop-client/src/components/reports/GraphButton.tsx index 9502d24a139..5b0120f63b6 100644 --- a/packages/desktop-client/src/components/reports/GraphButton.tsx +++ b/packages/desktop-client/src/components/reports/GraphButton.tsx @@ -37,6 +37,7 @@ export const GraphButton = ({ }} onPress={onSelect} isDisabled={disabled} + aria-label={title} > {children} diff --git a/upcoming-release-notes/3493.md b/upcoming-release-notes/3493.md new file mode 100644 index 00000000000..d8686ab1bd7 --- /dev/null +++ b/upcoming-release-notes/3493.md @@ -0,0 +1,6 @@ +--- +category: Maintenance +authors: [MatissJanis] +--- + +Custom reports: added e2e tests to improve stability.