- Testing: Testing core classes
Testing core classes
API documentation for test utilities core classes.
On this page
Overview
This article contains the API documentation for Cloudscape test utilities core classes. These utilities don’t depend on the specific component you’re testing. For information about how to use these core classes in your tests, see introduction to testing.
Test utilities expose two core classes:
An element wrapper for unit tests, where you typically have direct access to the Document Object Model (DOM).
An element wrapper for integration tests, where it’s typical to rely on string selectors.
Unit Testing
The entry point for unit tests is the default method exposed by the '@cloudscape-design/components/test-utils/dom'
package. This method returns an instance of ElementWrapper
. The following table describes the class interface.
For more information and examples for unit testing with Cloudscape, see introduction to testing.
ElementWrapper
Name | Return type | Description | Parameters |
---|---|---|---|
blur | - | - | - |
click | - | Performs a click by triggering a mouse event. Note that programmatic events ignore disabled attribute and will trigger listeners even if the element is disabled. | params?: MouseEventInit |
find | ElementWrapper | null | - | selector: string |
findAlert | AlertWrapper | - | selector?: string |
findAll | array | - | selector: string |
findAllByClassName | array | - | className: string |
findAnnotationContext | ElementWrapper | - | selector?: string |
findAppLayout | AppLayoutWrapper | - | selector?: string |
findAreaChart | AreaChartWrapper | - | selector?: string |
findAttributeEditor | AttributeEditorWrapper | - | selector?: string |
findAutosuggest | AutosuggestWrapper | - | selector?: string |
findBadge | BadgeWrapper | - | selector?: string |
findBarChart | BarChartWrapper | - | selector?: string |
findBoard | BoardWrapper | - | selector?: string |
findBoardItem | BoardItemWrapper | - | selector?: string |
findBox | BoxWrapper | - | selector?: string |
findBreadcrumbGroup | BreadcrumbGroupWrapper | - | selector?: string |
findButton | ButtonWrapper | - | selector?: string |
findButtonDropdown | ButtonDropdownWrapper | - | selector?: string |
findByClassName | ElementWrapper | null | - | className: string |
findCalendar | CalendarWrapper | - | selector?: string |
findCards | CardsWrapper | - | selector?: string |
findCheckbox | CheckboxWrapper | - | selector?: string |
findCodeEditor | CodeEditorWrapper | - | selector?: string |
findCollectionPreferences | CollectionPreferencesWrapper | - | selector?: string |
findColumnLayout | ColumnLayoutWrapper | - | selector?: string |
findComponent | Wrapper | null | - |
|
findContainer | ContainerWrapper | - | selector?: string |
findContentLayout | ContentLayoutWrapper | - | selector?: string |
findDateInput | DateInputWrapper | - | selector?: string |
findDatePicker | DatePickerWrapper | - | selector?: string |
findDateRangePicker | DateRangePickerWrapper | - | selector?: string |
findExpandableSection | ExpandableSectionWrapper | - | selector?: string |
findFlashbar | FlashbarWrapper | - | selector?: string |
findForm | FormWrapper | - | selector?: string |
findFormField | FormFieldWrapper | - | selector?: string |
findGrid | GridWrapper | - | selector?: string |
findHeader | HeaderWrapper | - | selector?: string |
findHelpPanel | HelpPanelWrapper | - | selector?: string |
findHotspot | HotspotWrapper | - | selector?: string |
findIcon | IconWrapper | - | selector?: string |
findInput | InputWrapper | - | selector?: string |
findItemsPalette | ItemsPaletteWrapper | - | selector?: string |
findLineChart | LineChartWrapper | - | selector?: string |
findLink | LinkWrapper | - | selector?: string |
findMixedLineBarChart | MixedLineBarChartWrapper | - | selector?: string |
findModal | ModalWrapper | - | selector?: string |
findMultiselect | MultiselectWrapper | - | selector?: string |
findPagination | PaginationWrapper | - | selector?: string |
findPieChart | PieChartWrapper | - | selector?: string |
findPopover | PopoverWrapper | - | selector?: string |
findProgressBar | ProgressBarWrapper | - | selector?: string |
findPropertyFilter | PropertyFilterWrapper | - | selector?: string |
findRadioGroup | RadioGroupWrapper | - | selector?: string |
findS3ResourceSelector | S3ResourceSelectorWrapper | - | selector?: string |
findSegmentedControl | SegmentedControlWrapper | - | selector?: string |
findSelect | SelectWrapper | - | selector?: string |
findSideNavigation | SideNavigationWrapper | - | selector?: string |
findSpaceBetween | SpaceBetweenWrapper | - | selector?: string |
findSpinner | SpinnerWrapper | - | selector?: string |
findSplitPanel | SplitPanelWrapper | - | selector?: string |
findStatusIndicator | StatusIndicatorWrapper | - | selector?: string |
findTable | TableWrapper | - | selector?: string |
findTabs | TabsWrapper | - | selector?: string |
findTagEditor | TagEditorWrapper | - | selector?: string |
findTextContent | TextContentWrapper | - | selector?: string |
findTextFilter | TextFilterWrapper | - | selector?: string |
findTextarea | TextareaWrapper | - | selector?: string |
findTiles | TilesWrapper | - | selector?: string |
findTimeInput | TimeInputWrapper | - | selector?: string |
findToggle | ToggleWrapper | - | selector?: string |
findTokenGroup | TokenGroupWrapper | - | selector?: string |
findTopNavigation | TopNavigationWrapper | - | selector?: string |
findTutorialPanel | TutorialPanelWrapper | - | selector?: string |
findWizard | WizardWrapper | - | selector?: string |
fireEvent | - | - | event: Event |
focus | - | - | - |
getElement | ElementType | - | - |
keydown | - | - | keyCode: KeyCode |
keypress | - | - | keyCode: KeyCode |
keyup | - | - | keyCode: KeyCode |
matches | this | null | - | selector: string |