wix-style-react
Version:
wix-style-react
44 lines (31 loc) • 1.45 kB
Markdown
> Dropdown with dropdownLayout
| method | arguments | returned value | description |
|--------|-----------|----------------|-------------|
| click | - | - | click on the component |
| getInput | - | element | get the input element |
| getDropdown | - | element | get the dropdown element |
| getDropdownItem | number | string | get the text in item index <arg> |
| getDropdownItemsCount | - | number | get number of options |
| element | - | element | get the actual element |
> E2E example
```javascript
//Element should be rendered with a data-hook into the DOM
<Dropdown {...props} dataHook='myDataHook'/>
/**********************
Protractor example
**********************/
import {dropdownTestkitFactory, waitForVisibilityOf} from 'wix-style-react/dist/testkit/protractor';
//Create an element testkit via the data-hook attribute
const testkit = dropdownTestkitFactory({dataHook: 'myDataHook'});
browser.get(appUrl); //Your application url
waitForVisibilityOf(testkit.element(), 'Cannot find Dropdown')
.then(() => {
//Do tests
expect(testkit.element().isDisplayed()).toBeTruthy();
});
```