pull/5371/head
bunsenstraat 2 weeks ago
parent b3d5a42c10
commit 51f6a52c91
  1. 32
      apps/remix-ide-e2e/src/commands/hidePopUpPanel.ts
  2. 11
      apps/remix-ide-e2e/src/helpers/init.ts
  3. 1
      apps/remix-ide-e2e/src/types/index.d.ts

@ -0,0 +1,32 @@
import { NightwatchBrowser } from 'nightwatch'
import EventEmitter from 'events'
class HidePopUpPanel extends EventEmitter {
command(this: NightwatchBrowser) {
browser
.perform((done) => {
browser.execute(function () {
// hide tooltips
function addStyle(styleString) {
const style = document.createElement('style')
style.textContent = styleString
document.head.append(style)
}
addStyle(`
.popover {
display:none !important;
}
#scamDetails {
display:none !important;
}
`)
}, [], done())
})
.perform((done) => {
done()
this.emit('complete')
})
}
}
module.exports = HidePopUpPanel

@ -14,15 +14,8 @@ export default function (browser: NightwatchBrowser, callback: VoidFunction, url
.url(url || 'http://127.0.0.1:8080') .url(url || 'http://127.0.0.1:8080')
.pause(5000) .pause(5000)
.switchBrowserTab(0) .switchBrowserTab(0)
// get value from local storage .hidePopUpPanel()
.execute(function () { .pause()
return localStorage.getItem('did_show_popup_panel')
}, [], function (result) {
if (!result.value) {
browser.waitForElementVisible('*[data-id="aiStatusButton"]')
.click('*[data-id="aiStatusButton"]')
}
})
.perform((done) => { .perform((done) => {
if (!loadPlugin) return done() if (!loadPlugin) return done()
browser browser

@ -77,6 +77,7 @@ declare module 'nightwatch' {
enableClipBoard: () => NightwatchBrowser enableClipBoard: () => NightwatchBrowser
addFileSnekmate: (name: string, content: NightwatchContractContent) => NightwatchBrowser addFileSnekmate: (name: string, content: NightwatchContractContent) => NightwatchBrowser
selectFiles: (selelectedElements: any[]) => NightwatchBrowser selectFiles: (selelectedElements: any[]) => NightwatchBrowser
hidePopUpPanel: (this: NightwatchBrowser) => NightwatchBrowser
} }
export interface NightwatchBrowser { export interface NightwatchBrowser {

Loading…
Cancel
Save