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
fd6ddd6c
Unverified
Commit
fd6ddd6c
authored
Oct 02, 2019
by
Aniket
Committed by
GitHub
Oct 02, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2366 from ethereum/add_browser_tests_for_unittests
add browser tests for testing basic use of solidity tests tab
parents
08a718e9
5944224a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
4 deletions
+39
-4
README.md
README.md
+1
-1
package.json
package.json
+1
-0
test-tab.js
src/app/tabs/test-tab.js
+3
-3
solidityUnittests.js
test-browser/tests/solidityUnittests.js
+34
-0
No files found.
README.md
View file @
fd6ddd6c
...
...
@@ -16,7 +16,7 @@ Remix consists of many modules and in this repository you will find the Remix ID
The
`gh-pages`
branch has always the latest stable build of Remix. It also contains a ZIP file with the entire build. Download it to use offline.
Note:
i
t contains the latest release of Solidity available at the time of the packaging. No other compiler versions are supported.
Note:
I
t contains the latest release of Solidity available at the time of the packaging. No other compiler versions are supported.
## INSTALLATION:
...
...
package.json
View file @
fd6ddd6c
...
...
@@ -166,6 +166,7 @@
"nightwatch_local_transactionExecution"
:
"nightwatch ./test-browser/tests/transactionExecution.js --config nightwatch.js --env chrome "
,
"nightwatch_local_staticAnalysis"
:
"nightwatch ./test-browser/tests/staticAnalysis.js --config nightwatch.js --env chrome "
,
"nightwatch_local_signingMessage"
:
"nightwatch ./test-browser/tests/signingMessage.js --config nightwatch.js --env chrome "
,
"nightwatch_local_solidityUnittests"
:
"nightwatch ./test-browser/tests/solidityUnittests.js --config nightwatch.js --env chrome "
,
"nightwatch_local_remixd"
:
"nightwatch ./test-browser/tests/remix.js --config nightwatch.js --env chrome "
,
"nightwatch_local_console"
:
"nightwatch ./test-browser/tests/console.js --config nightwatch.js --env chrome "
,
"onchange"
:
"onchange build/app.js -- npm-run-all lint"
,
...
...
src/app/tabs/test-tab.js
View file @
fd6ddd6c
...
...
@@ -207,7 +207,7 @@ module.exports = class TestTab extends ViewPlugin {
}
updateRunAction
(
currentFile
)
{
let
el
=
yo
`<button class="
${
css
.
runButton
}
btn btn-primary" onclick="
${
this
.
runTests
.
bind
(
this
)}
">Run Tests</button>`
let
el
=
yo
`<button
id="runTestsTabRunAction"
class="
${
css
.
runButton
}
btn btn-primary" onclick="
${
this
.
runTests
.
bind
(
this
)}
">Run Tests</button>`
const
isSolidityActive
=
this
.
appManager
.
isActive
(
'solidity'
)
if
(
!
currentFile
||
!
isSolidityActive
)
{
el
.
setAttribute
(
'disabled'
,
'disabled'
)
...
...
@@ -235,8 +235,8 @@ module.exports = class TestTab extends ViewPlugin {
}
render
()
{
this
.
onActivationInternal
()
this
.
testsOutput
=
yo
`<div class="
${
css
.
container
}
m-3 border border-primary border-right-0 border-left-0 border-bottom-0" hidden='true' id="
tests
"></div>`
this
.
testsSummary
=
yo
`<div class="
${
css
.
container
}
border border-primary border-right-0 border-left-0 border-bottom-0" hidden='true' id="
tests
"></div>`
this
.
testsOutput
=
yo
`<div class="
${
css
.
container
}
m-3 border border-primary border-right-0 border-left-0 border-bottom-0" hidden='true' id="
solidityUnittestsOutput
"></div>`
this
.
testsSummary
=
yo
`<div class="
${
css
.
container
}
border border-primary border-right-0 border-left-0 border-bottom-0" hidden='true' id="
solidityUnittestsSummary
"></div>`
this
.
loading
=
yo
`<span class='text-info ml-1'>Running tests...</span>`
this
.
loading
.
hidden
=
true
var
el
=
yo
`
...
...
test-browser/tests/solidityUnittests.js
0 → 100644
View file @
fd6ddd6c
'use strict'
var
init
=
require
(
'../helpers/init'
)
var
sauce
=
require
(
'./sauce'
)
var
sources
=
[]
module
.
exports
=
{
before
:
function
(
browser
,
done
)
{
init
(
browser
,
done
)
},
'@sources'
:
function
()
{
return
sources
},
'Solidity Unittests'
:
function
(
browser
)
{
runTests
(
browser
)
},
tearDown
:
sauce
}
function
runTests
(
browser
)
{
browser
.
waitForElementVisible
(
'#icon-panel'
,
10000
)
.
click
(
'#icon-panel div[plugin="pluginManager"]'
)
.
scrollAndClick
(
'#pluginManager article[id="remixPluginManagerListItem_solidityUnitTesting"] button'
)
.
clickLaunchIcon
(
'fileExplorers'
)
.
switchFile
(
'browser/ballot.sol'
)
.
clickLaunchIcon
(
'solidityUnitTesting'
)
.
scrollAndClick
(
'#runTestsTabRunAction'
)
.
waitForElementPresent
(
'#solidityUnittestsOutput div[class^="testPass"]'
)
.
assert
.
containsText
(
'#solidityUnittestsOutput'
,
'browser/ballot_test.sol (test3)'
)
.
assert
.
containsText
(
'#solidityUnittestsOutput'
,
'✓ (Check winning proposal)'
)
.
assert
.
containsText
(
'#solidityUnittestsOutput'
,
'✓ (Check winnin proposal with return value)'
)
.
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