[WIP]4987+4988: Angular select class implementation and refactoring tests#5096
[WIP]4987+4988: Angular select class implementation and refactoring tests#5096b14ckster wants to merge 4 commits intoangular_rework_developmentfrom
Conversation
|
|
||
| public class Select extends UIBaseElement<SelectAssert> implements HasPlaceholder, IClickable { | ||
|
|
||
| @JDIAction |
There was a problem hiding this comment.
JDIAction должны быть с текстовым описанием
|
|
||
| @JDIAction | ||
| public void expand() { | ||
| click(); |
There was a problem hiding this comment.
а если элемент уже открыт, то клик по нему приведет не к открытию
|
|
||
| @JDIAction | ||
| public String role() { | ||
| return core().getAttribute("name"); |
|
|
||
| @JDIAction | ||
| public String name() { | ||
| return core().getAttribute("name"); |
There was a problem hiding this comment.
какой смысл проверять name?
| } | ||
|
|
||
| @Override | ||
| public void click() { |
There was a problem hiding this comment.
а зачем переопределение в таком виде? так и будет работать
7e0a70f to
5535a81
Compare
3ad2d56 to
e099e7c
Compare
| } | ||
|
|
||
| @JDIAction("Is '{name}' disabled") | ||
| public boolean disabled() { |
There was a problem hiding this comment.
- Condition is different
- Enabled should be overrided
| } | ||
|
|
||
| @JDIAction("Get '{name}' name") | ||
| public String name() { |
There was a problem hiding this comment.
We do not need this method
| import static org.hamcrest.Matchers.hasItem; | ||
| import static org.hamcrest.Matchers.hasItems; | ||
|
|
||
| public class SelectAssert extends UIAssert<SelectAssert, MaterialSelector> { |
There was a problem hiding this comment.
| public class SelectAssert extends UIAssert<SelectAssert, MaterialSelector> { | |
| public class MaterialSelectAssert extends UIAssert<MaterialSelectAssert, MaterialSelector> { |
| return selected(getEnumValue(option)); | ||
| } | ||
|
|
||
| public <T extends Enum<?>> SelectAssert value(final T option) { |
There was a problem hiding this comment.
It is near to impossible to guess that value means that there is an option with this value, it should be selected value
| public class MaterialSelector extends UIBaseElement<MaterialSelectorAssert> implements HasLabel { | ||
| public String toggle = "//*[@id='%s']//div[contains(@class,'mat-select-arrow')][not(contains(@class, 'wrapper'))]"; | ||
| public class MaterialSelector extends UIBaseElement<SelectAssert> implements HasLabel { | ||
| public String toggle = "//*[@id='%s']//div[contains(@class,'mat-mdc-select-arrow')][not(contains(@class, 'wrapper'))]"; |
There was a problem hiding this comment.
Locators should be much more simple, without id and other things
| public void multipleSelect(int... indexes) { | ||
| WebList options = getOptions(); | ||
| for (int index : indexes) { | ||
| options.get(index).click(); |
There was a problem hiding this comment.
If the value is already selected, click will unselect it
| public void multipleSelect(String... values) { | ||
| WebList options = getOptions(); | ||
| for (String str : values) { | ||
| options.get(str).click(); |
There was a problem hiding this comment.
If the value is already selected, click will unselect it
| @JDIAction("Select '{0}' in '{name}'") | ||
| public void select(int index) { | ||
| WebList options = getOptions(); | ||
| options.get(index).click(); |
There was a problem hiding this comment.
If the value is already selected, click will unselect it
| public void select(String value) { | ||
| if (value == null) return; | ||
| WebList options = getOptions(); | ||
| options.get(value).click(); |
There was a problem hiding this comment.
If the value is already selected, click will unselect it
| public String toggle = "//*[@id='%s']//div[contains(@class,'mat-mdc-select-arrow')][not(contains(@class, 'wrapper'))]"; | ||
| public String hintLocator = "//*[@id='%s']/ancestor::mat-form-field//mat-hint"; | ||
| public String errorLocator = "//*[@id='%s']/ancestor::mat-form-field//mat-error"; | ||
| public String smart = "smart: "; |
There was a problem hiding this comment.
dropdown id not need to get selected value
No description provided.