@wix/design-system
Version:
@wix/design-system
67 lines (50 loc) • 1.84 kB
Markdown
## StatisticsWidget Testkit
### Import
- unidriver: `import { StatisticsWidgetUniDriver } from '@wix/design-system/dist/testkit/unidriver';`
- vanilla: `import { StatisticsWidgetTestkit } from '@wix/design-system/dist/testkit';`
- puppeteer: `import { StatisticsWidgetTestkit } from '@wix/design-system/dist/testkit/puppeteer';`
- playwright: `import { StatisticsWidgetTestkit } 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
### getItemsCount
- signature: getItemsCount()
- description: Get number of items
### clickStatistics
- signature: clickStatistics(index)
- description: Click on the statistic with index
### getValue
- signature: getValue(index)
- description: Get value of the statistic with index
### isLoading
- signature: isLoading(index)
- description: Returns true if statistic item is in loading state
### getValueInShort
- signature: getValueInShort(index)
- description: Get short value of the stat with index
### getDescription
- signature: getDescription(index)
- description: Get description of the statistic with index
### getDescriptionInfo
- signature: getDescriptionInfo(index)
- description: Get the text of the info tooltip
### getChildren
- signature: getChildren(index, hook)
- description: Get children in section by hook
### getPercentage
- signature: getPercentage(index)
- description: Get percentage of the statistic with index