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

fix: 2FA OTP flaky test #13583

Merged
merged 5 commits into from
Feb 7, 2024
Merged

fix: 2FA OTP flaky test #13583

merged 5 commits into from
Feb 7, 2024

Conversation

Udit-takkar
Copy link
Contributor

What does this PR do?

Fixes # (issue)

Reason why this test failed:-

We auto submit 2FA code when all the input elements are filled. In the E2E we first test wrong input and check for error message but when we fill in the correct six digit code every time we fill the code in input the form gets auto submitted because of

  useEffect(() => {
    if (totpCode?.trim().length === 6) {
      form.handleSubmit(handleEnableRef.current)();
    }
  }, [form, handleEnableRef, totpCode]);
  

so an edge case like in the screenshot while we are filling in the code the last digit is same of both the correct code and incorrect code the form will successfully get submitted and line page.fill
locator('input[name="2fa6"]') failed

Screenshot 2024-02-07 at 6 16 51 PM

Requirement/Documentation

  • If there is a requirement document, please, share it here.
  • If there is ab UI/UX design document, please, share it here.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

@Udit-takkar Udit-takkar added the Urgent Created by Linear-GitHub Sync label Feb 7, 2024
@Udit-takkar Udit-takkar added this to the v3.8 milestone Feb 7, 2024
Copy link

vercel bot commented Feb 7, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
api ✅ Ready (Inspect) Visit Preview Feb 7, 2024 4:54pm
6 Ignored Deployments
Name Status Preview Comments Updated (UTC)
ai ⬜️ Ignored (Inspect) Visit Preview Feb 7, 2024 4:54pm
cal ⬜️ Ignored (Inspect) Visit Preview Feb 7, 2024 4:54pm
cal-demo ⬜️ Ignored (Inspect) Visit Preview Feb 7, 2024 4:54pm
calcom-web-canary ⬜️ Ignored (Inspect) Visit Preview Feb 7, 2024 4:54pm
qa ⬜️ Ignored (Inspect) Visit Preview Feb 7, 2024 4:54pm
ui ⬜️ Ignored (Inspect) Visit Preview Feb 7, 2024 4:54pm

Copy link
Contributor

github-actions bot commented Feb 7, 2024

Thank you for following the naming conventions! 🙏 Feel free to join our discord and post your PR link.

@keithwillcode keithwillcode added consumer core area: core, team members only labels Feb 7, 2024
Comment on lines +45 to +46
await removeOtpInput(page);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removing last digit to prevent auto submitting of form while we fill the correct OTP in the next line

Copy link
Contributor

github-actions bot commented Feb 7, 2024

📦 Next.js Bundle Analysis for @calcom/web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

Copy link

deploysentinel bot commented Feb 7, 2024

Current Playwright Test Results Summary

✅ 2 Passing - ⚠️ 1 Flaky

Run may still be in progress, this comment will be updated as current testing workflow or job completes...

(Last updated on 02/07/2024 07:01:39pm UTC)

Run Details

Running Workflow PR Update on Github Actions

Commit: 441ff32

Started: 02/07/2024 07:00:36pm UTC

⚠️ Flakes

📄   packages/embeds/embed-core/playwright/tests/preview.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Preview Preview - embed-core should load
Retry 1Initial Attempt
0% (0) 0 / 340 runs
failed over last 7 days
30.59% (104) 104 / 340 runs
flaked over last 7 days

View Detailed Build Results


keithwillcode
keithwillcode previously approved these changes Feb 7, 2024
Copy link
Member

@zomars zomars left a comment

Choose a reason for hiding this comment

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

LGTM

@keithwillcode keithwillcode deleted the fix/2fa-test-follow-up branch February 7, 2024 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
consumer core area: core, team members only Urgent Created by Linear-GitHub Sync
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants