-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathselect-wrapper.js
More file actions
23 lines (22 loc) · 815 Bytes
/
select-wrapper.js
File metadata and controls
23 lines (22 loc) · 815 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/**
* Created by Selenium on 08-12-2015.
*/
var SelectWrapper = (selector) => {
this.webElement = element(selector);
};
SelectWrapper.prototype.getOptions = () => {
return this.webElement.all(by.tagName('option'));
};
SelectWrapper.prototype.getSelectedOptions = () => {
return this.webElement.all(by.css('option[selected="selected"]'));
};
SelectWrapper.prototype.selectByValue = (value) => {
return this.webElement.all(by.css('option[value="' + value + '"]')).click();
};
SelectWrapper.prototype.selectByPartialText = (text) => {
return this.webElement.all(by.cssContainingText('option', text)).click();
};
SelectWrapper.prototype.selectByText = (text) => {
return this.webElement.all(by.xpath('option[.="' + text + '"]')).click();
};
export default SelectWrapper;