fix enable clipboard

LianaHus-patch-7
bunsenstraat 10 months ago
parent 71f7a2a643
commit 2bb69c36c5
  1. 3
      apps/remix-ide-e2e/src/commands/enableClipBoard.ts
  2. 21
      apps/remix-ide-e2e/src/tests/file_explorer_dragdrop.test.ts

@ -4,7 +4,8 @@ import EventEmitter from 'events'
class EnableClipBoard extends EventEmitter { class EnableClipBoard extends EventEmitter {
command (this: NightwatchBrowser, remember:boolean, accept: boolean): NightwatchBrowser { command (this: NightwatchBrowser, remember:boolean, accept: boolean): NightwatchBrowser {
const browser = this.api const browser = this.api
if(browser.isChrome()){
if(browser.browserName.indexOf('chrome') > -1){
const chromeBrowser = (browser as any).chrome const chromeBrowser = (browser as any).chrome
chromeBrowser.setPermission('clipboard-read', 'granted') chromeBrowser.setPermission('clipboard-read', 'granted')
chromeBrowser.setPermission('clipboard-write', 'granted') chromeBrowser.setPermission('clipboard-write', 'granted')

@ -0,0 +1,21 @@
'use strict'
import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init'
module.exports = {
'@disabled': true,
before: function (browser: NightwatchBrowser, done: VoidFunction) {
init(browser, done)
},
'drag and drop file from root to contracts #group1': async function (browser: NightwatchBrowser) {
browser.findElement('li[data-id="treeViewLitreeViewItemcontracts"]', (el) => {
console.log((el as any).value.getId())
const id = (el as any).value.getId()
browser
.clickLaunchIcon('filePanel')
.waitForElementVisible('li[data-id="treeViewLitreeViewItemREADME.txt"]')
.dragAndDrop('li[data-id="treeViewLitreeViewItemREADME.txt"]', id)
.waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts/README.txt"]')
})
}
}
Loading…
Cancel
Save