@@ -141,15 +141,22 @@ const tests = {
141
141
. clickLaunchIcon ( 'filePanel' )
142
142
} ,
143
143
'Should show fork states provider in environment dropdown & make txs using forked state #group1' : function ( browser : NightwatchBrowser ) {
144
+ const remixVMSpanXPath = "//span[contains(@class,'dropdown-item') and normalize-space()='Remix VM']"
144
145
browser
145
146
. clickLaunchIcon ( 'udapp' )
146
147
. waitForElementVisible ( '[data-id="settingsSelectEnvOptions"]' )
147
148
. click ( '[data-id="settingsSelectEnvOptions"] button' )
148
- . useXpath ( )
149
- . moveToElement ( "//span[contains(@class,'dropdown-item') and normalize-space()='Remix VM']" , 5 , 5 )
150
- . useCss ( )
149
+ . execute ( function ( xpath ) {
150
+ const element = document . evaluate ( xpath , document , null , XPathResult . FIRST_ORDERED_NODE_TYPE , null ) . singleNodeValue
151
+ if ( element ) {
152
+ const event = new MouseEvent ( 'mouseover' , { 'view' : window , 'bubbles' : true , 'cancelable' : true } )
153
+ element . dispatchEvent ( event )
154
+ }
155
+ } ,
156
+ [ remixVMSpanXPath ]
157
+ )
151
158
. waitForElementVisible ( `[data-id="dropdown-item-vm-fs-forkedState_1"]` )
152
- . click ( '[data-id="settingsSelectEnvOptions"] button' )
159
+ . click ( '[data-id="settingsSelectEnvOptions"] button' )
153
160
. switchEnvironment ( 'vm-prague' )
154
161
. openFile ( 'contracts/1_Storage.sol' )
155
162
. clickLaunchIcon ( 'solidity' )
@@ -170,12 +177,18 @@ const tests = {
170
177
. assert . elementPresent ( '*[data-id="selected-provider-vm-fs-forkedState_2"]' )
171
178
172
179
. click ( '[data-id="settingsSelectEnvOptions"] button' )
173
- . useXpath ( )
174
- . moveToElement ( "//span[contains(@class,'dropdown-item') and normalize-space()='Remix VM']" , 5 , 5 )
175
- . useCss ( )
180
+ . execute ( function ( xpath ) {
181
+ const element = document . evaluate ( xpath , document , null , XPathResult . FIRST_ORDERED_NODE_TYPE , null ) . singleNodeValue
182
+ if ( element ) {
183
+ const event = new MouseEvent ( 'mouseover' , { 'view' : window , 'bubbles' : true , 'cancelable' : true } )
184
+ element . dispatchEvent ( event )
185
+ }
186
+ } ,
187
+ [ remixVMSpanXPath ]
188
+ )
189
+
176
190
. waitForElementVisible ( `[data-id="dropdown-item-vm-fs-forkedState_2"]` )
177
191
. click ( '[data-id="settingsSelectEnvOptions"] button' )
178
-
179
192
. click ( '*[data-id="Deploy - transact (not payable)"]' )
180
193
. clickInstance ( 0 )
181
194
. clickFunction ( 'store - transact (not payable)' , { types : 'uint256 num' , values : '"555"' } )
0 commit comments