Skip to content

Commit

Permalink
Updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mgurgel committed Nov 27, 2024
1 parent bf4e00e commit 172dffc
Show file tree
Hide file tree
Showing 108 changed files with 84 additions and 5 deletions.
4 changes: 2 additions & 2 deletions guides/breakage-flows.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ title: Breakage flows

# Breakage flows

### Flow 1: Show Category-type selection when 'Website not working?' is clicked
### Flow 1: Show Category-type selection when 'Report a problem with this site' is clicked

Open the dashboard with the following query params

- `breakageScreen=categoryTypeSelection`

### Flow 2: Show Category selection when 'Website not working?' is clicked
### Flow 2: Show Category selection when 'Report a problem with this site' is clicked

Open the dashboard with the following query params

Expand Down
2 changes: 1 addition & 1 deletion integration-tests/AltBreakageFlows.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class AltBreakageFlows {

async showsReportFromPrimaryScreen() {
const { page } = this.dash;
await page.getByRole('link', { name: 'Website not working?' }).click();
await page.getByRole('link', { name: 'Report a problem with this site' }).click();
await this.breakageFormIsVisible();
}

Expand Down
2 changes: 1 addition & 1 deletion integration-tests/DashboardPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ export class DashboardPage {
}

async clicksWebsiteNotWorking() {
await this.page.getByRole('link', { name: 'Website not working?' }).click({ timeout: 5000 });
await this.page.getByRole('link', { name: 'Report a problem with this site' }).click({ timeout: 5000 });
}
async showsBreakageForm() {
await this.page.getByText('Submitting an anonymous').waitFor({ timeout: 5000 });
Expand Down
35 changes: 35 additions & 0 deletions integration-tests/android.spec-int.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,41 @@ test.describe('Breakage form', () => {
});
});

test.describe('opens toggle report', () => {
test('sends toggle report', { tag: '@screenshots' }, async ({ page }) => {
/** @type {DashboardPage} */
const dash = await DashboardPage.android(page, { screen: 'toggleReport', opener: 'menu' });
await dash.addState([testDataStates.google]);
await dash.toggleReportIsVisible();
await dash.screenshot('screen-toggle-report.png');
await dash.showsOnlyBackButton('toggleReport');
await dash.sendToggleReport();
});
test('back button rejects toggle report', async ({ page }) => {
/** @type {DashboardPage} */
const dash = await DashboardPage.android(page, { screen: 'toggleReport', opener: 'menu' });
await dash.addState([testDataStates.google]);
await dash.toggleReportIsVisible();
await dash.backButtonRejectsToggleReport();
});
test('rejects toggle report', async ({ page }) => {
/** @type {DashboardPage} */
const dash = await DashboardPage.android(page, { screen: 'toggleReport', opener: 'dashboard' });
await dash.addState([testDataStates.google]);
await dash.toggleReportIsVisible();
await dash.rejectToggleReport();
});
test('shows information once', { tag: '@screenshots' }, async ({ page }) => {
/** @type {DashboardPage} */
const dash = await DashboardPage.android(page, { screen: 'toggleReport', opener: 'dashboard' });
await dash.addState([testDataStates.google]);
await dash.toggleReportIsVisible();
await dash.showsInformation();
await dash.cannotHideInformation();
await dash.screenshot('screen-toggle-report-show.png');
});
});

test.describe('Close', () => {
test('pressing close should call native API', async ({ page }) => {
const dash = await DashboardPage.android(page);
Expand Down
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion integration-tests/macos.spec-int.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ test.describe('opening breakage form', () => {
await dash.showsInformation();
await dash.mocks.calledForSeeWhatsSent();
await dash.screenshot('screen-toggle-report-show.png');
await dash.hidesInformation();
});
});

Expand Down
45 changes: 45 additions & 0 deletions integration-tests/windows.spec-int.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,51 @@ test.describe('opening breakage form', () => {
});
});

test.describe('toggle report', () => {
test('shows toggle report when opened from menu', { tag: '@screenshots' }, async ({ page }) => {
/** @type {DashboardPage} */
const dash = await DashboardPage.windows(page, { screen: 'toggleReport', opener: 'menu' });
await dash.addState([testDataStates.google]);
await dash.toggleReportIsVisible();
await dash.screenshot('screen-toggle-report-menu.png');
});
test('shows toggle report when opened from dashboard', { tag: '@screenshots' }, async ({ page }) => {
/** @type {DashboardPage} */
const dash = await DashboardPage.windows(page, { screen: 'toggleReport', opener: 'dashboard' });
await dash.addState([testDataStates.google]);
await dash.toggleReportIsVisible();
await dash.screenshot('screen-toggle-report-dashboard.png');
});
test('sends toggle report', { tag: '@screenshots' }, async ({ page }) => {
/** @type {DashboardPage} */
const dash = await DashboardPage.windows(page, { screen: 'toggleReport', opener: 'dashboard' });
await dash.addState([testDataStates.google]);
await dash.toggleReportIsVisible();
await dash.sendToggleReport();

// this is macOS specific:
await dash.showsSuccessScreen();
await dash.screenshot('screen-toggle-report-sent.png');
await dash.clickingSuccessScreenClosesDashboard();
});
test('rejects toggle report', async ({ page }) => {
/** @type {DashboardPage} */
const dash = await DashboardPage.windows(page, { screen: 'toggleReport', opener: 'dashboard' });
await dash.addState([testDataStates.google]);
await dash.toggleReportIsVisible();
await dash.rejectToggleReport();
});
test('shows information', { tag: '@screenshots' }, async ({ page }) => {
/** @type {DashboardPage} */
const dash = await DashboardPage.windows(page, { screen: 'toggleReport', opener: 'dashboard' });
await dash.addState([testDataStates.google]);
await dash.toggleReportIsVisible();
await dash.showsInformation();
await dash.mocks.calledForSeeWhatsSent();
await dash.screenshot('screen-toggle-report-show.png');
});
});

test.describe('Protections toggle', () => {
toggleFlows((page) => DashboardPage.windows(page));
});
Expand Down

0 comments on commit 172dffc

Please sign in to comment.