Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
308c7b3e
Commit
308c7b3e
authored
Feb 14, 2018
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move tests
parent
4826172c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
49 deletions
+47
-49
company.sol
contracts/src/gmbh/company.sol
+1
-1
contract.sol
contracts/src/gmbh/contract.sol
+1
-1
sharedFolderExplorer.js
test-browser/tests/sharedFolderExplorer.js
+44
-0
simpleContract.js
test-browser/tests/simpleContract.js
+1
-47
No files found.
contracts/src/gmbh/company.sol
View file @
308c7b3e
import "./contract.sol";
import "./contract.sol";
contract Assets {
contract Assets {
uint[] proposals;
function add(uint8 _numProposals) {
function add(uint8 _numProposals) {
proposals.length = _numProposals;
proposals.length = _numProposals;
}
}
...
...
contracts/src/gmbh/contract.sol
View file @
308c7b3e
contract gmbh {
contract gmbh {
uint[] proposals;
function register(uint8 _numProposals) {
function register(uint8 _numProposals) {
proposals.length = _numProposals;
proposals.length = _numProposals;
}
}
...
...
test-browser/tests/sharedFolderExplorer.js
View file @
308c7b3e
...
@@ -3,9 +3,34 @@ var contractHelper = require('../helpers/contracts')
...
@@ -3,9 +3,34 @@ var contractHelper = require('../helpers/contracts')
var
init
=
require
(
'../helpers/init'
)
var
init
=
require
(
'../helpers/init'
)
var
sauce
=
require
(
'./sauce'
)
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
=
[
var
sources
=
[
{
{
'localhost/folder1/contract2.sol'
:
{
content
:
'contract test2 { function get () returns (uint) { return 11; }}'
}
'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) {
...
@@ -92,6 +117,9 @@ function runTests (browser, testData) {
done
()
done
()
})
})
})
})
.
perform
(
function
(
done
)
{
testImportFromRemixd
(
browser
,
()
=>
{
done
()
})
})
.
perform
(
function
()
{
.
perform
(
function
()
{
browser
.
click
(
'[data-path="localhost"]'
)
// collapse and expand
browser
.
click
(
'[data-path="localhost"]'
)
// collapse and expand
.
waitForElementNotVisible
(
'[data-path="localhost/folder1"]'
)
.
waitForElementNotVisible
(
'[data-path="localhost/folder1"]'
)
...
@@ -107,3 +135,19 @@ function runTests (browser, testData) {
...
@@ -107,3 +135,19 @@ function runTests (browser, testData) {
.
end
()
.
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
()
})
})
}
test-browser/tests/simpleContract.js
View file @
308c7b3e
...
@@ -28,8 +28,7 @@ function runTests (browser) {
...
@@ -28,8 +28,7 @@ function runTests (browser) {
async
.
waterfall
([
function
(
callback
)
{
callback
(
null
,
browser
)
},
async
.
waterfall
([
function
(
callback
)
{
callback
(
null
,
browser
)
},
testSimpleContract
,
testSimpleContract
,
testSuccessImport
,
testSuccessImport
,
testFailedImport
,
/* testGitHubImport */
testFailedImport
/* testGitHubImport */
testImportFromRemixd
],
],
function
()
{
function
()
{
browser
.
end
()
browser
.
end
()
...
@@ -37,26 +36,6 @@ function runTests (browser) {
...
@@ -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
)
{
function
testSimpleContract
(
browser
,
callback
)
{
console
.
log
(
'testSimpleContract'
)
console
.
log
(
'testSimpleContract'
)
contractHelper
.
testContracts
(
browser
,
'Untitled.sol'
,
sources
[
0
][
'browser/Untitled.sol'
],
[
'test1'
,
'test2'
],
function
()
{
contractHelper
.
testContracts
(
browser
,
'Untitled.sol'
,
sources
[
0
][
'browser/Untitled.sol'
],
[
'test1'
,
'test2'
],
function
()
{
...
@@ -219,24 +198,6 @@ contract ENS is AbstractENS {
...
@@ -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
=
[
var
sources
=
[
{
{
'browser/Untitled.sol'
:
{
content
:
'contract test1 {} contract test2 {}'
}
'browser/Untitled.sol'
:
{
content
:
'contract test1 {} contract test2 {}'
}
...
@@ -256,12 +217,5 @@ var sources = [
...
@@ -256,12 +217,5 @@ var sources = [
'browser/Untitled4.sol'
:
{
content
:
'import "github.com/ethereum/ens/contracts/ENS.sol"; contract test7 {}'
},
'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/ENS.sol'
:
{
content
:
ENS
},
'github.com/ethereum/ens/contracts/AbstractENS.sol'
:
{
content
:
abstractENS
}
'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
}
}
}
]
]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment