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
2cf7ed50
Commit
2cf7ed50
authored
May 15, 2020
by
ioedeveloper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changed nightwatch switchFile command to openFile
parent
10bb3a7f
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
47 additions
and
47 deletions
+47
-47
fileManager.js
src/app/files/fileManager.js
+9
-9
openFile.js
test-browser/commands/openFile.js
+4
-4
defaultLayout.test.js
test-browser/tests/defaultLayout.test.js
+1
-1
editor.test.js
test-browser/tests/editor.test.js
+6
-6
generalSettings.test.js
test-browser/tests/generalSettings.test.js
+3
-3
gist.test.js
test-browser/tests/gist.test.js
+5
-5
libraryDeployment.test.js
test-browser/tests/libraryDeployment.test.js
+4
-4
pluginManager.test.js
test-browser/tests/pluginManager.test.js
+1
-1
publishContract.test.js
test-browser/tests/publishContract.test.js
+3
-3
runAndDeploy.js
test-browser/tests/runAndDeploy.js
+2
-2
signingMessage.test.js
test-browser/tests/signingMessage.test.js
+1
-1
solidityImport.test.js
test-browser/tests/solidityImport.test.js
+1
-1
solidityUnittests.test.js
test-browser/tests/solidityUnittests.test.js
+5
-5
terminal.test.js
test-browser/tests/terminal.test.js
+2
-2
No files found.
src/app/files/fileManager.js
View file @
2cf7ed50
...
...
@@ -143,7 +143,7 @@ class FileManager extends Plugin {
async
open
(
path
)
{
await
this
.
_handleExists
(
path
,
`Cannot open file
${
path
}
`
)
await
this
.
_handleIsFile
(
path
,
`Cannot open file
${
path
}
`
)
return
this
.
switch
File
(
path
)
return
this
.
open
File
(
path
)
}
/**
...
...
@@ -274,7 +274,7 @@ class FileManager extends Plugin {
delete
this
.
openedFiles
[
oldName
]
this
.
openedFiles
[
newName
]
=
newName
}
this
.
switch
File
(
newName
)
this
.
open
File
(
newName
)
}
else
{
var
newFocus
for
(
var
k
in
this
.
openedFiles
)
{
...
...
@@ -288,7 +288,7 @@ class FileManager extends Plugin {
}
}
if
(
newFocus
)
{
this
.
switch
File
(
newFocus
)
this
.
open
File
(
newFocus
)
}
}
// TODO: Only keep `this.emit` (issue#2210)
...
...
@@ -390,7 +390,7 @@ class FileManager extends Plugin {
copyName
=
path
+
'.'
+
this
.
currentRequest
.
from
}
this
.
_setFileInternal
(
copyName
,
content
)
this
.
switch
File
(
copyName
)
this
.
open
File
(
copyName
)
})
}
}
...
...
@@ -413,7 +413,7 @@ class FileManager extends Plugin {
// TODO: Only keep `this.emit` (issue#2210)
this
.
emit
(
'fileRemoved'
,
path
)
this
.
events
.
emit
(
'fileRemoved'
,
path
)
this
.
switch
File
()
this
.
open
File
()
}
unselectCurrentFile
()
{
...
...
@@ -424,8 +424,8 @@ class FileManager extends Plugin {
this
.
events
.
emit
(
'noFileSelected'
)
}
switch
File
(
file
)
{
const
_
switch
File
=
(
file
)
=>
{
open
File
(
file
)
{
const
_
open
File
=
(
file
)
=>
{
this
.
saveCurrentFile
()
this
.
_deps
.
config
.
set
(
'currentFile'
,
file
)
this
.
openedFiles
[
file
]
=
file
...
...
@@ -444,14 +444,14 @@ class FileManager extends Plugin {
}
})
}
if
(
file
)
return
_
switch
File
(
file
)
if
(
file
)
return
_
open
File
(
file
)
else
{
var
browserProvider
=
this
.
_deps
.
filesProviders
[
'browser'
]
browserProvider
.
resolveDirectory
(
'browser'
,
(
error
,
filesProvider
)
=>
{
if
(
error
)
console
.
error
(
error
)
var
fileList
=
Object
.
keys
(
filesProvider
)
if
(
fileList
.
length
)
{
_
switch
File
(
browserProvider
.
type
+
'/'
+
fileList
[
0
])
_
open
File
(
browserProvider
.
type
+
'/'
+
fileList
[
0
])
}
else
{
// TODO: Only keep `this.emit` (issue#2210)
this
.
emit
(
'noFileSelected'
)
...
...
test-browser/commands/
switch
File.js
→
test-browser/commands/
open
File.js
View file @
2cf7ed50
const
EventEmitter
=
require
(
'events'
)
class
Switch
File
extends
EventEmitter
{
class
Open
File
extends
EventEmitter
{
command
(
name
)
{
this
.
api
.
perform
((
done
)
=>
{
switch
File
(
this
.
api
,
name
,
()
=>
{
open
File
(
this
.
api
,
name
,
()
=>
{
done
()
this
.
emit
(
'complete'
)
})
...
...
@@ -13,7 +13,7 @@ class SwitchFile extends EventEmitter {
}
// click on fileExplorer can toggle it. We go through settings to be sure FE is open
function
switch
File
(
browser
,
name
,
done
)
{
function
open
File
(
browser
,
name
,
done
)
{
browser
.
clickLaunchIcon
(
'settings'
).
clickLaunchIcon
(
'fileExplorers'
)
.
waitForElementVisible
(
'li[key="'
+
name
+
'"]'
)
.
click
(
'li[key="'
+
name
+
'"]'
)
...
...
@@ -23,4 +23,4 @@ function switchFile (browser, name, done) {
})
}
module
.
exports
=
Switch
File
module
.
exports
=
Open
File
test-browser/tests/defaultLayout.test.js
View file @
2cf7ed50
...
...
@@ -66,7 +66,7 @@ module.exports = {
'Switch Tabs using tabs icon'
:
function
(
browser
)
{
browser
.
waitForElementVisible
(
'div[data-id="filePanelFileExplorerTree"]'
)
.
switch
File
(
'browser/3_Ballot.sol'
)
.
open
File
(
'browser/3_Ballot.sol'
)
.
assert
.
containsText
(
'div[title="browser/3_Ballot.sol"]'
,
'3_Ballot.sol'
)
.
click
(
'span[class^=dropdownCaret]'
)
.
click
(
'#homeItem'
)
...
...
test-browser/tests/editor.test.js
View file @
2cf7ed50
...
...
@@ -10,7 +10,7 @@ module.exports = {
'Should zoom in editor'
:
function
(
browser
)
{
browser
.
waitForElementVisible
(
'div[data-id="mainPanelPluginsContainer"]'
)
.
switch
File
(
'browser/1_Storage.sol'
)
.
open
File
(
'browser/1_Storage.sol'
)
.
waitForElementVisible
(
'*[data-id="editorInput"]'
)
.
checkElementStyle
(
'*[data-id="editorInput"]'
,
'font-size'
,
'12px'
)
.
click
(
'*[data-id="tabProxyZoomIn"]'
)
...
...
@@ -74,7 +74,7 @@ module.exports = {
'Should highlight source code'
:
function
(
browser
)
{
browser
.
addFile
(
'sourcehighlight.js'
,
sourcehighlightScript
)
.
switch
File
(
'browser/sourcehighlight.js'
)
.
open
File
(
'browser/sourcehighlight.js'
)
.
executeScript
(
'remix.exeCurrent()'
)
.
editorScroll
(
'down'
,
60
)
.
waitForElementPresent
(
'.highlightLine32'
)
...
...
@@ -87,9 +87,9 @@ module.exports = {
'Should remove 1 highlight from source code'
:
function
(
browser
)
{
browser
.
addFile
(
'removeSourcehighlightScript.js'
,
removeSourcehighlightScript
)
.
switch
File
(
'browser/removeSourcehighlightScript.js'
)
.
open
File
(
'browser/removeSourcehighlightScript.js'
)
.
executeScript
(
'remix.exeCurrent()'
)
.
switch
File
(
'browser/3_Ballot.sol'
)
.
open
File
(
'browser/3_Ballot.sol'
)
.
editorScroll
(
'down'
,
60
)
.
waitForElementNotPresent
(
'.highlightLine32'
)
.
checkElementStyle
(
'.highlightLine40'
,
'background-color'
,
'rgb(8, 108, 181)'
)
...
...
@@ -98,9 +98,9 @@ module.exports = {
'Should remove all highlights from source code'
:
function
(
browser
)
{
browser
.
addFile
(
'removeAllSourcehighlightScript.js'
,
removeAllSourcehighlightScript
)
.
switch
File
(
'browser/removeAllSourcehighlightScript.js'
)
.
open
File
(
'browser/removeAllSourcehighlightScript.js'
)
.
executeScript
(
'remix.exeCurrent()'
)
.
switch
File
(
'browser/3_Ballot.sol'
)
.
open
File
(
'browser/3_Ballot.sol'
)
.
editorScroll
(
'down'
,
60
)
.
waitForElementNotPresent
(
'.highlightLine32'
)
.
waitForElementNotPresent
(
'.highlightLine40'
)
...
...
test-browser/tests/generalSettings.test.js
View file @
2cf7ed50
...
...
@@ -31,14 +31,14 @@ module.exports = {
.
waitForElementVisible
(
'*[data-id="settingsTabGenerateContractMetadata"]'
,
5000
)
.
click
(
'*[data-id="settingsTabGenerateContractMetadata"]'
)
.
click
(
'*[data-id="verticalIconsFileExplorerIcons"]'
)
.
switch
File
(
'browser/3_Ballot.sol'
)
.
open
File
(
'browser/3_Ballot.sol'
)
.
click
(
'*[data-id="verticalIconsKindsolidity"]'
)
.
pause
(
2000
)
.
click
(
'*[data-id="compilerContainerCompileBtn"]'
)
.
pause
(
3000
)
.
click
(
'*[data-id="verticalIconsKindfileExplorers"]'
)
.
switch
File
(
'browser/artifacts'
)
.
switch
File
(
'browser/artifacts/Ballot.json'
)
.
open
File
(
'browser/artifacts'
)
.
open
File
(
'browser/artifacts/Ballot.json'
)
},
'Should add new github access token'
:
function
(
browser
)
{
...
...
test-browser/tests/gist.test.js
View file @
2cf7ed50
...
...
@@ -44,9 +44,9 @@ module.exports = {
browser
.
modalFooterCancelClick
()
.
executeScript
(
`remix.loadgist('
${
gistid
}
')`
)
.
perform
((
done
)
=>
{
if
(
runtimeBrowser
===
'chrome'
)
{
browser
.
switch
File
(
'browser/gists'
)
}
done
()
})
.
switch
File
(
`browser/gists/
${
gistid
}
`
)
.
switch
File
(
`browser/gists/
${
gistid
}
/1_Storage.sol`
)
.
perform
((
done
)
=>
{
if
(
runtimeBrowser
===
'chrome'
)
{
browser
.
open
File
(
'browser/gists'
)
}
done
()
})
.
open
File
(
`browser/gists/
${
gistid
}
`
)
.
open
File
(
`browser/gists/
${
gistid
}
/1_Storage.sol`
)
.
perform
(
done
)
}
})
...
...
@@ -86,8 +86,8 @@ module.exports = {
.
waitForElementVisible
(
'*[data-id="modalDialogCustomPromptText"]'
)
.
setValue
(
'*[data-id="modalDialogCustomPromptText"]'
,
testData
.
validGistId
)
.
modalFooterOKClick
()
.
switch
File
(
`browser/gists/
${
testData
.
validGistId
}
`
)
.
switch
File
(
`browser/gists/
${
testData
.
validGistId
}
/ApplicationRegistry`
)
.
open
File
(
`browser/gists/
${
testData
.
validGistId
}
`
)
.
open
File
(
`browser/gists/
${
testData
.
validGistId
}
/ApplicationRegistry`
)
.
waitForElementVisible
(
`div[title='browser/gists/
${
testData
.
validGistId
}
/ApplicationRegistry']`
)
.
assert
.
containsText
(
`div[title='browser/gists/
${
testData
.
validGistId
}
/ApplicationRegistry'] > span`
,
'ApplicationRegistry'
)
.
end
()
...
...
test-browser/tests/libraryDeployment.test.js
View file @
2cf7ed50
...
...
@@ -59,7 +59,7 @@ module.exports = {
function
checkDeployShouldFail
(
browser
,
callback
)
{
let
config
browser
.
switchFile
(
'browser/artifacts'
).
switch
File
(
'browser/artifacts/test.json'
)
browser
.
openFile
(
'browser/artifacts'
).
open
File
(
'browser/artifacts/test.json'
)
.
getEditorValue
((
content
)
=>
{
config
=
JSON
.
parse
(
content
)
config
.
deploy
[
'VM:-'
].
autoDeployLib
=
false
...
...
@@ -67,7 +67,7 @@ function checkDeployShouldFail (browser, callback) {
.
perform
(()
=>
{
browser
.
setEditorValue
(
JSON
.
stringify
(
config
))
})
.
switch
File
(
'browser/Untitled5.sol'
)
.
open
File
(
'browser/Untitled5.sol'
)
.
selectContract
(
'test'
)
// deploy lib
.
createContract
(
''
)
.
assert
.
containsText
(
'div[class^="terminal"]'
,
'<address> is not a valid address'
)
...
...
@@ -77,7 +77,7 @@ function checkDeployShouldFail (browser, callback) {
function
checkDeployShouldSucceed
(
browser
,
address
,
callback
)
{
let
addressRef
let
config
browser
.
switchFile
(
'browser/artifacts'
).
switch
File
(
'browser/artifacts/test.json'
)
browser
.
openFile
(
'browser/artifacts'
).
open
File
(
'browser/artifacts/test.json'
)
.
getEditorValue
((
content
)
=>
{
config
=
JSON
.
parse
(
content
)
config
.
deploy
[
'VM:-'
].
autoDeployLib
=
false
...
...
@@ -86,7 +86,7 @@ function checkDeployShouldSucceed (browser, address, callback) {
.
perform
(()
=>
{
browser
.
setEditorValue
(
JSON
.
stringify
(
config
))
})
.
switch
File
(
'browser/Untitled5.sol'
)
.
open
File
(
'browser/Untitled5.sol'
)
.
selectContract
(
'test'
)
// deploy lib
.
createContract
(
''
)
.
getAddressAtPosition
(
1
,
(
address
)
=>
{
...
...
test-browser/tests/pluginManager.test.js
View file @
2cf7ed50
...
...
@@ -66,7 +66,7 @@ module.exports = {
.assert.containsText('*[data-id="pluginManagerSettingsPermissionForm"]', 'No Permission requested yet')
.modalFooterOKClick()
.click('*[data-id="verticalIconsFileExplorerIcons"]')
.
switch
File('browser/3_Ballot.sol')
.
open
File('browser/3_Ballot.sol')
.click('*[plugin="ZoKrates"]')
.pause(5000)
.frame(0)
...
...
test-browser/tests/publishContract.test.js
View file @
2cf7ed50
...
...
@@ -13,7 +13,7 @@ module.exports = {
browser
.
waitForElementVisible
(
'#icon-panel'
,
10000
)
.
clickLaunchIcon
(
'fileExplorers'
)
.
switch
File
(
'browser/3_Ballot.sol'
)
.
open
File
(
'browser/3_Ballot.sol'
)
.
verifyContracts
([
'Ballot'
])
.
click
(
'#publishOnIpfs'
)
.
getModalBody
((
value
,
done
)
=>
{
...
...
@@ -37,7 +37,7 @@ module.exports = {
browser
.
waitForElementVisible
(
'#icon-panel'
)
.
clickLaunchIcon
(
'fileExplorers'
)
.
switch
File
(
'browser/1_Storage.sol'
)
.
open
File
(
'browser/1_Storage.sol'
)
.
clickLaunchIcon
(
'udapp'
)
.
waitForElementVisible
(
'*[data-id="contractDropdownIpfsCheckbox"]'
)
.
click
(
'*[data-id="contractDropdownIpfsCheckbox"]'
)
...
...
@@ -49,7 +49,7 @@ module.exports = {
'Should remember choice after page refresh'
:
function
(
browser
)
{
browser
.
refresh
()
.
switch
File
(
'browser/1_Storage.sol'
)
.
open
File
(
'browser/1_Storage.sol'
)
.
clickLaunchIcon
(
'udapp'
)
.
waitForElementVisible
(
'*[data-id="contractDropdownIpfsCheckbox"]'
)
.
verify
.
elementPresent
(
'*[data-id="contractDropdownIpfsCheckbox"]:checked'
)
...
...
test-browser/tests/runAndDeploy.js
View file @
2cf7ed50
...
...
@@ -90,7 +90,7 @@ module.exports = {
'Should deploy contract on Goerli Test Network using MetaMask'
:
function
(
browser
)
{
browser
.
waitForElementPresent
(
'*[data-id="runTabSelectAccount"] option'
)
.
clickLaunchIcon
(
'fileExplorers'
)
.
switch
File
(
'browser/Greet.sol'
)
.
open
File
(
'browser/Greet.sol'
)
.
clickLaunchIcon
(
'udapp'
)
.
waitForElementPresent
(
'*[data-id="Deploy - transact (not payable)"]'
)
.
click
(
'*[data-id="Deploy - transact (not payable)"]'
)
...
...
@@ -141,7 +141,7 @@ module.exports = {
'Should deploy contract on Ethereum Main Network using MetaMask'
:
function
(
browser
)
{
browser
.
waitForElementPresent
(
'*[data-id="runTabSelectAccount"] option'
)
.
clickLaunchIcon
(
'fileExplorers'
)
.
switch
File
(
'browser/Greet.sol'
)
.
open
File
(
'browser/Greet.sol'
)
.
clickLaunchIcon
(
'udapp'
)
.
waitForElementPresent
(
'*[data-id="Deploy - transact (not payable)"]'
)
.
click
(
'*[data-id="Deploy - transact (not payable)"]'
)
...
...
test-browser/tests/signingMessage.test.js
View file @
2cf7ed50
...
...
@@ -23,7 +23,7 @@ module.exports = {
browser
.
assert
.
ok
(
typeof
signature
.
value
===
'string'
,
'type of signature.value must be String'
)
})
.
addFile
(
'signMassage.sol'
,
sources
[
0
][
'browser/signMassage.sol'
])
.
switch
File
(
'browser/signMassage.sol'
)
.
open
File
(
'browser/signMassage.sol'
)
.
pause
(
5000
)
.
selectContract
(
'ECVerify'
)
.
createContract
(
''
)
...
...
test-browser/tests/solidityImport.test.js
View file @
2cf7ed50
...
...
@@ -15,7 +15,7 @@ module.exports = {
'Test Success Import'
:
function
(
browser
)
{
browser
.
addFile
(
'Untitled1.sol'
,
sources
[
1
][
'browser/Untitled1.sol'
])
.
addFile
(
'Untitled2.sol'
,
sources
[
1
][
'browser/Untitled2.sol'
])
.
switch
File
(
'browser/Untitled1.sol'
)
.
open
File
(
'browser/Untitled1.sol'
)
.
verifyContracts
([
'test6'
,
'test4'
,
'test5'
])
},
...
...
test-browser/tests/solidityUnittests.test.js
View file @
2cf7ed50
...
...
@@ -27,7 +27,7 @@ module.exports = {
'Should generate test file'
:
function
(
browser
)
{
browser
.
waitForElementPresent
(
'*[data-id="verticalIconsKindfileExplorers"]'
)
.
clickLaunchIcon
(
'fileExplorers'
)
.
switch
File
(
'browser/simple_storage.sol'
)
.
open
File
(
'browser/simple_storage.sol'
)
.
click
(
'*[data-id="verticalIconsKindsolidityUnitTesting"]'
)
.
waitForElementPresent
(
'*[data-id="testTabGenerateTestFile"]'
)
.
click
(
'*[data-id="testTabGenerateTestFile"]'
)
...
...
@@ -100,7 +100,7 @@ module.exports = {
browser
.
waitForElementPresent
(
'*[data-id="verticalIconsKindfileExplorers"]'
)
.
addFile
(
'compilationError_test.sol'
,
sources
[
0
][
'browser/compilationError_test.sol'
])
.
clickLaunchIcon
(
'fileExplorers'
)
.
switch
File
(
'browser/compilationError_test.sol'
)
.
open
File
(
'browser/compilationError_test.sol'
)
.
clickLaunchIcon
(
'solidityUnitTesting'
)
.
click
(
'*[data-id="testTabCheckAllTests"]'
)
.
clickElementAtPosition
(
'.singleTestLabel'
,
3
)
...
...
@@ -115,7 +115,7 @@ module.exports = {
browser
.
waitForElementPresent
(
'*[data-id="verticalIconsKindfileExplorers"]'
)
.
addFile
(
'deployError_test.sol'
,
sources
[
0
][
'browser/deployError_test.sol'
])
.
clickLaunchIcon
(
'fileExplorers'
)
.
switch
File
(
'browser/deployError_test.sol'
)
.
open
File
(
'browser/deployError_test.sol'
)
.
clickLaunchIcon
(
'solidityUnitTesting'
)
.
click
(
'*[data-id="testTabCheckAllTests"]'
)
.
clickElementAtPosition
(
'.singleTestLabel'
,
4
)
...
...
@@ -129,7 +129,7 @@ module.exports = {
browser
.
waitForElementPresent
(
'*[data-id="verticalIconsKindfileExplorers"]'
)
.
addFile
(
'methodFailure_test.sol'
,
sources
[
0
][
'browser/methodFailure_test.sol'
])
.
clickLaunchIcon
(
'fileExplorers'
)
.
switch
File
(
'browser/methodFailure_test.sol'
)
.
open
File
(
'browser/methodFailure_test.sol'
)
.
clickLaunchIcon
(
'solidityUnitTesting'
)
.
click
(
'*[data-id="testTabCheckAllTests"]'
)
.
clickElementAtPosition
(
'.singleTestLabel'
,
5
)
...
...
@@ -150,7 +150,7 @@ function runTests (browser) {
browser
.
waitForElementPresent
(
'*[data-id="verticalIconsKindfileExplorers"]'
)
.
clickLaunchIcon
(
'fileExplorers'
)
.
switch
File
(
'browser/3_Ballot.sol'
)
.
open
File
(
'browser/3_Ballot.sol'
)
.
clickLaunchIcon
(
'solidityUnitTesting'
)
.
pause
(
500
)
.
scrollAndClick
(
'#runTestsTabRunAction'
)
...
...
test-browser/tests/terminal.test.js
View file @
2cf7ed50
...
...
@@ -57,7 +57,7 @@ module.exports = {
'Async/Await Script'
:
function
(
browser
)
{
browser
.
addFile
(
'asyncAwait.js'
,
{
content
:
asyncAwait
})
.
switch
File
(
'browser/asyncAwait.js'
)
.
open
File
(
'browser/asyncAwait.js'
)
.
executeScript
(
`remix.execute('browser/asyncAwait.js')`
)
.
journalLastChild
(
'Waiting Promise'
)
.
pause
(
5500
)
...
...
@@ -67,7 +67,7 @@ module.exports = {
'Call Remix File Manager from a script'
:
function
(
browser
)
{
browser
.
addFile
(
'asyncAwaitWithFileManagerAccess.js'
,
{
content
:
asyncAwaitWithFileManagerAccess
})
.
switch
File
(
'browser/asyncAwaitWithFileManagerAccess.js'
)
.
open
File
(
'browser/asyncAwaitWithFileManagerAccess.js'
)
.
pause
(
5000
)
.
executeScript
(
`remix.execute('browser/asyncAwaitWithFileManagerAccess.js')`
)
.
pause
(
6000
)
...
...
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