diff --git a/contracts/src/gmbh/company.sol b/contracts/src/gmbh/company.sol index 9e488c000e..3161bf74dd 100644 --- a/contracts/src/gmbh/company.sol +++ b/contracts/src/gmbh/company.sol @@ -1,6 +1,6 @@ import "./contract.sol"; contract Assets { - + uint[] proposals; function add(uint8 _numProposals) { proposals.length = _numProposals; } diff --git a/contracts/src/gmbh/contract.sol b/contracts/src/gmbh/contract.sol index 27ea2cb127..011523e562 100644 --- a/contracts/src/gmbh/contract.sol +++ b/contracts/src/gmbh/contract.sol @@ -1,5 +1,5 @@ contract gmbh { - + uint[] proposals; function register(uint8 _numProposals) { proposals.length = _numProposals; } diff --git a/test-browser/tests/sharedFolderExplorer.js b/test-browser/tests/sharedFolderExplorer.js index 47bd572672..574e8beb80 100644 --- a/test-browser/tests/sharedFolderExplorer.js +++ b/test-browser/tests/sharedFolderExplorer.js @@ -3,9 +3,34 @@ var contractHelper = require('../helpers/contracts') var init = require('../helpers/init') var sauce = require('./sauce') + +var assetsTestContract = `import "./contract.sol"; +contract Assets { + uint[] proposals; + function add(uint8 _numProposals) { + proposals.length = _numProposals; + } +} +` + +var gmbhTestContract = ` +contract gmbh { + uint[] proposals; + function register(uint8 _numProposals) { + proposals.length = _numProposals; + } +} +` var sources = [ { 'localhost/folder1/contract2.sol': {content: 'contract test2 { function get () returns (uint) { return 11; }}'} + }, + { + 'localhost/src/gmbh/company.sol': {content: assetsTestContract} + }, + { + 'localhost/src/gmbh/company.sol': {content: assetsTestContract}, + 'localhost/src/gmbh/contract.sol': {content: gmbhTestContract} } ] @@ -92,6 +117,9 @@ function runTests (browser, testData) { done() }) }) + .perform(function (done) { + testImportFromRemixd(browser, () => { done() }) + }) .perform(function () { browser.click('[data-path="localhost"]') // collapse and expand .waitForElementNotVisible('[data-path="localhost/folder1"]') @@ -107,3 +135,19 @@ function runTests (browser, testData) { .end() }) } + +function testImportFromRemixd (browser, callback) { + browser + .waitForElementVisible('[data-path="localhost/src"]', 100000) + .click('[data-path="localhost/src"]') + .waitForElementVisible('[data-path="localhost/src/gmbh"]', 100000) + .click('[data-path="localhost/src/gmbh"]') + .waitForElementVisible('[data-path="localhost/src/gmbh/company.sol"]', 100000) + .click('[data-path="localhost/src/gmbh/company.sol"]') + .pause(500) + .perform(() => { + contractHelper.verifyContract(browser, ['Assets', 'gmbh'], function () { + callback() + }) + }) +} diff --git a/test-browser/tests/simpleContract.js b/test-browser/tests/simpleContract.js index aa7aae59ed..ef08304112 100644 --- a/test-browser/tests/simpleContract.js +++ b/test-browser/tests/simpleContract.js @@ -28,8 +28,7 @@ function runTests (browser) { async.waterfall([function (callback) { callback(null, browser) }, testSimpleContract, testSuccessImport, - testFailedImport, /* testGitHubImport */ - testImportFromRemixd + testFailedImport /* testGitHubImport */ ], function () { browser.end() @@ -37,26 +36,6 @@ function runTests (browser) { }) } -function testImportFromRemixd (browser, callback) { - browser.click('.websocketconn') - .waitForElementVisible('#modal-footer-ok', 10000) - .click('#modal-footer-ok') - .waitForElementVisible('[data-path="localhost"]', 100000) - .click('[data-path="localhost"]') - .waitForElementVisible('[data-path="localhost/src"]', 100000) - .click('[data-path="localhost/src"]') - .waitForElementVisible('[data-path="localhost/src/gmbh"]', 100000) - .click('[data-path="localhost/src/gmbh"]') - .waitForElementVisible('[data-path="localhost/src/gmbh/company.sol"]', 100000) - .click('[data-path="localhost/src/gmbh/company.sol"]') - .perform(() => { - contractHelper.verifyContract(browser, ['Assets', 'gmbh'], function () { - browser.click('.websocketconn') - callback(null, browser) - }) - }) -} - function testSimpleContract (browser, callback) { console.log('testSimpleContract') contractHelper.testContracts(browser, 'Untitled.sol', sources[0]['browser/Untitled.sol'], ['test1', 'test2'], function () { @@ -219,24 +198,6 @@ contract ENS is AbstractENS { } }` -var assetsTestContract = `import "./contract.sol"; -contract Assets { - - function add(uint8 _numProposals) { - proposals.length = _numProposals; - } -} -` - -var gmbhTestContract = ` -contract gmbh { - - function register(uint8 _numProposals) { - proposals.length = _numProposals; - } -} -` - var sources = [ { 'browser/Untitled.sol': {content: 'contract test1 {} contract test2 {}'} @@ -256,12 +217,5 @@ var sources = [ 'browser/Untitled4.sol': {content: 'import "github.com/ethereum/ens/contracts/ENS.sol"; contract test7 {}'}, 'github.com/ethereum/ens/contracts/ENS.sol': {content: ENS}, 'github.com/ethereum/ens/contracts/AbstractENS.sol': {content: abstractENS} - }, - { - 'localhost/src/gmbh/company.sol': {content: assetsTestContract} - }, - { - 'localhost/src/gmbh/company.sol': {content: assetsTestContract}, - 'localhost/src/gmbh/contract.sol': {content: gmbhTestContract} } ]