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

[Playwright] Remove API mocks #54134

Open
4 tasks
huyenltnguyen opened this issue Mar 18, 2024 · 1 comment
Open
4 tasks

[Playwright] Remove API mocks #54134

huyenltnguyen opened this issue Mar 18, 2024 · 1 comment
Assignees
Labels
scope: tools/scripts Scripts for supporting dev work, generating config and build artifacts, etc. status: discussing Under discussion threads. Closed as stale after 60 days of inactivity.

Comments

@huyenltnguyen
Copy link
Member

huyenltnguyen commented Mar 18, 2024

Description

Remove API mocks from Playwright tests so that our tests are truly end-to-end.

With the mocks being removed, the first test in the suite will pass but subsequent test cases will fail. It's because the DB would be changed after actual APIs are called in the first test. I think we will need to reseed the DB after each test case, but I'm not sure if it would be straightforward.

I'm imagining something like this:

test.beforeEach(() => {
  test.use({ storageState: 'playwright/.auth/certified-user.json' });
})

test.afterEach(() => {
  test.use({ storageState: { cookies: [], origins: [] } });
})

More advanced setup: https://playwright.dev/docs/auth#moderate-one-account-per-parallel-worker.


@huyenltnguyen huyenltnguyen added scope: tools/scripts Scripts for supporting dev work, generating config and build artifacts, etc. status: discussing Under discussion threads. Closed as stale after 60 days of inactivity. labels Mar 18, 2024
@ojeytonwilliams ojeytonwilliams added this to the Backend API MVP milestone Mar 18, 2024
@ojeytonwilliams
Copy link
Contributor

Thanks, for raising this issue Huyen. It's important that we make these changes before the api migration since the mocks make our tests less useful for detecting differences between the old and new apis.

@ojeytonwilliams ojeytonwilliams self-assigned this Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: tools/scripts Scripts for supporting dev work, generating config and build artifacts, etc. status: discussing Under discussion threads. Closed as stale after 60 days of inactivity.
Projects
Status: Discussing
Development

No branches or pull requests

2 participants