finished clipboard test

pull/5370/head
Joseph Izang 11 months ago
parent c1f3af2960
commit 1836688698
  1. 54
      apps/remix-ide-e2e/src/tests/vyper_api.test.ts

@ -61,31 +61,35 @@ module.exports = {
}, },
'Should copy abi after blind_auction compile #group1': function (browser: NightwatchBrowser) { 'Should copy abi after blind_auction compile #group1': function (browser: NightwatchBrowser) {
// const chromeBrowser = (browser as any).chrome if (browser.browserName.indexOf('chrome') > -1) {
// // const firefoxBrowser = (browser as any).firefox const chromeBrowser = (browser as any).chrome
// // console.log('chromeBrowser', chromeBrowser) chromeBrowser.setPermission('clipboard-read', 'granted')
// // console.log('firefoxBrowser', firefoxBrowser) chromeBrowser.setPermission('clipboard-write', 'granted')
// chromeBrowser.setPermission('clipboard-read', 'granted') browser
// chromeBrowser.setPermission('clipboard-write', 'granted') .frame(0)
browser//.clickLaunchIcon('vyper') .click('[data-id="remote-compiler"]')
.frame(0) .click('[data-id="compile"]')
.click('[data-id="remote-compiler"]') .waitForElementVisible({
.click('[data-id="compile"]') selector:'[data-id="compilation-details"]',
.waitForElementVisible({ timeout: 120000
selector:'[data-id="compilation-details"]', })
timeout: 120000 .click('[data-id="compilation-details"]')
}) .frameParent()
.click('[data-id="compilation-details"]') .waitForElementVisible('[data-id="copy-abi"]')
.frameParent() .click('[data-id="copy-abi"]')
.waitForElementVisible('[data-id="copy-abi"]') .executeAsyncScript(function (done) {
.click('[data-id="copy-abi"]') navigator.clipboard.readText()
// .execute(() => { .then(function (clippedText) {
// navigator.clipboard.readText() done(clippedText)
// .then((clippedText) => { }).catch(function (error) {
// console.log(`clipped text is ${clippedText.length} characters long`) console.log('Failed to read clipboard contents: ', error)
// if(clippedText.length === 0) throw new Error('Clipboard is empty') done()
// }) })
// }) }, [], function (result) {
console.log('clipboard result: ' + result)
browser.assert.ok((result as any).value.length > 1, 'abi copied to clipboard')
})
}
}, },
'Compile test contract and deploy to remix VM #group1': function (browser: NightwatchBrowser) { 'Compile test contract and deploy to remix VM #group1': function (browser: NightwatchBrowser) {

Loading…
Cancel
Save