Skip to content

Commit

Permalink
Copy review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
mgurgel committed Nov 22, 2024
1 parent 6586630 commit 4d1bdee
Show file tree
Hide file tree
Showing 19 changed files with 248 additions and 139 deletions.
3 changes: 2 additions & 1 deletion guides/toggle-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,12 @@ The following are all sent in response to user interactions
| ------------------- | ------------------------------------------------------------------------------------------------------------------ |
| appVersion | App version number |
| atb | Anonymous experiment group for feature testing |
| description | Your selected category and optional comments |
| device | Device make, model, and manufacturer |
| didOpenReportInfo | Whether or not you opted to show this report info |
| errorDescriptions | Browser-reported errors |
| extensionVersion | Extension version number |
| features | List of which protections and browser features were active |
| features | List of which browser features were active |
| httpErrorCodes | Website response status (HTTP) codes |
| jsPerformance | How quickly parts of the page loaded |
| lastSentDay | Date of last report sent for this site |
Expand Down
17 changes: 15 additions & 2 deletions integration-tests/DashboardPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -426,8 +426,21 @@ export class DashboardPage {
await this.page.getByLabel('Something else').waitFor();
}

async breakageFormIsVisible() {
await this.page.getByRole('button', { name: 'Send Report' }).waitFor();
async breakageFormIsVisible(categoryText) {
const formView = this.page.getByTestId('subview-breakageFormFinalStep');

await formView.getByRole('button', { name: 'Send Report' }).waitFor();
if (categoryText) {
await formView.getByText(categoryText).waitFor();
}
}

async descriptionPromptIsVisible() {
await this.page.getByText('What happened?').waitFor();
}

async descriptionPromptIsNotVisible() {
await expect(this.page.getByText('What happened?')).not.toBeVisible();
}

/**
Expand Down
15 changes: 15 additions & 0 deletions integration-tests/android.spec-int.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,26 @@ test.describe('breakage form', () => {
await dash.screenshot('category-selection.png');
await dash.selectsCategory('Site layout broken', 'layout');
await dash.breakageFormIsVisible();
await dash.descriptionPromptIsVisible();
await dash.screenshot('screen-breakage-form.png');
await dash.submitFeedbackForm();
await dash.mocks.calledForSubmitBreakageForm({ category: 'layout', description: '' });
});

test('hides description prompt on "dislike" category', { tag: '@screenshots' }, async ({ page }) => {
/** @type {DashboardPage} */
const dash = await DashboardPage.webkit(page, {
screen: 'breakageForm',
randomisedCategories: 'false',
platform: 'macos',
});
await dash.addState([testDataStates.google]);
await dash.selectsCategoryType('I dislike the content on this site', 'dislike');
await dash.breakageFormIsVisible('I dislike the content');
await dash.descriptionPromptIsNotVisible();
await dash.screenshot('category-type-dislike.png');
});

test('skips to breakage form when disliked', async ({ page }) => {
/** @type {DashboardPage} */
const dash = await DashboardPage.android(page, { screen: 'breakageForm' });
Expand Down
15 changes: 15 additions & 0 deletions integration-tests/browser.spec-int.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,26 @@ test.describe('breakage form', () => {
await dash.screenshot('category-selection.png');
await dash.selectsCategory('Site layout broken', 'layout');
await dash.breakageFormIsVisible();
await dash.descriptionPromptIsVisible();
await dash.screenshot('screen-breakage-form.png');
await dash.submitFeedbackForm();
await dash.mocks.calledForSubmitBreakageForm({ category: 'layout', description: '' });
});

test('hides description prompt on "dislike" category', { tag: '@screenshots' }, async ({ page }) => {
/** @type {DashboardPage} */
const dash = await DashboardPage.webkit(page, {
screen: 'breakageForm',
randomisedCategories: 'false',
platform: 'macos',
});
await dash.addState([testDataStates.google]);
await dash.selectsCategoryType('I dislike the content on this site', 'dislike');
await dash.breakageFormIsVisible('I dislike the content');
await dash.descriptionPromptIsNotVisible();
await dash.screenshot('category-type-dislike.png');
});

test('skips to breakage form when disliked', async ({ page }) => {
/** @type {DashboardPage} */
const dash = await DashboardPage.browser(page, testDataStates.google, { screen: 'breakageForm' });
Expand Down
15 changes: 15 additions & 0 deletions integration-tests/ios.spec-int.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,26 @@ test.describe('breakage form', () => {
await dash.screenshot('category-selection.png');
await dash.selectsCategory('Site layout broken', 'layout');
await dash.breakageFormIsVisible();
await dash.descriptionPromptIsVisible();
await dash.screenshot('screen-breakage-form.png');
await dash.submitFeedbackForm();
await dash.mocks.calledForSubmitBreakageForm({ category: 'layout', description: '' });
});

test('hides description prompt on "dislike" category', { tag: '@screenshots' }, async ({ page }) => {
/** @type {DashboardPage} */
const dash = await DashboardPage.webkit(page, {
screen: 'breakageForm',
randomisedCategories: 'false',
platform: 'macos',
});
await dash.addState([testDataStates.google]);
await dash.selectsCategoryType('I dislike the content on this site', 'dislike');
await dash.breakageFormIsVisible('I dislike the content');
await dash.descriptionPromptIsNotVisible();
await dash.screenshot('category-type-dislike.png');
});

test('skips to breakage form when disliked', async ({ page }) => {
/** @type {DashboardPage} */
const dash = await DashboardPage.webkit(page, { screen: 'breakageForm', platform: 'ios' });
Expand Down
15 changes: 15 additions & 0 deletions integration-tests/macos.spec-int.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,27 @@ test.describe('breakage form', () => {
await dash.screenshot('category-selection.png');
await dash.selectsCategory('Site layout broken', 'layout');
await dash.breakageFormIsVisible();
await dash.descriptionPromptIsVisible();
await dash.screenshot('screen-breakage-form.png');
await dash.submitFeedbackForm();
await dash.showsBreakageFormSuccessScreen();
await dash.mocks.calledForSubmitBreakageForm({ category: 'layout', description: '' });
});

test('hides description prompt on "dislike" category', { tag: '@screenshots' }, async ({ page }) => {
/** @type {DashboardPage} */
const dash = await DashboardPage.webkit(page, {
screen: 'breakageForm',
randomisedCategories: 'false',
platform: 'macos',
});
await dash.addState([testDataStates.google]);
await dash.selectsCategoryType('I dislike the content on this site', 'dislike');
await dash.breakageFormIsVisible('I dislike the content');
await dash.descriptionPromptIsNotVisible();
await dash.screenshot('category-type-dislike.png');
});

test('skips to breakage form when disliked', async ({ page }) => {
/** @type {DashboardPage} */
const dash = await DashboardPage.webkit(page, { screen: 'breakageForm', platform: 'macos' });
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.
15 changes: 15 additions & 0 deletions integration-tests/windows.spec-int.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,27 @@ test.describe('breakage form', () => {
await dash.screenshot('category-selection.png');
await dash.selectsCategory('Site layout broken', 'layout');
await dash.breakageFormIsVisible();
await dash.descriptionPromptIsVisible();
await dash.screenshot('screen-breakage-form.png');
await dash.submitFeedbackForm();
await dash.showsBreakageFormSuccessScreen();
await dash.mocks.calledForSubmitBreakageForm({ category: 'layout', description: '' });
});

test('hides description prompt on "dislike" category', { tag: '@screenshots' }, async ({ page }) => {
/** @type {DashboardPage} */
const dash = await DashboardPage.webkit(page, {
screen: 'breakageForm',
randomisedCategories: 'false',
platform: 'macos',
});
await dash.addState([testDataStates.google]);
await dash.selectsCategoryType('I dislike the content on this site', 'dislike');
await dash.breakageFormIsVisible('I dislike the content');
await dash.descriptionPromptIsNotVisible();
await dash.screenshot('category-type-dislike.png');
});

test('skips to breakage form when disliked', async ({ page }) => {
/** @type {DashboardPage} */
const dash = await DashboardPage.windows(page, { screen: 'breakageForm' });
Expand Down
3 changes: 3 additions & 0 deletions schema/__fixtures__/toggle-report-screen.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@
},
{
"id": "locale"
},
{
"id": "description"
}
]
}
44 changes: 23 additions & 21 deletions schema/__generated__/schema.parsers.mjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4d1bdee

Please sign in to comment.