* Create an Select Element * @param {WebElement} element Select WebElement.
(element)
| 146 | * @param {WebElement} element Select WebElement. |
| 147 | */ |
| 148 | constructor(element) { |
| 149 | if (element === null) { |
| 150 | throw new Error(`Element must not be null. Please provide a valid <select> element.`) |
| 151 | } |
| 152 | |
| 153 | this.element = element |
| 154 | |
| 155 | this.element.getAttribute('tagName').then(function (tagName) { |
| 156 | if (tagName.toLowerCase() !== 'select') { |
| 157 | throw new Error(`Select only works on <select> elements`) |
| 158 | } |
| 159 | }) |
| 160 | |
| 161 | this.element.getAttribute('multiple').then((multiple) => { |
| 162 | this.multiple = multiple !== null && multiple !== 'false' |
| 163 | }) |
| 164 | } |
| 165 | |
| 166 | /** |
| 167 | * |
nothing calls this directly
no test coverage detected