File tree 1 file changed +9
-0
lines changed
rb/spec/integration/selenium/webdriver 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,15 @@ module WebDriver
38
38
expect { div . shadow_root } . to raise_error ( Error ::NoSuchShadowRootError )
39
39
end
40
40
41
+ it 'raises error if the shadow root is detached' , exclude : { browser : :safari , reason : 'NoMethodError' } do
42
+ driver . navigate . to url_for ( 'simpleTest.html' )
43
+ div = driver . find_element ( css : 'div' )
44
+ driver . execute_script ( 'arguments[0].attachShadow({ mode: "open" });' , div )
45
+ root = div . shadow_root
46
+ driver . execute_script ( 'arguments[0].remove();' , div )
47
+ expect { root . find_element ( css : '#x' ) } . to raise_error ( Error ::DetachedShadowRootError )
48
+ end
49
+
41
50
it 'gets shadow root from script' ,
42
51
exclude : { browser : :safari , reason : 'returns correct node, but references shadow root as a element' } do
43
52
shadow_root = custom_element . shadow_root
You can’t perform that action at this time.
0 commit comments