Change way to grab element

This commit is contained in:
gitstart-calcom 2024-01-04 16:18:05 +00:00
parent 763434ef5f
commit df8a222b24
2 changed files with 5 additions and 6 deletions

View File

@ -41,16 +41,15 @@ export function createEventTypeFixture(page: Page) {
const saturday = (await localize("en"))("saturday");
const save = (await localize("en"))("save");
const copyTimesTo = (await localize("en"))("copy_times_to");
const availabilityUpdatedSuccessfully = (await localize("en"))("availability_updated_successfully");
await page.getByTestId("availablity-title").click();
// change availability name
await page.getByTestId("availablity-title").fill("Working Hours test");
await expect(page.getByTestId("subtitle")).toBeVisible();
await page.locator("label").filter({ hasText: sunday }).getByRole("switch").click();
await page.locator("div").filter({ hasText: monday }).first().click();
await page.locator("label").filter({ hasText: wednesday }).getByRole("switch").click();
await page.locator("label").filter({ hasText: saturday }).getByRole("switch").click();
await page.getByTestId(sunday).getByRole("switch").click();
await page.getByTestId(monday).first().click();
await page.getByTestId(wednesday).getByRole("switch").click();
await page.getByTestId(saturday).getByRole("switch").click();
await page
.locator("div")
.filter({ hasText: "Sunday9:00am - 5:00pm" })

View File

@ -55,7 +55,7 @@ const ScheduleDay = <TFieldValues extends FieldValues>({
const watchDayRange = watch(name);
return (
<div className="mb-4 flex w-full flex-col last:mb-0 sm:flex-row sm:px-0">
<div className="mb-4 flex w-full flex-col last:mb-0 sm:flex-row sm:px-0" data-testid={weekday}>
{/* Label & switch container */}
<div className="flex h-[36px] items-center justify-between sm:w-32">
<div>