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
049643a2
Commit
049643a2
authored
Jun 22, 2020
by
ioedeveloper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Filemanager external api e2e tests
parent
37e78ea1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
146 additions
and
1 deletion
+146
-1
package.json
package.json
+1
-0
fileManager.js
src/app/files/fileManager.js
+1
-1
fileManager_api.test.js
test-browser/tests/fileManager_api.test.js
+144
-0
No files found.
package.json
View file @
049643a2
...
@@ -187,6 +187,7 @@
...
@@ -187,6 +187,7 @@
"nightwatch_local_editor"
:
"nightwatch ./test-browser/tests/editor.test.js --config nightwatch.js --env chrome "
,
"nightwatch_local_editor"
:
"nightwatch ./test-browser/tests/editor.test.js --config nightwatch.js --env chrome "
,
"nightwatch_local_compiler"
:
"nightwatch ./test-browser/tests/compiler_api.test.js --config nightwatch.js --env chrome "
,
"nightwatch_local_compiler"
:
"nightwatch ./test-browser/tests/compiler_api.test.js --config nightwatch.js --env chrome "
,
"nightwatch_local_txListener"
:
"nightwatch ./test-browser/tests/txListener.test.js --config nightwatch.js --env chrome "
,
"nightwatch_local_txListener"
:
"nightwatch ./test-browser/tests/txListener.test.js --config nightwatch.js --env chrome "
,
"nightwatch_local_fileManager"
:
"nightwatch ./test-browser/tests/fileManager_api.test.js --config nightwatch.js --env chrome "
,
"nightwatch_local_runAndDeploy"
:
"nightwatch ./test-browser/tests/runAndDeploy.js --config nightwatch.js --env chrome-runAndDeploy "
,
"nightwatch_local_runAndDeploy"
:
"nightwatch ./test-browser/tests/runAndDeploy.js --config nightwatch.js --env chrome-runAndDeploy "
,
"onchange"
:
"onchange build/app.js -- npm-run-all lint"
,
"onchange"
:
"onchange build/app.js -- npm-run-all lint"
,
"prepublish"
:
"mkdirp build; npm-run-all -ls downloadsolc_root build"
,
"prepublish"
:
"mkdirp build; npm-run-all -ls downloadsolc_root build"
,
...
...
src/app/files/fileManager.js
View file @
049643a2
...
@@ -23,7 +23,7 @@ const profile = {
...
@@ -23,7 +23,7 @@ const profile = {
icon
:
'assets/img/fileManager.webp'
,
icon
:
'assets/img/fileManager.webp'
,
permission
:
true
,
permission
:
true
,
version
:
packageJson
.
version
,
version
:
packageJson
.
version
,
methods
:
[
'file'
,
'exists'
,
'open'
,
'writeFile'
,
'readFile'
,
'copyFile'
,
'rename'
,
'readdir'
,
'remove'
,
'getCurrentFile'
,
'getFile'
,
'getFolder'
,
'setFile'
,
'switchFile'
],
methods
:
[
'file'
,
'exists'
,
'open'
,
'writeFile'
,
'readFile'
,
'copyFile'
,
'rename'
,
'
mkdir'
,
'
readdir'
,
'remove'
,
'getCurrentFile'
,
'getFile'
,
'getFolder'
,
'setFile'
,
'switchFile'
],
kind
:
'file-system'
kind
:
'file-system'
}
}
const
errorMsg
=
{
const
errorMsg
=
{
...
...
test-browser/tests/fileManager_api.test.js
0 → 100644
View file @
049643a2
'use strict'
var
init
=
require
(
'../helpers/init'
)
var
sauce
=
require
(
'./sauce'
)
module
.
exports
=
{
before
:
function
(
browser
,
done
)
{
init
(
browser
,
done
)
},
'Should execute `file` api from file manager external api'
:
function
(
browser
)
{
browser
.
addFile
(
'file.js'
,
{
content
:
executeFile
})
.
executeScript
(
`remix.exeCurrent()`
)
.
pause
(
2000
)
.
journalLastChildIncludes
(
'browser/file.js'
)
},
'Should execute `exists` api from file manager external api'
:
function
(
browser
)
{
browser
.
addFile
(
'exists.js'
,
{
content
:
executeExists
})
.
executeScript
(
`remix.exeCurrent()`
)
.
pause
(
2000
)
.
journalChildIncludes
(
'browser/exists.js true'
)
.
journalChildIncludes
(
'browser/non-exists.js false'
)
},
'Should execute `open` api from file manager external api'
:
function
(
browser
)
{
browser
.
addFile
(
'open.js'
,
{
content
:
executeOpen
})
.
executeScript
(
`remix.exeCurrent()`
)
.
pause
(
2000
)
.
journalLastChildIncludes
(
'browser/3_Ballot.sol'
)
},
'Should execute `writeFile` api from file manager external api'
:
function
(
browser
)
{
browser
.
addFile
(
'writeFile.js'
,
{
content
:
executeWriteFile
})
.
executeScript
(
`remix.exeCurrent()`
)
.
pause
(
2000
)
.
openFile
(
'browser/new_contract.sol'
)
.
assert
.
containsText
(
'[data-id="editorInput"]'
,
'pragma solidity ^0.6.0'
)
},
'Should execute `readFile` api from file manager external api'
:
function
(
browser
)
{
browser
.
addFile
(
'readFile.js'
,
{
content
:
executeReadFile
})
.
executeScript
(
`remix.exeCurrent()`
)
.
pause
(
2000
)
.
journalLastChildIncludes
(
'pragma solidity ^0.6.0'
)
},
'Should execute `copyFile` api from file manager external api'
:
function
(
browser
)
{
browser
.
addFile
(
'copyFile.js'
,
{
content
:
executeCopyFile
})
.
executeScript
(
`remix.exeCurrent()`
)
.
pause
(
2000
)
.
journalLastChildIncludes
(
'pragma solidity >=0.2.0 <0.7.0;'
)
},
'Should execute `rename` api from file manager external api'
:
function
(
browser
)
{
browser
.
addFile
(
'renameFile.js'
,
{
content
:
executeRename
})
.
executeScript
(
`remix.exeCurrent()`
)
.
pause
(
2000
)
.
pause
(
100000
)
// .journalLastChildIncludes('pragma solidity >=0.2.0 <0.7.0;')
// .end()
},
tearDown
:
sauce
}
const
executeFile
=
`
const run = async () => {
const result = await remix.call('fileManager', 'file')
console.log(result)
}
run()
`
const
executeExists
=
`
const run = async () => {
const result1 = await remix.call('fileManager', 'exists', 'browser/exists.js')
const result2 = await remix.call('fileManager', 'exists', 'browser/non-exists.js')
console.log('browser/exists.js ' + result1)
console.log('browser/non-exists.js ' + result2)
}
run()
`
const
executeOpen
=
`
const run = async () => {
await remix.call('fileManager', 'open', 'browser/3_Ballot.sol')
const result = await remix.call('fileManager', 'file')
console.log(result)
}
run()
`
const
executeWriteFile
=
`
const run = async () => {
await remix.call('fileManager', 'writeFile', 'browser/new_contract.sol', 'pragma solidity ^0.6.0')
}
run()
`
const
executeReadFile
=
`
const run = async () => {
const result = await remix.call('fileManager', 'readFile', 'browser/new_contract.sol')
console.log(result)
}
run()
`
const
executeCopyFile
=
`
const run = async () => {
await remix.call('fileManager', 'copyFile', 'browser/basic.sol', 'browser/new_contract.sol')
const result = await remix.call('fileManager', 'readFile', 'browser/new_contract.sol')
console.log(result)
}
run()
`
const
executeRename
=
`
const run = async () => {
const result = await remix.call('fileManager', 'rename', 'browser/new_contract.sol', 'browser/old_contract.sol')
console.log(result)
}
run()
`
\ No newline at end of file
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