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

🧪 (tests) adding custom report e2e tests #3493

Merged
merged 1 commit into from
Sep 23, 2024
Merged
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
33 changes: 33 additions & 0 deletions packages/desktop-client/e2e/page-models/custom-report-page.js
Original file line number Diff line number Diff line change
@@ -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',
});
}
MatissJanis marked this conversation as resolved.
Show resolved Hide resolved

async selectViz(vizName) {
await this.pageContent.getByRole('button', { name: vizName }).click();
}
MatissJanis marked this conversation as resolved.
Show resolved Hide resolved

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}`);
}
}
MatissJanis marked this conversation as resolved.
Show resolved Hide resolved
}
9 changes: 9 additions & 0 deletions packages/desktop-client/e2e/page-models/reports-page.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { CustomReportPage } from './custom-report-page';

export class ReportsPage {
constructor(page) {
this.page = page;
Expand All @@ -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')
Expand Down
64 changes: 63 additions & 1 deletion packages/desktop-client/e2e/reports.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
MatissJanis marked this conversation as resolved.
Show resolved Hide resolved
let page;
let navigation;
let reportsPage;
Expand Down Expand Up @@ -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();
});
MatissJanis marked this conversation as resolved.
Show resolved Hide resolved

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();
});
MatissJanis marked this conversation as resolved.
Show resolved Hide resolved

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();
});
MatissJanis marked this conversation as resolved.
Show resolved Hide resolved
});
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export const GraphButton = ({
}}
onPress={onSelect}
isDisabled={disabled}
aria-label={title}
>
{children}
</Button>
Expand Down
6 changes: 6 additions & 0 deletions upcoming-release-notes/3493.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Maintenance
authors: [MatissJanis]
---

Custom reports: added e2e tests to improve stability.
Loading