'Should run free function which logs in the terminal #group10':function(browser: NightwatchBrowser){
'Should run free function which logs in the terminal #group10':function(browser: NightwatchBrowser){
constscript=`
constscript=`import "hardhat/console.sol";
functionrun()public{
console.log("test running free function");
functionrunSomething()view{
}`
console.log("test running free run run");
}
`
browser
browser
.addFile('test.script.sol',{content: script})
.addFile('test.sol',{content: script})
.click('*[data-id="play-editor"]')// run the script
.scrollToLine(3)
constpath="//*[@class='view-line' and contains(.,'runSomething') and contains(.,'view')]//span//span[contains(.,'(')]"
constpathRunFunction=`//li//*[@aria-label='Run the free function "runSomething" in the Remix VM']`
browser.waitForElementVisible('#editorView')
.useXpath()
.click(path)
.pause(3000)// the parser need to parse the code
.rightClick(path)
.execute(function(){
// @ts-ignore
document.querySelector('.shadow-root-host').shadowRoot.querySelector(`.monaco-menu span[aria-label='Run the free function "runSomething" in the Remix VM']`).parentElement.click()