@wix/design-system
Version:
@wix/design-system
91 lines (66 loc) • 2.36 kB
Markdown
## Modal Testkit
### Import
- unidriver: `import { ModalUniDriver } from '@wix/design-system/dist/testkit/unidriver';`
- vanilla: `import { ModalTestkit } from '@wix/design-system/dist/testkit';`
- puppeteer: `import { ModalTestkit } from '@wix/design-system/dist/testkit/puppeteer';`
- playwright: `import { ModalTestkit } 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
### exists
- signature: exists()
- description: true if the modal is on the DOM
### isOpen
- signature: isOpen()
- description: true when the module is open
### getChildBySelector
- signature: getChildBySelector(selector)
### isScrollable
- signature: isScrollable()
- description: true if the modal is scrollable
### closeButtonExists
- signature: closeButtonExists()
### clickOnOverlay
- signature: clickOnOverlay()
- description: click on the modal overlay (helpful for testing if the modal is dismissed)
### clickOnCloseButton
- signature: clickOnCloseButton()
### clickOnNavigationPrevious
- signature: clickOnNavigationPrevious()
- description: click on navigation control previous button
### clickOnNavigationNext
- signature: clickOnNavigationNext()
- description: click on navigation control next button
### navigationPreviousExists
- signature: navigationPreviousExists()
### navigationNextExists
- signature: navigationNextExists()
### getNavigationPreviousLabel
- signature: getNavigationPreviousLabel()
### getNavigationNextLabel
- signature: getNavigationNextLabel()
### getContent
- signature: getContent()
- description: returns the element of the modal content (helpful to initialize a layout testkit)
### getContentStyle
- signature: getContentStyle()
- description: returns the style of the modal content
### getContentLabel
- signature: getContentLabel()
- description: returns the modal aria-label value as given in contentLabel property
### getZIndex
- signature: getZIndex()