File tree Expand file tree Collapse file tree 3 files changed +35
-2
lines changed
jdi-light-core/src/main/java/com/epam/jdi/light/elements/base
main/java/io/github/com/pages
test/java/io/github/epam/html/tests/elements/common Expand file tree Collapse file tree 3 files changed +35
-2
lines changed Original file line number Diff line number Diff line change @@ -69,11 +69,12 @@ public static Condition matchValue(String value) {
6969 }
7070
7171 public static Condition pseudo (String pseudoName , String propertyName , String expectedValue ) {
72- return el -> el .pseudo (pseudoName , propertyName ).equals (expectedValue );
72+ return condition ("%element% has no pseudo " + pseudoName + " property " + propertyName + " with value " + expectedValue ,
73+ el -> el .pseudo (pseudoName , propertyName ).equals (expectedValue ));
7374 }
7475
7576 public static Condition pseudo (String pseudoElementName , String expectedValue ) {
76- return el -> el . pseudo (pseudoElementName , "content" ). equals ( expectedValue );
77+ return pseudo (pseudoElementName , "content" , expectedValue );
7778 }
7879
7980 public static Condition exactValue (String value ) {
Original file line number Diff line number Diff line change @@ -155,4 +155,7 @@ public class HtmlElementsPage extends WebPage {
155155 @ UI ("#shadowContainer" )
156156 @ ShadowHost
157157 public static ShadowElement shadowContainer ;
158+
159+ @ UI ("#checkboxWithPseudo" )
160+ public static Checkbox checkboxWithPseudo ;
158161}
Original file line number Diff line number Diff line change 1+ package io .github .epam .html .tests .elements .common ;
2+
3+ import io .github .epam .TestsInit ;
4+ import org .testng .annotations .BeforeMethod ;
5+ import org .testng .annotations .Test ;
6+
7+ import static com .epam .jdi .light .elements .base .Conditions .and ;
8+ import static com .epam .jdi .light .elements .base .Conditions .pseudo ;
9+ import static io .github .com .StaticSite .html5Page ;
10+ import static io .github .com .pages .HtmlElementsPage .checkboxWithPseudo ;
11+ import static io .github .epam .html .tests .site .steps .States .shouldBeLoggedIn ;
12+
13+ public class PseudoTests implements TestsInit {
14+ @ BeforeMethod
15+ public void before () {
16+ shouldBeLoggedIn ();
17+ html5Page .open ();
18+ }
19+
20+ @ Test (description = "Check content in pseudo before and after" )
21+ public void pseudoTest () {
22+ checkboxWithPseudo .show ();
23+
24+ checkboxWithPseudo .shouldBe (
25+ pseudo ("::before" , "\" Before pseudo-element content\" " ),
26+ and (pseudo ("::after" , "\" After pseudo-element content\" " ))
27+ );
28+ }
29+ }
You can’t perform that action at this time.
0 commit comments