Skip to content

fix: Add e2e test for routing forms webhook subscription#9401

Merged
keithwillcode merged 9 commits intocalcom:mainfrom
tachyonicbytes:9038
Jun 13, 2023
Merged

fix: Add e2e test for routing forms webhook subscription#9401
keithwillcode merged 9 commits intocalcom:mainfrom
tachyonicbytes:9038

Conversation

@tachyonicbytes
Copy link
Copy Markdown
Contributor

@tachyonicbytes tachyonicbytes commented Jun 7, 2023

What does this PR do?

Add e2e test for routing forms webhook subscription
I also moved the gotoRoutingLink function used for routing form testing into the @calcom/web/playwright/lib/testUtils module

Fixes #9038

Type of change

  • Chore (add e2e test)

How should this be tested?

  • Run the e2e test: yarn test-e2e webhook -g "FORM_SUBMITTED"

Please let me know if there are more asserts to add.

/claim #9038

@vercel
Copy link
Copy Markdown

vercel bot commented Jun 7, 2023

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

Name Status Preview Comments Updated (UTC)
ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 13, 2023 6:25am

@vercel
Copy link
Copy Markdown

vercel bot commented Jun 7, 2023

Someone is attempting to deploy a commit to the cal Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions bot added Low priority Created by Linear-GitHub Sync 💎 Bounty A bounty on Algora.io automated-tests area: unit tests, e2e tests, playwright labels Jun 7, 2023
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jun 7, 2023

📦 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! 🙌

@tachyonicbytes tachyonicbytes changed the title Add e2e test for routing forms webhook subscription fix: Add e2e test for routing forms webhook subscription Jun 7, 2023
@usmaann1
Copy link
Copy Markdown

usmaann1 commented Jun 8, 2023

/claim #9038

Test Plan: End-to-End Testing for Routing Forms Webhook Subscription

Objective:
The objective of this test plan is to perform end-to-end testing for the routing forms webhook subscription. The test plan includes both manual tests and automated tests to ensure comprehensive verification. The focus will be on running the e2e test using the specified command and verifying the functionality of the gotoRoutingLink function.

Test Scope:
The test scope includes executing the e2e test specifically for the webhook subscription of routing forms. The test plan will cover the functionality of the gotoRoutingLink function after its relocation to the @calcom/web/playwright/lib/testUtils module.

Test Environment:
The test environment should consist of:

The application or system where the routing forms webhook subscription is implemented.
Access to the routing forms and their webhook configuration.
Test data or content to simulate the submission of a routing form.
Test Plan:
4.1 Manual Test:

4.1.1 Manual Verification of Routing Forms Webhook Subscription:
Objective: To manually verify the functionality of the routing forms webhook subscription.
Steps:

  • Identify the routing forms that are configured with webhook subscriptions.
  • Generate test data or content that represents a valid submission for a routing form.
  • Submit the test data through the routing form.
  • Monitor the webhook endpoint or logs to confirm that the webhook is triggered.
  • Verify that the expected data from the form submission is received by the webhook endpoint.

4.1.2 Manual Testing of gotoRoutingLink Function:
Objective: To manually test the gotoRoutingLink function after its relocation to the @calcom/web/playwright/lib/testUtils module.

Steps:

  • Identify the test scenarios or conditions in which the gotoRoutingLink function is expected to be invoked.
  • Manually trigger the gotoRoutingLink function with the appropriate parameters in each identified scenario.
  • Verify that the function successfully navigates to the expected routing link.
  • Confirm that the routed page or destination corresponds to the expected behavior.

4.2 Automated Test:

4.2.1 End-to-End Testing for Routing Forms Webhook Subscription:
Objective: To automate the end-to-end testing of the webhook subscription for routing forms.
Steps:

  • Develop an e2e test script specifically for testing the webhook subscription functionality.
  • Configure the test script to simulate the submission of a routing form with test data.
  • Ensure that the test script triggers the webhook endpoint.
  • Verify that the expected data from the form submission is received by the webhook endpoint.
  • Implement assertions in the test script to validate the correctness of the received data.
  • Execute the e2e test script using the specified command: yarn test-e2e webhook -g "FORM_SUBMITTED".
  • Review the test results and ensure that all assertions pass, indicating the successful webhook subscription functionality.

Test Reporting:
For each test, document the observed results, any deviations from expected behavior, and any defects found during testing. Report and track the issues found using a bug-tracking system.

Test Completion Criteria:
The test execution is considered complete when:

  • The manual verification of the webhook subscription for routing forms has been performed and documented.
  • The manual testing of the gotoRoutingLink function has been executed, and the results are documented.
  • The e2e test for the webhook subscription using the specified command has been executed, and the test results are documented.

@keithwillcode keithwillcode requested a review from a team June 8, 2023 13:39
Copy link
Copy Markdown
Member

@CarinaWolli CarinaWolli left a comment

Choose a reason for hiding this comment

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

Tests and type checks are failing because saveCurrentForm function got deleted

await new Promise((resolve) => setTimeout(resolve, 500));
}

async function saveCurrentForm(page: Page) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

we still need that function

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the tip! On it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

@tachyonicbytes
Copy link
Copy Markdown
Contributor Author

The pipeline passes now.

@keithwillcode keithwillcode self-requested a review June 13, 2023 15:21
@keithwillcode keithwillcode added this pull request to the merge queue Jun 13, 2023
Merged via the queue into calcom:main with commit e081a4c Jun 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automated-tests area: unit tests, e2e tests, playwright 💎 Bounty A bounty on Algora.io Low priority Created by Linear-GitHub Sync

Projects

No open projects
Status: No status

Development

Successfully merging this pull request may close these issues.

[CAL-1737] Write FORM_SUBMITTED webhook e2e test

5 participants