|
|
|
@ -44,12 +44,12 @@ module.exports = { |
|
|
|
|
.waitForElementPresent('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') |
|
|
|
|
.execute(function () { (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click() }) |
|
|
|
|
.pause(1000) |
|
|
|
|
.assert.elementPresent('*[data-id="treeViewLitreeViewItemcontracts"]') |
|
|
|
|
.assert.elementPresent('*[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]') |
|
|
|
|
.assert.elementPresent('*[data-id="treeViewLitreeViewItemcontracts/2_Owner.sol"]') |
|
|
|
|
.assert.elementPresent('*[data-id="treeViewLitreeViewItemcontracts/3_Ballot.sol"]') |
|
|
|
|
.assert.elementPresent('*[data-id="treeViewLitreeViewItemscripts"]') |
|
|
|
|
.assert.elementPresent('*[data-id="treeViewLitreeViewItemscripts/deploy_with_web3.ts"]') |
|
|
|
|
.waitForElementVisible('*[data-id="treeViewLitreeViewItemcontracts"]') |
|
|
|
|
.waitForElementVisible('*[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]') |
|
|
|
|
.waitForElementVisible('*[data-id="treeViewLitreeViewItemcontracts/2_Owner.sol"]') |
|
|
|
|
.waitForElementVisible('*[data-id="treeViewLitreeViewItemcontracts/3_Ballot.sol"]') |
|
|
|
|
.waitForElementVisible('*[data-id="treeViewLitreeViewItemscripts"]') |
|
|
|
|
.waitForElementVisible('*[data-id="treeViewLitreeViewItemscripts/deploy_with_web3.ts"]') |
|
|
|
|
// check js and ts files are not transformed
|
|
|
|
|
.click('*[data-id="treeViewLitreeViewItemscripts/deploy_with_web3.ts"]') |
|
|
|
|
|
|
|
|
@ -57,37 +57,37 @@ module.exports = { |
|
|
|
|
browser.assert.ok(content.indexOf(`import { deploy } from './web3-lib'`) !== -1, |
|
|
|
|
'Incorrect content') |
|
|
|
|
}) |
|
|
|
|
.assert.elementPresent('*[data-id="treeViewLitreeViewItemscripts/deploy_with_ethers.ts"]') |
|
|
|
|
.waitForElementVisible('*[data-id="treeViewLitreeViewItemscripts/deploy_with_ethers.ts"]') |
|
|
|
|
.click('*[data-id="treeViewLitreeViewItemscripts/deploy_with_ethers.ts"]') |
|
|
|
|
.pause(100) |
|
|
|
|
.getEditorValue((content) => { |
|
|
|
|
browser.assert.ok(content.indexOf(`import { deploy } from './ethers-lib'`) !== -1, |
|
|
|
|
'Incorrect content') |
|
|
|
|
}) |
|
|
|
|
.assert.elementPresent('*[data-id="treeViewLitreeViewItemscripts/web3-lib.ts"]') |
|
|
|
|
.waitForElementVisible('*[data-id="treeViewLitreeViewItemscripts/web3-lib.ts"]') |
|
|
|
|
.click('*[data-id="treeViewLitreeViewItemscripts/web3-lib.ts"]') |
|
|
|
|
.pause(2000) |
|
|
|
|
.getEditorValue((content) => { |
|
|
|
|
browser.assert.ok(content.indexOf(`export const deploy = async (contractName: string, args: Array<any>, from?: string, gas?: number): Promise<Options> => {`) !== -1, |
|
|
|
|
'Incorrect content') |
|
|
|
|
}) |
|
|
|
|
.assert.elementPresent('*[data-id="treeViewLitreeViewItemscripts/ethers-lib.ts"]') |
|
|
|
|
.waitForElementVisible('*[data-id="treeViewLitreeViewItemscripts/ethers-lib.ts"]') |
|
|
|
|
.click('*[data-id="treeViewLitreeViewItemscripts/ethers-lib.ts"]') |
|
|
|
|
.pause(100) |
|
|
|
|
.getEditorValue((content) => { |
|
|
|
|
browser.assert.ok(content.indexOf(`export const deploy = async (contractName: string, args: Array<any>, accountIndex?: number): Promise<ethers.Contract> => {`) !== -1, |
|
|
|
|
'Incorrect content') |
|
|
|
|
}) |
|
|
|
|
.assert.elementPresent('*[data-id="treeViewLitreeViewItemtests"]') |
|
|
|
|
.assert.elementPresent('*[data-id="treeViewLitreeViewItemtests/storage.test.js"]') |
|
|
|
|
.waitForElementVisible('*[data-id="treeViewLitreeViewItemtests"]') |
|
|
|
|
.waitForElementVisible('*[data-id="treeViewLitreeViewItemtests/storage.test.js"]') |
|
|
|
|
.click('*[data-id="treeViewLitreeViewItemtests/storage.test.js"]') |
|
|
|
|
.pause(100) |
|
|
|
|
.getEditorValue((content) => { |
|
|
|
|
browser.assert.ok(content.indexOf(`const { expect } = require("chai");`) !== -1, |
|
|
|
|
'Incorrect content') |
|
|
|
|
}) |
|
|
|
|
.assert.elementPresent('*[data-id="treeViewLitreeViewItemtests/Ballot_test.sol"]') |
|
|
|
|
.assert.elementPresent('*[data-id="treeViewLitreeViewItemREADME.txt"]') |
|
|
|
|
.waitForElementVisible('*[data-id="treeViewLitreeViewItemtests/Ballot_test.sol"]') |
|
|
|
|
.waitForElementVisible('*[data-id="treeViewLitreeViewItemREADME.txt"]') |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
'Should create blank workspace with no files #group1': function (browser: NightwatchBrowser) { |
|
|
|
@ -102,7 +102,7 @@ module.exports = { |
|
|
|
|
.waitForElementPresent('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') |
|
|
|
|
.execute(function () { (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click() }) |
|
|
|
|
.pause(100) |
|
|
|
|
.assert.elementPresent('*[data-id="treeViewUltreeViewMenu"]') |
|
|
|
|
.waitForElementVisible('*[data-id="treeViewUltreeViewMenu"]') |
|
|
|
|
.execute(function () { |
|
|
|
|
const fileList = document.querySelector('*[data-id="treeViewUltreeViewMenu"]') |
|
|
|
|
return fileList.getElementsByTagName('li').length; |
|
|
|
|