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

Add a playwright test for backup reset / deleted #28858

Merged
merged 4 commits into from
Jan 6, 2025

Conversation

dbkr
Copy link
Member

@dbkr dbkr commented Jan 3, 2025

A slightly tricky one to test but an important case that people can hit, and one that otherwise wouldn't get hit a lot during normal usage, so I think probably quite a useful test to have. Mostly though, I'm about to change this to a toast, so I'd like a test to assert that it still works.

Requires matrix-org/matrix-js-sdk#4601

Checklist

  • Tests written for new code (and old code if feasible).
  • New or updated public/exported symbols have accurate TSDoc documentation.
  • Linter and other CI checks pass.
  • I have licensed the changes to Element by completing the Contributor License Agreement (CLA)

A slightly tricky one to test but an important case that people can hit,
and one that otherwise wouldn't get hit a lot during normal usage, so I
think probably quite a useful test to have. Mostly though, I'm about
to change this to a toast, so I'd like a test to assert that it still works.
playwright/e2e/csAPI.ts Outdated Show resolved Hide resolved
playwright/e2e/csAPI.ts Outdated Show resolved Hide resolved
playwright/e2e/csAPI.ts Outdated Show resolved Hide resolved
// @ts-ignore - this runs in the browser scope where mxMatrixClientPeg is a thing. Here, it is not.
const accessToken = await page.evaluate(() => mxMatrixClientPeg.get().getAccessToken());

const csAPI = new TestClientServerAPI(request, homeserver, accessToken);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use the MatrixClient to delete or to get the current backup info ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was attempting to make it as much like a different client deleting the backup as possible, although what it ended up as isn't really much different from using the app's own matrix client. It still felt a little bit cleaner to use the API separately rather than inject code into the app, but I can change it if that's preferred.

dbkr and others added 2 commits January 6, 2025 15:33
@dbkr dbkr requested a review from florianduros January 6, 2025 15:35
@dbkr dbkr added this pull request to the merge queue Jan 6, 2025
Merged via the queue into develop with commit 29624f7 Jan 6, 2025
35 checks passed
@dbkr dbkr deleted the dbkr/playwright_test_backup_changed branch January 6, 2025 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-Task Tasks for the team like planning
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants