File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
src/org/openqa/selenium/remote
test/org/openqa/selenium/remote Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 24
24
25
25
import java .util .List ;
26
26
import java .util .Map ;
27
+ import java .util .Objects ;
27
28
import org .openqa .selenium .By ;
28
29
import org .openqa .selenium .SearchContext ;
29
30
import org .openqa .selenium .WebDriver ;
@@ -69,4 +70,21 @@ public String getId() {
69
70
private Map <String , Object > toJson () {
70
71
return singletonMap (W3C .getShadowRootElementKey (), id );
71
72
}
73
+
74
+ @ Override
75
+ public boolean equals (Object o ) {
76
+ if (this == o ) {
77
+ return true ;
78
+ }
79
+ if (o == null || getClass () != o .getClass ()) {
80
+ return false ;
81
+ }
82
+ ShadowRoot that = (ShadowRoot ) o ;
83
+ return Objects .equals (parent , that .parent ) && Objects .equals (id , that .id );
84
+ }
85
+
86
+ @ Override
87
+ public int hashCode () {
88
+ return Objects .hash (parent , id );
89
+ }
72
90
}
Original file line number Diff line number Diff line change @@ -225,6 +225,6 @@ void shouldBeAbleToGetShadowRootFromExecuteScript() {
225
225
ShadowRoot shadowContext = (ShadowRoot ) element .getShadowRoot ();
226
226
ShadowRoot executeContext =
227
227
(ShadowRoot ) ((JavascriptExecutor ) driver ).executeScript ("return Arguments[0].shadowRoot" );
228
- assertThat (shadowContext . getId ()) .isEqualTo (executeContext . getId () );
228
+ assertThat (shadowContext ) .isEqualTo (executeContext );
229
229
}
230
230
}
You can’t perform that action at this time.
0 commit comments