-
Notifications
You must be signed in to change notification settings - Fork 903
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
hotfix: e2e tests #2164
hotfix: e2e tests #2164
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ |
Hey there and thank you for opening this pull request! 👋🏼 We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted. Details:
|
apps/web/playwright/utils/helper.tsIt's a good practice to use constants for repeated strings. This makes the code easier to maintain and less prone to typos. const EMAIL_PLACEHOLDER = "work@email.com";
const PASSWORD_PLACEHOLDER = "*******";
const CONTINUE_WITH_EMAIL_BUTTON = "Continue with Email";
const LOGIN_WITH_EMAIL_BUTTON = "Login with Email";
const IN_APP_SURVEYS_BUTTON = "In-app Surveys Run a survey";
const I_AM_NOT_SURE_BUTTON = "I am not sure how to do this";
const INVITE_BUTTON = "Invite";
const MY_PRODUCT_TEXT = "My Product";
apps/web/playwright/js.spec.tsIt's a good practice to minimize the use of // Replace
await page.waitForTimeout(1000);
// With
await page.waitForSelector("selector");
apps/web/app/(app)/environments/[environmentId]/settings/members/components/EditMemberships/MemberActions.tsxIt's a good practice to avoid logging errors directly to the console in production code. This can potentially expose sensitive information. Instead, use a logging library that can be configured to log errors in a secure manner. // Replace
console.log({ err });
// With
logger.error(err);
|
@@ -64,7 +64,8 @@ test.describe("JS Package Test", async () => { | |||
// Formbricks Modal is visible | |||
await expect(page.getByRole("link", { name: "Powered by Formbricks" })).toBeVisible(); | |||
|
|||
await page.waitForTimeout(1000); | |||
await page.waitForLoadState("networkidle"); | |||
await page.waitForTimeout(1500); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replacing waitForTimeout
with more specific wait conditions to improve test performance and reliability.
await page.waitForTimeout(1500); | |
await page.waitForSelector("#formbricks-modal-container"); |
What does this PR do?
Fixes # (issue)
How should this be tested?
Checklist
Required
pnpm build
console.logs
git pull origin main
Appreciated