@wix/design-system
Version:
@wix/design-system
148 lines (102 loc) • 3.22 kB
Markdown
## Calendar Testkit
### Import
- unidriver: `import { CalendarUniDriver } from '@wix/design-system/dist/testkit/unidriver';`
- vanilla: `import { CalendarTestkit } from '@wix/design-system/dist/testkit';`
- puppeteer: `import { CalendarTestkit } from '@wix/design-system/dist/testkit/puppeteer';`
- playwright: `import { CalendarTestkit } from '@wix/design-system/dist/testkit/playwright';`
### API
### exists
- signature: exists()
- returns: Promise<boolean>
- description: Checks whether the component found with the given data hook
### element
- signature: element()
- returns: Promise<any>
- description: Gets the component root element
### click
- signature: click()
- returns: Promise<void>
- description: Clicks on the component root element
### base
- signature: base()
- returns: UniDriver
- description: Returns UniDriver for the base element
### close
- signature: close()
### getCurrentMonthWithYear
- signature: getCurrentMonthWithYear()
### getNthWeekDayName
- signature: getNthWeekDayName(n)
### clickOnNthDay
- signature: clickOnNthDay(n)
### clickDay
- signature: clickDay(date)
### isDayActive
- signature: isDayActive(date)
### clickOnNthDayOfTheMonth
- signature: clickOnNthDayOfTheMonth(n)
### clickOnSelectedDay
- signature: clickOnSelectedDay()
### clickOnYearDropdown
- signature: clickOnYearDropdown()
### clickOnMonthDropdown
- signature: clickOnMonthDropdown()
### clickOnNthYear
- signature: clickOnNthYear(n)
### clickOnPrevMonthButton
- signature: clickOnPrevMonthButton()
### clickOnNextMonthButton
- signature: clickOnNextMonthButton()
### keyboardNextYear
- signature: keyboardNextYear()
### keyboardPrevYear
- signature: keyboardPrevYear()
### isHeaderExists
- signature: isHeaderExists()
### isYearDropdownExists
- signature: isYearDropdownExists()
### isYearCaptionExists
- signature: isYearCaptionExists()
### isMonthDropdownExists
- signature: isMonthDropdownExists()
### isMonthCaptionExists
- signature: isMonthCaptionExists()
### getMonthCaption
- signature: getMonthCaption()
### getMonthDropdownLabel
- signature: getMonthDropdownLabel()
### getSelectedYear
- signature: getSelectedYear()
### getFocusedDay
- signature: getFocusedDay()
- description: Returns the text of the focused day or `null` if there is no focused day
### getFocusedDayElement
- signature: getFocusedDayElement()
### pressLeftArrow
- signature: pressLeftArrow()
### pressRightArrow
- signature: pressRightArrow()
### getSelectedDay
- signature: getSelectedDay()
### triggerKeyDown
- signature: triggerKeyDown({key})
### isFocusedDayVisuallyUnfocused
- signature: isFocusedDayVisuallyUnfocused()
### containsVisuallyUnfocusedDay
- signature: containsVisuallyUnfocusedDay()
### isTwoMonthsLayout
- signature: isTwoMonthsLayout()
### getMonthDropdownDriver
- signature: getMonthDropdownDriver()
### getYearDropdownDriver
- signature: getYearDropdownDriver()
### getNumOfVisibleMonths
- signature: getNumOfVisibleMonths()
### getNumOfSelectedDays
- signature: getNumOfSelectedDays()
### getSelectedDays
- signature: getSelectedDays()
### getSize
- signature: getSize()
- returns: Promise<string>
- description: Returns size property value currently set on component