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: Flakiness in location tests #13557

Merged
merged 3 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/web/components/ui/form/LocationSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export default function LocationSelect(props: Props<LocationOption, false, Group
<Select<LocationOption>
name="location"
id="location-select"
data-testid="location-select"
components={{
Option: (props) => {
return (
Expand Down
14 changes: 7 additions & 7 deletions apps/web/playwright/event-types.e2e.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Page } from "@playwright/test";

Check failure on line 1 in apps/web/playwright/event-types.e2e.ts

View workflow job for this annotation

GitHub Actions / E2E tests / E2E tests (3/5)

[@calcom/web] › apps/web/playwright/event-types.e2e.ts:187:11 › Event Types tests -- legacy › user › Different Locations Tests › Can add Organzer Phone Number location and book with it

1) [@***com/web] › apps/web/playwright/event-types.e2e.ts:187:11 › Event Types tests -- legacy › user › Different Locations Tests › Can add Organzer Phone Number location and book with it Test timeout of 60000ms exceeded.

Check failure on line 1 in apps/web/playwright/event-types.e2e.ts

View workflow job for this annotation

GitHub Actions / E2E tests / E2E tests (3/5)

[@calcom/web] › apps/web/playwright/event-types.e2e.ts:187:11 › Event Types tests -- legacy › user › Different Locations Tests › Can add Organzer Phone Number location and book with it

1) [@***com/web] › apps/web/playwright/event-types.e2e.ts:187:11 › Event Types tests -- legacy › user › Different Locations Tests › Can add Organzer Phone Number location and book with it Pending operations: - locator.click at apps/web/playwright/event-types.e2e.ts:191:61
import { expect } from "@playwright/test";

import { WEBAPP_URL } from "@calcom/lib/constants";
Expand Down Expand Up @@ -187,8 +187,8 @@
test("Can add Organzer Phone Number location and book with it", async ({ page }) => {
await gotoFirstEventType(page);

await page.locator("#location-select").click();
await page.getByTestId("location-select").click();
await page.locator(`text="Organizer Phone Number"`).click();

Check failure on line 191 in apps/web/playwright/event-types.e2e.ts

View workflow job for this annotation

GitHub Actions / E2E tests / E2E tests (3/5)

[@calcom/web] › apps/web/playwright/event-types.e2e.ts:187:11 › Event Types tests -- legacy › user › Different Locations Tests › Can add Organzer Phone Number location and book with it

1) [@***com/web] › apps/web/playwright/event-types.e2e.ts:187:11 › Event Types tests -- legacy › user › Different Locations Tests › Can add Organzer Phone Number location and book with it locator.click: Target closed =========================== logs =========================== waiting for locator('text="Organizer Phone Number"') ============================================================ 189 | 190 | await page.getByTestId("location-select").click(); > 191 | await page.locator(`text="Organizer Phone Number"`).click(); | ^ 192 | const locationInputName = "locations[0].hostPhoneNumber"; 193 | await page.locator(`input[name="${locationInputName}"]`).waitFor(); 194 | await page.locator(`input[name="${locationInputName}"]`).fill("9199999999"); at /home/runner/actions-runner/_work/***.com/***.com/apps/web/playwright/event-types.e2e.ts:191:61
const locationInputName = "locations[0].hostPhoneNumber";
await page.locator(`input[name="${locationInputName}"]`).waitFor();
await page.locator(`input[name="${locationInputName}"]`).fill("9199999999");
Expand All @@ -206,7 +206,7 @@
test("Can add Cal video location and book with it", async ({ page }) => {
await gotoFirstEventType(page);

await page.locator("#location-select").click();
await page.getByTestId("location-select").click();
await page.locator(`text="Cal Video (Global)"`).click();

await saveEventType(page);
Expand All @@ -223,7 +223,7 @@
test("Can add Link Meeting as location and book with it", async ({ page }) => {
await gotoFirstEventType(page);

await page.locator("#location-select").click();
await page.getByTestId("location-select").click();
await page.locator(`text="Link meeting"`).click();

const locationInputName = `locations[0].link`;
Expand Down Expand Up @@ -305,7 +305,7 @@
}) => {
await gotoFirstEventType(page);

await page.locator("#location-select").click();
await page.getByTestId("location-select").click();
await page.locator(`text="Link meeting"`).click();

const locationInputName = (idx: number) => `locations[${idx}].link`;
Expand All @@ -331,7 +331,7 @@
await page.getByTestId(removeButtomId).click();

// Add Multiple Organizer Phone Number options
await page.locator("#location-select").click();
await page.getByTestId("location-select").click();
await page.locator(`text="Organizer Phone Number"`).click();

const organizerPhoneNumberInputName = (idx: number) => `locations[${idx}].hostPhoneNumber`;
Expand All @@ -357,7 +357,7 @@

const selectAttendeePhoneNumber = async (page: Page) => {
const locationOptionText = "Attendee Phone Number";
await page.locator("#location-select").click();
await page.getByTestId("location-select").click();
await page.locator(`text=${locationOptionText}`).click();
};

Expand Down Expand Up @@ -393,7 +393,7 @@
const fillLocation = async (page: Page, inputText: string, index: number, selectDisplayLocation = true) => {
// Except the first location, dropdown automatically opens when adding another location
if (index == 0) {
await page.locator("#location-select").last().click();
await page.getByTestId("location-select").last().click();
}
await page.locator("text=In Person (Organizer Address)").last().click();

Expand Down
Loading