hideToolTips

flattentree
filip mertens 11 months ago
parent 196460b04e
commit 67a55adc58
  1. 31
      apps/remix-ide-e2e/src/commands/hideToolTips.ts
  2. 7
      apps/remix-ide-e2e/src/tests/migrateFileSystem.test.ts
  3. 1
      apps/remix-ide-e2e/src/types/index.d.ts

@ -0,0 +1,31 @@
import {NightwatchBrowser} from 'nightwatch'
import EventEmitter from 'events'
class HideToolTips extends EventEmitter {
command(this: NightwatchBrowser) {
browser
.perform((done) => {
//if (hideToolTips) {
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;
}
`)
}, [], done())
})
.perform((done) => {
done()
this.emit('complete')
})
}
}
module.exports = HideToolTips

@ -6,6 +6,7 @@ module.exports = {
'@disabled': true,
'Should load the testmigration url #group1': function (browser: NightwatchBrowser) {
browser.url('http://127.0.0.1:8080?e2e_testmigration=true')
.hideToolTips()
.pause(6000)
.switchBrowserTab(0)
.maximizeWindow()
@ -16,6 +17,7 @@ module.exports = {
},
'Should load the testmigration url and refresh and still have test data #group7': function (browser: NightwatchBrowser) {
browser.url('http://127.0.0.1:8080?e2e_testmigration=true')
.hideToolTips()
.pause(6000)
.switchBrowserTab(0)
.maximizeWindow()
@ -30,6 +32,7 @@ module.exports = {
},
'Should fallback to localstorage with default data #group2': function (browser: NightwatchBrowser) {
browser.url('http://127.0.0.1:8080?e2e_testmigration_fallback=true')
.hideToolTips()
.pause(6000)
.switchBrowserTab(0)
.maximizeWindow()
@ -50,6 +53,7 @@ module.exports = {
},
'Should load the testmigration url with local storage anabled #group3': function (browser: NightwatchBrowser) {
browser.url('http://127.0.0.1:8080?e2e_testmigration=true&e2e_testmigration_fallback=true')
.hideToolTips()
.pause(6000)
.switchBrowserTab(0)
.maximizeWindow()
@ -60,6 +64,7 @@ module.exports = {
},
'Should generate error in migration by deleting indexedDB and falling back to local storage with test #group5': function (browser: NightwatchBrowser) {
browser.url('http://127.0.0.1:8080?e2e_testmigration=true')
.hideToolTips()
.pause(6000)
.switchBrowserTab(0)
.maximizeWindow().execute(('delete window.indexedDB'))
@ -112,6 +117,7 @@ module.exports = {
// end of test data entries
'Should load with all storage blocked #group4': function (browser: NightwatchBrowser) {
browser.url('http://127.0.0.1:8080?e2e_testblock_storage=true')
.hideToolTips()
.pause(6000)
.switchBrowserTab(0)
.maximizeWindow()
@ -119,6 +125,7 @@ module.exports = {
},
'Should with errors #group6': function (browser: NightwatchBrowser) {
browser.url('http://127.0.0.1:8080?e2e_testmigration=true')
.hideToolTips()
.pause(6000)
.switchBrowserTab(0)
.maximizeWindow().execute('delete window.localStorage')

@ -70,6 +70,7 @@ declare module 'nightwatch' {
switchEnvironment: (provider: string) => NightwatchBrowser
connectToExternalHttpProvider: (url: string, identifier: string) => NightwatchBrowser
waitForElementNotContainsText: (id: string, value: string, timeout: number = 10000) => NightwatchBrowser
hideToolTips: (this: NightwatchBrowser) => NightwatchBrowser
}
export interface NightwatchBrowser {

Loading…
Cancel
Save