|
| 1 | +package com.epam.jdi.light.angular.elements.complex; |
| 2 | + |
| 3 | +import com.epam.jdi.light.angular.asserts.SelectAssert; |
| 4 | +import com.epam.jdi.light.common.JDIAction; |
| 5 | +import com.epam.jdi.light.elements.base.UIBaseElement; |
| 6 | +import com.epam.jdi.light.elements.interfaces.base.HasPlaceholder; |
| 7 | +import com.epam.jdi.light.elements.interfaces.base.IClickable; |
| 8 | + |
| 9 | +public class Select extends UIBaseElement<SelectAssert> implements HasPlaceholder, IClickable { |
| 10 | + |
| 11 | + @JDIAction |
| 12 | + public boolean expanded() { |
| 13 | + return core().getAttribute("aria-expanded").equalsIgnoreCase("true"); |
| 14 | + } |
| 15 | + |
| 16 | + @JDIAction |
| 17 | + public boolean collapsed() { |
| 18 | + return !expanded(); |
| 19 | + } |
| 20 | + |
| 21 | + @JDIAction |
| 22 | + public void expand() { |
| 23 | + click(); |
| 24 | + } |
| 25 | + |
| 26 | + @JDIAction |
| 27 | + public String name() { |
| 28 | + return core().getAttribute("name"); |
| 29 | + } |
| 30 | + |
| 31 | + @JDIAction |
| 32 | + public String role() { |
| 33 | + return core().getAttribute("name"); |
| 34 | + } |
| 35 | + |
| 36 | + @JDIAction |
| 37 | + public boolean required() { |
| 38 | + return attrs().has("required"); |
| 39 | + } |
| 40 | + |
| 41 | + @JDIAction |
| 42 | + public boolean disableRipple() { |
| 43 | + return attrs().has("disableripple"); |
| 44 | + } |
| 45 | + |
| 46 | + @JDIAction |
| 47 | + public boolean disabled() { |
| 48 | + return attrs().has("disabled"); |
| 49 | + } |
| 50 | + |
| 51 | + @JDIAction |
| 52 | + public boolean multiple() { |
| 53 | + return attrs().has("multiple"); |
| 54 | + } |
| 55 | + |
| 56 | + @JDIAction |
| 57 | + public boolean hideSingleSelectionIndicator() { |
| 58 | + return attrs().has("hidesingleselectionindicator"); |
| 59 | + } |
| 60 | + |
| 61 | + @JDIAction() |
| 62 | + public boolean labelDisabled() { |
| 63 | + return core().getAttribute("aria-disabled").equalsIgnoreCase("true"); |
| 64 | + } |
| 65 | + |
| 66 | + @JDIAction |
| 67 | + public boolean labelRequired() { |
| 68 | + return core().getAttribute("aria-required").equalsIgnoreCase("true"); |
| 69 | + } |
| 70 | + |
| 71 | + @JDIAction |
| 72 | + public String label() { |
| 73 | + return core().getAttribute("aria-label"); |
| 74 | + } |
| 75 | + |
| 76 | + @Override |
| 77 | + public void click() { |
| 78 | + core().click(); |
| 79 | + } |
| 80 | + |
| 81 | + @Override |
| 82 | + public SelectAssert is() { |
| 83 | + return new SelectAssert().set(this); |
| 84 | + } |
| 85 | +} |
0 commit comments