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

New Topic Page Playwright Tests #2191

Conversation

yonadavGit
Copy link
Contributor

Description

New tests for validation of basic Topic Pages functinality
added new users to test database as well as envionment vars with users data.

Code Changes

The following changes were made to the files below

Notes

Any additional notes go here

test('Check redirection for sourceless topic', async ({ context }) => {
const page = await goToPageWithLang(context, '/topics/Monkey');
const expectedUrl = 'search?q=Monkey&tab=sheet&tvar=1&tsort=relevance&stopics_enFilters=Monkey&svar=1&ssort=relevance';
await page.waitForTimeout(10000)
Copy link
Contributor

Choose a reason for hiding this comment

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

We should try to avoid timeouts at all costs as they either make the tests brittle (when too short) and greatly increase the run time (when too long). Is there no better way to do this? I think you can await an element on the search page to exist.


test('Check no redirection when user is admin', async ({ context }) => {
const page = await goToPageWithUser(context, '/topics/Monkey', testAdminUser);
await page.waitForTimeout(10000)
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here. Why does the await on line 53 not suffice?

@nsantacruz nsantacruz merged commit 14cd1b7 into master Dec 19, 2024
22 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants