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

feat: convert report user test to Playwright #54683

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion client/src/client-only-routes/show-user.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ function ShowUser({
<FormGroup controlId='report-user-textarea'>
<ControlLabel>{t('report.what')}</ControlLabel>
<FormControl
data-cy='report-user'
componentClass='textarea'
onChange={handleChange}
placeholder={t('report.details')}
Expand Down
21 changes: 0 additions & 21 deletions cypress/e2e/default/user/report-user.ts

This file was deleted.

23 changes: 23 additions & 0 deletions e2e/report-user.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { test, expect } from '@playwright/test';
test.use({ storageState: 'playwright/.auth/certified-user.json' });

//TODO: run email server?
Sembauke marked this conversation as resolved.
Show resolved Hide resolved

test('should be possible to report a user from their profile page', async ({
page
}) => {
await page.goto('/twaha');

// The following line is required if you're running the test in local development
// await page.getByRole('button', { name: 'Preview custom 404 page' }).click();

await page.getByText("Flag This User's Account for Abuse").click();

await expect(
page.getByText("Do you want to report twaha's portfolio for abuse?")
).toBeVisible();

await page.getByRole('textbox').nth(1).fill('Some details');
await page.getByRole('button', { name: 'Submit the report' }).click();
await expect(page).toHaveURL('/learn');
});