split remixd tests

pull/1754/head
bunsenstraat 3 years ago
parent 8bf046d4c3
commit 41c58e27d1
  1. 25
      apps/remix-ide-e2e/src/tests/remixd.test.ts

@ -45,6 +45,7 @@ const sources = [
] ]
module.exports = { module.exports = {
'@disabled': true,
before: function (browser, done) { before: function (browser, done) {
init(browser, done) init(browser, done)
}, },
@ -52,25 +53,27 @@ module.exports = {
'@sources': function () { '@sources': function () {
return sources return sources
}, },
'start Remixd': function (browser) {
Remixd: function (browser) { startRemixd(browser)
},
'run Remixd tests #group4': function (browser) {
runTests(browser) runTests(browser)
}, },
'Import from node_modules ': function (browser) { 'Import from node_modules #group1': function (browser) {
/* /*
when a relative import is used (i.e import "openzeppelin-solidity/contracts/math/SafeMath.sol") when a relative import is used (i.e import "openzeppelin-solidity/contracts/math/SafeMath.sol")
remix (as well as truffle) try to resolve it against the node_modules and installed_contracts folder. remix (as well as truffle) try to resolve it against the node_modules and installed_contracts folder.
*/ */
browser.waitForElementVisible('#icon-panel', 2000) browser.waitForElementVisible('#icon-panel', 2000)
// .clickLaunchIcon('filePanel') .clickLaunchIcon('filePanel')
.click('[data-path="ballot.sol"]') .click('[data-path="ballot.sol"]')
.addFile('test_import_node_modules.sol', sources[3]['test_import_node_modules.sol']) .addFile('test_import_node_modules.sol', sources[3]['test_import_node_modules.sol'])
.clickLaunchIcon('solidity') .clickLaunchIcon('solidity')
.setSolidityCompilerVersion('soljson-v0.5.0+commit.1d4f565a.js') .setSolidityCompilerVersion('soljson-v0.5.0+commit.1d4f565a.js')
.testContracts('test_import_node_modules.sol', sources[3]['test_import_node_modules.sol'], ['SafeMath']) .testContracts('test_import_node_modules.sol', sources[3]['test_import_node_modules.sol'], ['SafeMath'])
}, },
'Import from node_modules and reference a github import': function (browser) { 'Import from node_modules and reference a github import #group2': function (browser) {
browser.waitForElementVisible('#icon-panel', 2000) browser.waitForElementVisible('#icon-panel', 2000)
.clickLaunchIcon('filePanel') .clickLaunchIcon('filePanel')
.addFile('test_import_node_modules_with_github_import.sol', sources[4]['test_import_node_modules_with_github_import.sol']) .addFile('test_import_node_modules_with_github_import.sol', sources[4]['test_import_node_modules_with_github_import.sol'])
@ -78,7 +81,7 @@ module.exports = {
.setSolidityCompilerVersion('soljson-v0.8.0+commit.c7dfd78e.js') // open-zeppelin moved to pragma ^0.8.0 .setSolidityCompilerVersion('soljson-v0.8.0+commit.c7dfd78e.js') // open-zeppelin moved to pragma ^0.8.0
.testContracts('test_import_node_modules_with_github_import.sol', sources[4]['test_import_node_modules_with_github_import.sol'], ['ERC20', 'test11']) .testContracts('test_import_node_modules_with_github_import.sol', sources[4]['test_import_node_modules_with_github_import.sol'], ['ERC20', 'test11'])
}, },
'Static Analysis run with remixd': function (browser) { 'Static Analysis run with remixd #group3': function (browser) {
browser.testContracts('test_static_analysis_with_remixd_and_hardhat.sol', sources[5]['test_static_analysis_with_remixd_and_hardhat.sol'], ['test5']) browser.testContracts('test_static_analysis_with_remixd_and_hardhat.sol', sources[5]['test_static_analysis_with_remixd_and_hardhat.sol'], ['test5'])
.clickLaunchIcon('solidityStaticAnalysis') .clickLaunchIcon('solidityStaticAnalysis')
.click('#staticanalysisButton button') .click('#staticanalysisButton button')
@ -101,7 +104,7 @@ module.exports = {
.journalLastChildIncludes('On branch ') .journalLastChildIncludes('On branch ')
}, },
'Close Remixd': function (browser) { 'Close Remixd #group3': function (browser) {
browser browser
.clickLaunchIcon('pluginManager') .clickLaunchIcon('pluginManager')
.scrollAndClick('#pluginManager *[data-id="pluginManagerComponentDeactivateButtonremixd"]') .scrollAndClick('#pluginManager *[data-id="pluginManagerComponentDeactivateButtonremixd"]')
@ -109,7 +112,7 @@ module.exports = {
} }
} }
function runTests (browser: NightwatchBrowser) { function startRemixd (browser: NightwatchBrowser) {
const browserName = browser.options.desiredCapabilities.browserName const browserName = browser.options.desiredCapabilities.browserName
if (browserName === 'safari' || browserName === 'internet explorer') { if (browserName === 'safari' || browserName === 'internet explorer') {
console.log('do not run remixd test for ' + browserName + ': sauce labs doesn\'t seems to handle websocket') console.log('do not run remixd test for ' + browserName + ': sauce labs doesn\'t seems to handle websocket')
@ -126,7 +129,11 @@ function runTests (browser: NightwatchBrowser) {
.pause(2000) .pause(2000)
.click('#modal-footer-ok') .click('#modal-footer-ok')
// .click('*[data-id="workspacesModalDialog-modal-footer-ok-react"]') // .click('*[data-id="workspacesModalDialog-modal-footer-ok-react"]')
.clickLaunchIcon('filePanel') }
function runTests(browser: NightwatchBrowser) {
const browserName = browser.options.desiredCapabilities.browserName
browser.clickLaunchIcon('filePanel')
.waitForElementVisible('[data-path="folder1"]') .waitForElementVisible('[data-path="folder1"]')
.click('[data-path="folder1"]') .click('[data-path="folder1"]')
.waitForElementVisible('[data-path="contract1.sol"]') .waitForElementVisible('[data-path="contract1.sol"]')

Loading…
Cancel
Save