LianaHus-patch-7
bunsenstraat 11 months ago
parent 756d0122c0
commit f0050e37e5
  1. 1
      apps/remix-ide-e2e/src/tests/file_explorer_context_menu.test.ts
  2. 15
      apps/remix-ide-e2e/src/tests/file_explorer_dragdrop.test.ts

@ -91,6 +91,7 @@ module.exports = {
.waitForElementPresent('[data-id="contextMenuItemcopy') .waitForElementPresent('[data-id="contextMenuItemcopy')
.click('[data-id="contextMenuItemcopy"]') .click('[data-id="contextMenuItemcopy"]')
.rightClick('*[data-id="treeViewUltreeViewMenu"]') .rightClick('*[data-id="treeViewUltreeViewMenu"]')
.saveScreenshot('./reports/screenshot/file_explorer_context_menu.png')
.click('*[data-id="contextMenuItempaste"]') .click('*[data-id="contextMenuItempaste"]')
.waitForElementVisible('*[data-id="treeViewLitreeViewItemCopy_README.txt"]', 7000) .waitForElementVisible('*[data-id="treeViewLitreeViewItemCopy_README.txt"]', 7000)
}, },

@ -2,12 +2,18 @@
import { NightwatchBrowser } from 'nightwatch' import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init' import init from '../helpers/init'
const checkBrowserIsChrome = function (browser: NightwatchBrowser) {
return browser.browserName.indexOf('chrome') > -1
}
module.exports = { module.exports = {
'@disabled': true, '@disabled': true,
before: function (browser: NightwatchBrowser, done: VoidFunction) { before: function (browser: NightwatchBrowser, done: VoidFunction) {
init(browser, done) init(browser, done)
}, },
'drag and drop file from root to contracts #group1 #flaky': function (browser: NightwatchBrowser) { 'drag and drop file from root to contracts #group1 #flaky': function (browser: NightwatchBrowser) {
if (checkBrowserIsChrome(browser)) {
browser browser
.clickLaunchIcon('filePanel') .clickLaunchIcon('filePanel')
.waitForElementVisible('*[data-id="treeViewLitreeViewItemcontracts"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemcontracts"]')
@ -21,9 +27,11 @@ module.exports = {
.execute(function () { (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click() }) .execute(function () { (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click() })
.waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts/README.txt"]') .waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts/README.txt"]')
}) })
}
}, },
'drag and drop file from contracts to root #group1': function (browser: NightwatchBrowser) { 'drag and drop file from contracts to root #group1': function (browser: NightwatchBrowser) {
if (checkBrowserIsChrome(browser)) {
browser.findElement('*[data-id="treeViewUltreeViewMenu"]', (el) => { browser.findElement('*[data-id="treeViewUltreeViewMenu"]', (el) => {
console.log((el as any).value.getId()) console.log((el as any).value.getId())
const id = (el as any).value.getId() const id = (el as any).value.getId()
@ -35,8 +43,10 @@ module.exports = {
}) })
browser.pause(1000) browser.pause(1000)
.waitForElementVisible('li[data-id="treeViewLitreeViewItem1_Storage.sol"]') .waitForElementVisible('li[data-id="treeViewLitreeViewItem1_Storage.sol"]')
}
}, },
'drag and drop scripts from root to contracts #group1': function (browser: NightwatchBrowser) { 'drag and drop scripts from root to contracts #group1': function (browser: NightwatchBrowser) {
if (checkBrowserIsChrome(browser)) {
browser browser
.waitForElementVisible('*[data-id="treeViewLitreeViewItemcontracts"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemcontracts"]')
.findElement('*[data-id="treeViewLitreeViewItemcontracts"]', (el) => { .findElement('*[data-id="treeViewLitreeViewItemcontracts"]', (el) => {
@ -49,8 +59,10 @@ module.exports = {
.execute(function () { (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click() }) .execute(function () { (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click() })
.waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts/scripts"]') .waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts/scripts"]')
}) })
}
}, },
'drag scripts from contracts to root #group1': function (browser: NightwatchBrowser) { 'drag scripts from contracts to root #group1': function (browser: NightwatchBrowser) {
if (checkBrowserIsChrome(browser)) {
browser.findElement('*[data-id="treeViewUltreeViewMenu"]', (el) => { browser.findElement('*[data-id="treeViewUltreeViewMenu"]', (el) => {
console.log((el as any).value.getId()) console.log((el as any).value.getId())
const id = (el as any).value.getId() const id = (el as any).value.getId()
@ -62,8 +74,10 @@ module.exports = {
}) })
browser.pause(1000) browser.pause(1000)
.waitForElementVisible('li[data-id="treeViewLitreeViewItemscripts"]') .waitForElementVisible('li[data-id="treeViewLitreeViewItemscripts"]')
}
}, },
'drag into nested folder': function (browser: NightwatchBrowser) { 'drag into nested folder': function (browser: NightwatchBrowser) {
if (checkBrowserIsChrome(browser)) {
browser.waitForElementVisible('li[data-id="treeViewLitreeViewItemscripts"]') browser.waitForElementVisible('li[data-id="treeViewLitreeViewItemscripts"]')
.rightClick('li[data-id="treeViewLitreeViewItemscripts"]') .rightClick('li[data-id="treeViewLitreeViewItemscripts"]')
.waitForElementPresent('[data-id="contextMenuItemnewFolder') .waitForElementPresent('[data-id="contextMenuItemnewFolder')
@ -82,6 +96,7 @@ module.exports = {
.waitForElementVisible('li[data-id="treeViewLitreeViewItemscripts/nested/README.txt"]') .waitForElementVisible('li[data-id="treeViewLitreeViewItemscripts/nested/README.txt"]')
}) })
} }
}

Loading…
Cancel
Save