File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
rb/spec/integration/selenium/webdriver Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,15 @@ module WebDriver
3838 expect { div . shadow_root } . to raise_error ( Error ::NoSuchShadowRootError )
3939 end
4040
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+
4150 it 'gets shadow root from script' ,
4251 exclude : { browser : :safari , reason : 'returns correct node, but references shadow root as a element' } do
4352 shadow_root = custom_element . shadow_root
You can’t perform that action at this time.
0 commit comments