-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
225 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
jdi-light-angular-tests/src/main/java/io/github/com/pages/sections/SideNavSection.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
...ular/src/main/java/com/epam/jdi/light/angular/asserts/radiobuttons/RadioButtonAssert.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package com.epam.jdi.light.angular.asserts.radiobuttons; | ||
|
||
import static com.epam.jdi.light.asserts.core.SoftAssert.jdiAssert; | ||
|
||
import com.epam.jdi.light.angular.elements.complex.radiobuttons.RadioButton; | ||
import com.epam.jdi.light.angular.elements.enums.AngularColors; | ||
import com.epam.jdi.light.asserts.generic.UIAssert; | ||
import com.epam.jdi.light.common.JDIAction; | ||
import org.hamcrest.Matchers; | ||
|
||
public class RadioButtonAssert extends UIAssert<RadioButtonAssert, RadioButton> { | ||
|
||
@Override | ||
@JDIAction("Assert that '{name}' is disabled") | ||
public RadioButtonAssert disabled() { | ||
jdiAssert(element().isDisabled(), Matchers.is(true), "Element is enabled"); | ||
return this; | ||
} | ||
|
||
@Override | ||
@JDIAction("Assert that '{name}' is disabled") | ||
public RadioButtonAssert enabled() { | ||
jdiAssert(element().isDisabled(), Matchers.is(false), "Element is disabled"); | ||
return this; | ||
} | ||
|
||
@JDIAction("Assert that '{name}' color is '{0}'") | ||
public RadioButtonAssert color(AngularColors expectedColor) { | ||
jdiAssert(element().color().getColor(), Matchers.is(expectedColor.getColor())); | ||
return this; | ||
} | ||
|
||
@JDIAction("'{name}' element label is in before position") | ||
public RadioButtonAssert radioButtonBeforePosition() { | ||
jdiAssert(element().isRadioButtonBeforePosition(), Matchers.is(true), | ||
"Radio button label is not in before position"); | ||
return this; | ||
} | ||
|
||
@JDIAction("'{name}' element label is in before position") | ||
public RadioButtonAssert radioButtonAfterPosition() { | ||
jdiAssert(element().isRadioButtonBeforePosition(), Matchers.is(false), | ||
"Radio button label is not in after position"); | ||
return this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 0 additions & 79 deletions
79
jdi-light-angular/src/main/java/com/epam/jdi/light/angular/elements/complex/RadioGroup.java
This file was deleted.
Oops, something went wrong.
47 changes: 47 additions & 0 deletions
47
...r/src/main/java/com/epam/jdi/light/angular/elements/complex/radiobuttons/RadioButton.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package com.epam.jdi.light.angular.elements.complex.radiobuttons; | ||
|
||
import com.epam.jdi.light.angular.asserts.radiobuttons.RadioButtonAssert; | ||
import com.epam.jdi.light.angular.elements.enums.AngularColors; | ||
import com.epam.jdi.light.common.JDIAction; | ||
import com.epam.jdi.light.elements.base.UIBaseElement; | ||
import com.epam.jdi.light.elements.interfaces.base.HasLabel; | ||
import org.openqa.selenium.By; | ||
|
||
public class RadioButton extends UIBaseElement<RadioButtonAssert> implements HasLabel { | ||
private static final String INPUT_SELECTION_CONTROL = "//input[@type='radio']"; | ||
|
||
@Override | ||
public RadioButtonAssert is() { | ||
return new RadioButtonAssert().set(this); | ||
} | ||
|
||
@Override | ||
public RadioButtonAssert has() { return is(); } | ||
|
||
@Override | ||
@JDIAction("Get if '{name}' is disabled") | ||
public boolean isDisabled() { | ||
return find(INPUT_SELECTION_CONTROL).hasAttribute("disabled"); | ||
} | ||
|
||
@JDIAction("Get '{name}' input control color") | ||
public AngularColors color() { | ||
if (hasClass("mat-primary")) { | ||
return AngularColors.PRIMARY; | ||
} | ||
if (hasClass("mat-warn")) { | ||
return AngularColors.WARN; | ||
} else | ||
return AngularColors.ACCENT; | ||
} | ||
|
||
@JDIAction("'{name}' element label is in before position") | ||
public boolean isRadioButtonBeforePosition() { | ||
return attr("labelposition").equalsIgnoreCase("before"); | ||
} | ||
|
||
@JDIAction("Click '{name}' radio button") | ||
public void click() { | ||
find(By.cssSelector(".mdc-form-field")).click(); | ||
} | ||
} |
Oops, something went wrong.