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
bd75dea5
Commit
bd75dea5
authored
Jan 10, 2020
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add browser tests
parent
8ceced34
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
84 additions
and
3 deletions
+84
-3
package.json
package.json
+1
-0
file-explorer.js
src/app/files/file-explorer.js
+2
-2
executeScript.js
test-browser/commands/executeScript.js
+1
-0
getModalBody.js
test-browser/commands/getModalBody.js
+16
-0
modalFooterCancelClick.js
test-browser/commands/modalFooterCancelClick.js
+17
-0
modalFooterOKClick.js
test-browser/commands/modalFooterOKClick.js
+1
-1
switchFile.js
test-browser/commands/switchFile.js
+1
-0
gist.js
test-browser/tests/gist.js
+45
-0
No files found.
package.json
View file @
bd75dea5
...
...
@@ -170,6 +170,7 @@
"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 "
,
"nightwatch_local_gist"
:
"nightwatch ./test-browser/tests/gist.js --config nightwatch.js --env chrome "
,
"onchange"
:
"onchange build/app.js -- npm-run-all lint"
,
"prepublish"
:
"mkdirp build; npm-run-all -ls downloadsolc_root build"
,
"remixd"
:
"remixd -s ./contracts --remix-ide http://127.0.0.1:8080"
,
...
...
src/app/files/file-explorer.js
View file @
bd75dea5
...
...
@@ -633,7 +633,7 @@ fileExplorer.prototype.renderMenuItems = function () {
items
=
this
.
menuItems
.
map
(({
action
,
title
,
icon
})
=>
{
if
(
action
===
'uploadFile'
)
{
return
yo
`
<label class="
${
icon
}
${
css
.
newFile
}
" title="
${
title
}
">
<label
id=
${
action
}
class="
${
icon
}
${
css
.
newFile
}
" title="
${
title
}
">
<input type="file" onchange=
${(
event
)
=>
{
event
.
stopPropagation
()
this
.
uploadFile
(
event
)
...
...
@@ -642,7 +642,7 @@ fileExplorer.prototype.renderMenuItems = function () {
`
} else {
return yo`
<
span
onclick
=
$
{(
event
)
=>
{
event
.
stopPropagation
();
this
[
action
]()
}}
class
=
"newFile ${icon} ${css.newFile}"
title
=
$
{
title
}
></span>
<
span
id
=
$
{
action
}
onclick=
${(
event
)
=>
{
event
.
stopPropagation
();
this
[
action
]()
}}
class
=
"newFile ${icon} ${css.newFile}"
title
=
$
{
title
}
></span>
`
}
})
...
...
test-browser/commands/executeScript.js
View file @
bd75dea5
...
...
@@ -6,6 +6,7 @@ class ExecuteScript extends EventEmitter {
.
click
(
'#terminalCli'
)
.
keys
(
script
)
.
keys
(
this
.
api
.
Keys
.
ENTER
)
.
keys
(
this
.
api
.
Keys
.
ENTER
)
// that's a bug... sometimes we need to press 2 times to execute a command
.
perform
(()
=>
{
this
.
emit
(
'complete'
)
})
...
...
test-browser/commands/getModalBody.js
0 → 100644
View file @
bd75dea5
const
EventEmitter
=
require
(
'events'
)
class
GetModalBody
extends
EventEmitter
{
command
(
callback
)
{
this
.
api
.
waitForElementVisible
(
'.modal-body'
)
.
getText
(
'.modal-body'
,
(
result
)
=>
{
console
.
log
(
result
)
callback
(
result
.
value
,
()
=>
{
this
.
emit
(
'complete'
)
})
})
return
this
}
}
module
.
exports
=
GetModalBody
test-browser/commands/modalFooterCancelClick.js
0 → 100644
View file @
bd75dea5
const
EventEmitter
=
require
(
'events'
)
class
ModalFooterOKClick
extends
EventEmitter
{
command
()
{
this
.
api
.
waitForElementVisible
(
'#modal-footer-cancel'
).
perform
((
client
,
done
)
=>
{
this
.
api
.
execute
(
function
()
{
document
.
querySelector
(
'#modal-footer-cancel'
).
click
()
},
[],
(
result
)
=>
{
done
()
this
.
emit
(
'complete'
)
})
})
return
this
}
}
module
.
exports
=
ModalFooterOKClick
test-browser/commands/modalFooterOKClick.js
View file @
bd75dea5
...
...
@@ -2,7 +2,7 @@ const EventEmitter = require('events')
class
ModalFooterOKClick
extends
EventEmitter
{
command
()
{
this
.
api
.
perform
((
client
,
done
)
=>
{
this
.
api
.
waitForElementVisible
(
'#modal-footer-ok'
).
perform
((
client
,
done
)
=>
{
this
.
api
.
execute
(
function
()
{
document
.
querySelector
(
'#modal-footer-ok'
).
click
()
},
[],
(
result
)
=>
{
...
...
test-browser/commands/switchFile.js
View file @
bd75dea5
...
...
@@ -15,6 +15,7 @@ class SwitchFile extends EventEmitter {
// click on fileExplorer can toggle it. We go through settings to be sure FE is open
function
switchFile
(
browser
,
name
,
done
)
{
browser
.
clickLaunchIcon
(
'settings'
).
clickLaunchIcon
(
'fileExplorers'
)
.
waitForElementVisible
(
'li[key="'
+
name
+
'"]'
)
.
click
(
'li[key="'
+
name
+
'"]'
)
.
pause
(
2000
)
.
perform
(()
=>
{
...
...
test-browser/tests/gist.js
0 → 100644
View file @
bd75dea5
'use strict'
const
init
=
require
(
'../helpers/init'
)
const
sauce
=
require
(
'./sauce'
)
// 99266d6da54cc12f37f11586e8171546c7700d67
module
.
exports
=
{
before
:
function
(
browser
,
done
)
{
init
(
browser
,
done
)
},
'UploadToGists'
:
function
(
browser
)
{
/*
- set the access token
- publish to gist
- retrieve the gist
- switch to a file in the new gist
*/
console
.
log
(
'token'
,
process
.
env
.
gist_token
)
browser
.
waitForElementVisible
(
'#icon-panel'
,
10000
)
.
clickLaunchIcon
(
'settings'
)
.
setValue
(
'#gistaccesstoken'
,
process
.
env
.
gist_token
)
.
click
(
'#savegisttoken'
)
.
clickLaunchIcon
(
'fileExplorers'
)
.
click
(
'#publishToGist'
)
.
modalFooterOKClick
()
.
getModalBody
((
value
,
done
)
=>
{
const
reg
=
/gist.github.com
\/([^
.
]
+
)
/
const
id
=
value
.
match
(
reg
)
console
.
log
(
'gist regex'
,
id
)
if
(
!
id
)
{
browser
.
assert
.
fail
(
'cannot get the gist id'
,
''
,
''
)
}
else
{
let
gistid
=
id
[
1
]
browser
.
modalFooterCancelClick
()
.
executeScript
(
`remix.loadgist('
${
gistid
}
')`
)
.
switchFile
(
'browser/gists'
)
.
switchFile
(
`browser/gists/
${
gistid
}
`
)
.
switchFile
(
`browser/gists/
${
gistid
}
/1_Storage.sol`
)
.
end
()
}
})
},
tearDown
:
sauce
}
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