@@ -81,35 +81,16 @@ describe('Obscura helper (self-managed obscura serve)', function () {
8181 } )
8282
8383 it ( 'sees an inline link that wraps only block children' , async function ( ) {
84- await I . amOnPage ( '/' )
84+ await I . amOnPage ( '/form/inline_wrapper ' )
8585 if ( I . capabilities . layout !== 'real' ) this . skip ( )
86- await I . executeScript ( ( ) => {
87- const wrapper = document . createElement ( 'div' )
88- wrapper . innerHTML = '<a id="card-link" href="#"><div style="height:20px">card</div></a><a id="empty-link" href="#"></a><span id="hidden-card" style="display:contents"><div style="display:none">x</div></span>'
89- document . body . appendChild ( wrapper )
90- } )
9186 await I . seeElement ( '#card-link' )
9287 await I . waitForVisible ( '#card-link' , 1 )
9388 await I . dontSeeElement ( '#empty-link' )
9489 await I . dontSeeElement ( '#hidden-card' )
9590 } )
9691
9792 it ( 'clicks with the pointer and mouse events a real click fires' , async ( ) => {
98- await I . amOnPage ( '/' )
99- await I . executeScript ( ( ) => {
100- const wrapper = document . createElement ( 'div' )
101- wrapper . innerHTML = '<div id="mousedown-trigger" tabindex="0" style="height:20px">open</div><div id="mousedown-menu" style="display:none">menu</div><button id="disabled-btn" disabled>off</button>'
102- document . body . appendChild ( wrapper )
103- window . __clickEvents = [ ]
104- const trigger = document . getElementById ( 'mousedown-trigger' )
105- for ( const type of [ 'pointerdown' , 'mousedown' , 'focus' , 'pointerup' , 'mouseup' , 'click' ] ) {
106- trigger . addEventListener ( type , ( ) => window . __clickEvents . push ( type ) )
107- }
108- trigger . addEventListener ( 'mousedown' , ( ) => {
109- document . getElementById ( 'mousedown-menu' ) . style . display = 'block'
110- } )
111- document . getElementById ( 'disabled-btn' ) . addEventListener ( 'mousedown' , ( ) => window . __clickEvents . push ( 'disabled-mousedown' ) )
112- } )
93+ await I . amOnPage ( '/form/mousedown_trigger' )
11394 await I . click ( '#mousedown-trigger' )
11495 await I . forceClick ( '#disabled-btn' )
11596 const events = await I . executeScript ( ( ) => window . __clickEvents )
@@ -118,17 +99,8 @@ describe('Obscura helper (self-managed obscura serve)', function () {
11899 } )
119100
120101 it ( 'clicks the control a wrapper element covers, like a real click lands' , async function ( ) {
121- await I . amOnPage ( '/' )
102+ await I . amOnPage ( '/form/wrapped_button ' )
122103 if ( I . capabilities . layout !== 'real' ) this . skip ( )
123- await I . executeScript ( ( ) => {
124- const wrapper = document . createElement ( 'div' )
125- wrapper . innerHTML =
126- '<ul><li id="menu-item"><button type="button" id="menu-button" style="display:block;width:100%;height:30px"><span>New suite</span></button></li></ul><div id="opened" style="display:none">opened</div>'
127- document . body . prepend ( wrapper )
128- document . getElementById ( 'menu-button' ) . addEventListener ( 'click' , e => {
129- if ( e . target . closest ( '#menu-button' ) ) document . getElementById ( 'opened' ) . style . display = 'block'
130- } )
131- } )
132104 await I . click ( '#menu-item' )
133105 await I . seeElement ( '#opened' )
134106 } )
0 commit comments