-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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: team and org invite e2e tests #12566
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
5 Ignored Deployments
|
Current dependencies on/for this PR: This stack of pull requests is managed by Graphite. |
Thank you for following the naming conventions! 🙏 Feel free to join our discord and post your PR link to collect XP and win prizes! |
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.
Self review done
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.
Removed as it is very flaky by nature. Also relying in hacks like setTimeOut which makes it inconsistent across different machine speeds.
apps/web/playwright/lib/testUtils.ts
Outdated
export async function getInviteLink(page: Page) { | ||
const response = await page.waitForResponse("**/api/trpc/teams/createInvite?batch=1"); | ||
const json = await response.json(); | ||
// @ts-expect-error trust me bro | ||
const date = json[0].result.data.json.inviteLink as string; | ||
} |
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.
Instead of relying on the clipboard. I've refactored the endpoint so it returns the fully formed inviteLink from the server according to the team context.
|
||
const inviteLink = | ||
isOrgInvite || (props?.orgMembers && props.orgMembers?.length > 0) ? orgInviteLink : teamInviteLink; | ||
const copyInviteLinkToClipboard = async (inviteLink: string) => { |
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.
We send the fully formed invite link from the server
accepted: true, | ||
OR: [{ role: "ADMIN" }, { role: "OWNER" }], | ||
}, | ||
include: { team: true }, |
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.
So we don't double query and can reuse the response
async function getInviteLink() { | ||
const teamInviteLink = `${WEBAPP_URL}/teams?token=${token}`; | ||
const orgInviteLink = `${WEBAPP_URL}/signup?token=${token}&callbackUrl=/getting-started`; | ||
if (!isOrg) return teamInviteLink; | ||
// Only fetch if is not an org | ||
const orgMembers = await getMembersHandler({ | ||
ctx, | ||
input: { teamIdToExclude: teamId, distinctUser: true }, | ||
}); | ||
if (!orgMembers) return teamInviteLink; | ||
if (orgMembers.length < 1) return teamInviteLink; | ||
return orgInviteLink; | ||
} |
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.
In here we have all the context to form the invite link instead of relying on the client to do so.
📦 Next.js Bundle Analysis for @calcom/webThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
Current Playwright Test Results Summary✅ 341 Passing - Run may still be in progress, this comment will be updated as current testing workflow or job completes... (Last updated on 11/28/2023 06:40:32am UTC) Run DetailsRunning Workflow PR Update on Github Actions Commit: fd7caf6 Started: 11/28/2023 06:32:56am UTC
|
Test Case | Last 7 days Failures | Last 7 days Flakes |
---|---|---|
Change username on settings User can change username to include periods(or dots)
Retry 1 • Initial Attempt |
0.80% (2)2 / 251 runsfailed over last 7 days |
2.79% (7)7 / 251 runsflaked over last 7 days |
📄 apps/web/playwright/webhook.e2e.ts • 1 Flake
Test Case Results
Test Case | Last 7 days Failures | Last 7 days Flakes |
---|---|---|
FORM_SUBMITTED on submitting team form, triggers team webhook
Retry 2 • Retry 1 • Initial Attempt |
3.41% (9)9 / 264 runsfailed over last 7 days |
16.67% (44)44 / 264 runsflaked over last 7 days |
📄 apps/web/playwright/booking/phoneQuestion.e2e.ts • 1 Flake
Test Case Results
Test Case | Last 7 days Failures | Last 7 days Flakes |
---|---|---|
Booking With Phone Question and Each Other Question Booking With Phone Question and Address Question Booking With Phone Question and Multi email Question Phone required and Multi email not required
Retry 1 • Initial Attempt |
0.40% (1)1 / 253 runfailed over last 7 days |
0.79% (2)2 / 253 runsflaked over last 7 days |
📄 apps/web/playwright/event-types.e2e.ts • 1 Flake
Test Case Results
Test Case | Last 7 days Failures | Last 7 days Flakes |
---|---|---|
Event Types tests user -- future Different Locations Tests Can add Organzer Phone Number location and book with it
Retry 1 • Initial Attempt |
-0.61% (-1)-1 / 163 runsfailed over last 7 days |
6.75% (11)11 / 163 runsflaked over last 7 days |
📄 apps/web/playwright/organization/organization-creation.e2e.ts • 1 Flake
Test Case Results
Test Case | Last 7 days Failures | Last 7 days Flakes |
---|---|---|
Organization should be able to create an organization and complete onboarding
Retry 1 • Initial Attempt |
2.65% (6)6 / 226 runsfailed over last 7 days |
94.69% (214)214 / 226 runsflaked over last 7 days |
📄 packages/embeds/embed-core/playwright/tests/action-based.e2e.ts • 2 Flakes
Top 1 Common Error Messages
|
2 Test Cases Affected |
Test Case Results
Test Case | Last 7 days Failures | Last 7 days Flakes |
---|---|---|
Popup Tests should open embed iframe on click - Configured with light theme
Retry 1 • Initial Attempt |
0.37% (1)1 / 273 runfailed over last 7 days |
53.48% (146)146 / 273 runsflaked over last 7 days |
Popup Tests should be able to reschedule
Retry 1 • Initial Attempt |
8.42% (23)23 / 273 runsfailed over last 7 days |
88.28% (241)241 / 273 runsflaked over last 7 days |
📄 packages/app-store/routing-forms/playwright/tests/basic.e2e.ts • 1 Flake
Test Case Results
Test Case | Last 7 days Failures | Last 7 days Flakes |
---|---|---|
Routing Forms Seeded Routing Form Routing Link should validate fields
Retry 1 • Initial Attempt |
0.77% (2)2 / 261 runsfailed over last 7 days |
8.43% (22)22 / 261 runsflaked over last 7 days |
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.
LGTM - good fix. Clipboard was very flaky even in local so this is great
What does this PR do?
Type of change
How should this be tested?
Run tests for:
Mandatory Tasks