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
5fee645c
Commit
5fee645c
authored
Jun 26, 2017
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add tests
parent
394c2bf2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
68 additions
and
2 deletions
+68
-2
browser_tests.sh
ci/browser_tests.sh
+20
-1
contracts.js
test-browser/helpers/contracts.js
+1
-1
sharedFolderExplorer.js
test-browser/tests/sharedFolderExplorer.js
+47
-0
No files found.
ci/browser_tests.sh
View file @
5fee645c
...
...
@@ -2,6 +2,23 @@
set
-e
setupRemixd
()
{
npm
install
remixd
mkdir
remixdSharedfolder
cd
remixdSharedfolder
echo
"contract test1 { function get () returns (uint) { return 8; }}"
>
contract1.sol
echo
"contract test2 { function get () returns (uint) { return 9; }}"
>
contract2.sol
mkdir
folder1
cd
folder1
echo
"contract test1 { function get () returns (uint) { return 10; }}"
>
contract1.sol
echo
"contract test2 { function get () returns (uint) { return 11; }}"
>
contract2.sol
cd
..
echo
'sharing folder: '
echo
$PWD
./../node_modules/.bin/remixd
-S
$PWD
&
cd
..
}
SC_VERSION
=
"4.4.0"
SAUCECONNECT_URL
=
"https://saucelabs.com/downloads/sc-
$SC_VERSION
-linux.tar.gz"
SAUCECONNECT_USERNAME
=
"chriseth"
...
...
@@ -12,9 +29,11 @@ TEST_EXITCODE=0
npm run serve &
setupRemixd
wget
"
$SAUCECONNECT_URL
"
tar
-zxvf
sc-
"
$SC_VERSION
"
-linux
.tar.gz
./sc-
"
$SC_VERSION
"
-linux
/bin/sc
-u
"
$SAUCECONNECT_USERNAME
"
-k
"
$SAUCECONNECT_ACCESSKEY
"
-i
"
$SAUCECONNECT_JOBIDENTIFIER
"
--readyfile
"
$SAUCECONNECT_READYFILE
"
&
./sc-
"
$SC_VERSION
"
-linux
/bin/sc
-u
"
$SAUCECONNECT_USERNAME
"
-k
"
$SAUCECONNECT_ACCESSKEY
"
-i
"
$SAUCECONNECT_JOBIDENTIFIER
"
--
no-ssl-bump-domains
all
--
readyfile
"
$SAUCECONNECT_READYFILE
"
&
while
[
!
-f
"
$SAUCECONNECT_READYFILE
"
]
;
do
sleep
.5
done
...
...
test-browser/helpers/contracts.js
View file @
5fee645c
...
...
@@ -21,7 +21,7 @@ function testContracts (browser, contractCode, compiledContractNames, callback)
.
clearValue
(
'#input textarea'
)
.
click
(
'.newFile'
)
.
setValue
(
'#input textarea'
,
contractCode
,
function
()
{})
.
waitForElementPresent
(
'.udapp .create'
,
5000
,
true
,
function
()
{
.
waitForElementPresent
(
'.udapp .create'
,
5000
0
,
true
,
function
()
{
checkCompiledContracts
(
browser
,
compiledContractNames
,
callback
)
})
}
test-browser/tests/sharedFolderExplorer.js
0 → 100644
View file @
5fee645c
'use strict'
var
contractHelper
=
require
(
'../helpers/contracts'
)
var
init
=
require
(
'../helpers/init'
)
var
sauce
=
require
(
'./sauce'
)
var
sources
=
{
'sources'
:
{
'localhost/folder1/contract2.sol'
:
`contract test2 { function get () returns (uint) { return 11; }}`
}
}
module
.
exports
=
{
before
:
function
(
browser
,
done
)
{
init
(
browser
,
done
)
},
'@sources'
:
function
()
{
return
sources
},
'SharedFolderExplorer'
:
function
(
browser
)
{
runTests
(
browser
)
},
tearDown
:
sauce
}
function
runTests
(
browser
,
testData
)
{
if
(
browser
.
options
.
desiredCapabilities
.
browserName
===
'safari'
)
{
console
.
log
(
'don
\'
t run remixd test for safari: sauce labs doesn
\'
t seems to handle websocket'
)
browser
.
end
()
return
}
browser
.
waitForElementVisible
(
'.newFile'
,
10000
)
.
click
(
'.websocketconn'
)
.
waitForElementVisible
(
'#modal-footer-ok'
,
10000
)
.
click
(
'#modal-footer-ok'
)
.
waitForElementVisible
(
'[data-path="localhost"]'
,
100000
)
.
click
(
'[data-path="localhost"]'
)
.
click
(
'[data-path="localhost/folder1"]'
)
.
assert
.
containsText
(
'[data-path="localhost/contract1.sol"]'
,
'contract1.sol'
)
.
assert
.
containsText
(
'[data-path="localhost/contract2.sol"]'
,
'contract2.sol'
)
.
assert
.
containsText
(
'[data-path="localhost/folder1/contract1.sol"]'
,
'contract1.sol'
)
.
assert
.
containsText
(
'[data-path="localhost/folder1/contract2.sol"]'
,
'contract2.sol'
)
.
click
(
'[data-path="localhost/folder1/contract2.sol"]'
)
contractHelper
.
testContracts
(
browser
,
sources
.
sources
[
'localhost/folder1/contract2.sol'
],
[
'localhost/folder1/contract2.sol:test2'
],
()
=>
{
browser
.
end
()
})
}
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