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
d6769dff
Commit
d6769dff
authored
Oct 25, 2021
by
bunsenstraat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
speed up tests
parent
93663705
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
12 deletions
+32
-12
app.tsx
apps/remix-ide-e2e/src/local-plugin/src/app/app.tsx
+4
-0
plugin_api.ts
apps/remix-ide-e2e/src/tests/plugin_api.ts
+27
-11
file-panel.js
apps/remix-ide/src/app/panels/file-panel.js
+1
-1
No files found.
apps/remix-ide-e2e/src/local-plugin/src/app/app.tsx
View file @
d6769dff
...
@@ -25,6 +25,7 @@ function App () {
...
@@ -25,6 +25,7 @@ function App () {
const
[
payload
,
setPayload
]
=
useState
<
string
>
(
''
)
const
[
payload
,
setPayload
]
=
useState
<
string
>
(
''
)
const
[
append
,
setAppend
]
=
useState
<
boolean
>
(
false
)
const
[
append
,
setAppend
]
=
useState
<
boolean
>
(
false
)
const
[
log
,
setLog
]
=
useState
<
any
>
()
const
[
log
,
setLog
]
=
useState
<
any
>
()
const
[
started
,
setStarted
]
=
useState
<
boolean
>
(
false
)
const
[
events
,
setEvents
]
=
useState
<
any
>
()
const
[
events
,
setEvents
]
=
useState
<
any
>
()
const
[
profiles
,
setProfiles
]
=
useState
<
Profile
[]
>
([
pluginManagerProfile
,
filePanelProfile
,
filSystemProfile
,
dGitProfile
,
networkProfile
,
settingsProfile
,
editorProfile
,
terminalProfile
,
compilerProfile
,
udappProfile
,
contentImportProfile
,
windowProfile
])
const
[
profiles
,
setProfiles
]
=
useState
<
Profile
[]
>
([
pluginManagerProfile
,
filePanelProfile
,
filSystemProfile
,
dGitProfile
,
networkProfile
,
settingsProfile
,
editorProfile
,
terminalProfile
,
compilerProfile
,
udappProfile
,
contentImportProfile
,
windowProfile
])
...
@@ -76,6 +77,7 @@ function App () {
...
@@ -76,6 +77,7 @@ function App () {
if
(
ob
&&
!
Array
.
isArray
(
ob
))
{
ob
=
[
ob
]
}
if
(
ob
&&
!
Array
.
isArray
(
ob
))
{
ob
=
[
ob
]
}
}
catch
(
e
)
{
}
}
catch
(
e
)
{
}
const
args
=
ob
||
[
payload
]
const
args
=
ob
||
[
payload
]
setStarted
(
true
)
console
.
log
(
'calling :'
,
profile
.
name
,
method
,
...
args
)
console
.
log
(
'calling :'
,
profile
.
name
,
method
,
...
args
)
await
client
.
call
(
'manager'
,
'activatePlugin'
,
profile
.
name
)
await
client
.
call
(
'manager'
,
'activatePlugin'
,
profile
.
name
)
const
result
=
await
client
.
call
(
profile
.
name
as
any
,
method
,
...
args
)
const
result
=
await
client
.
call
(
profile
.
name
as
any
,
method
,
...
args
)
...
@@ -84,11 +86,13 @@ function App () {
...
@@ -84,11 +86,13 @@ function App () {
}
catch
(
e
)
{
}
catch
(
e
)
{
setLog
(
e
.
message
)
setLog
(
e
.
message
)
}
}
setStarted
(
false
)
}
}
return
(
return
(
<
div
className=
"App container-fluid"
>
<
div
className=
"App container-fluid"
>
<
h5
>
PLUGIN API TESTER
</
h5
>
<
h5
>
PLUGIN API TESTER
</
h5
>
<
label
id=
'callStatus'
>
{
started
?
<>
start
</>
:
<>
stop
</>
}
</
label
><
br
></
br
>
<
label
>
method results
</
label
>
<
label
>
method results
</
label
>
<
Logger
id=
'methods'
log=
{
log
}
append=
{
append
}
></
Logger
>
<
Logger
id=
'methods'
log=
{
log
}
append=
{
append
}
></
Logger
>
<
label
>
events
</
label
>
<
label
>
events
</
label
>
...
...
apps/remix-ide-e2e/src/tests/plugin_api.ts
View file @
d6769dff
...
@@ -57,9 +57,11 @@ const setPayload = async (browser: NightwatchBrowser, payload: any) => {
...
@@ -57,9 +57,11 @@ const setPayload = async (browser: NightwatchBrowser, payload: any) => {
const
clickButton
=
async
(
browser
:
NightwatchBrowser
,
buttonText
:
string
)
=>
{
const
clickButton
=
async
(
browser
:
NightwatchBrowser
,
buttonText
:
string
)
=>
{
return
new
Promise
((
resolve
)
=>
{
return
new
Promise
((
resolve
)
=>
{
browser
.
useXpath
().
waitForElementVisible
(
`//*[@data-id='
${
buttonText
}
']`
)
browser
.
useXpath
().
waitForElementVisible
(
`//*[@data-id='
${
buttonText
}
']`
).
pause
(
100
)
.
click
(
`//*[@data-id='
${
buttonText
}
']`
)
.
click
(
`//*[@data-id='
${
buttonText
}
']`
,
async
()
=>
{
.
pause
(
5000
,
()
=>
resolve
(
true
))
await
checkForAcceptAndRemember
(
browser
)
browser
.
waitForElementContainsText
(
'//*[@id="callStatus"]'
,
'stop'
).
perform
(()
=>
resolve
(
true
))
})
})
})
}
}
...
@@ -95,7 +97,6 @@ const clickAndCheckLog = async (browser: NightwatchBrowser, buttonText: string,
...
@@ -95,7 +97,6 @@ const clickAndCheckLog = async (browser: NightwatchBrowser, buttonText: string,
if
(
eventResult
&&
typeof
eventResult
!==
'string'
)
{
eventResult
=
JSON
.
stringify
(
eventResult
)
}
if
(
eventResult
&&
typeof
eventResult
!==
'string'
)
{
eventResult
=
JSON
.
stringify
(
eventResult
)
}
if
(
buttonText
)
{
if
(
buttonText
)
{
await
clickButton
(
browser
,
buttonText
)
await
clickButton
(
browser
,
buttonText
)
await
checkForAcceptAndRemember
(
browser
)
}
}
await
debugValues
(
browser
,
'methods'
,
methodResult
)
await
debugValues
(
browser
,
'methods'
,
methodResult
)
await
debugValues
(
browser
,
'events'
,
eventResult
)
await
debugValues
(
browser
,
'events'
,
eventResult
)
...
@@ -122,7 +123,7 @@ module.exports = {
...
@@ -122,7 +123,7 @@ module.exports = {
.
frame
(
0
).
useXpath
()
.
frame
(
0
).
useXpath
()
},
},
//
FILESYSTEM
//
context menu item
'Should create context menu item'
:
async
function
(
browser
:
NightwatchBrowser
)
{
'Should create context menu item'
:
async
function
(
browser
:
NightwatchBrowser
)
{
await
clickAndCheckLog
(
browser
,
'filePanel:registerContextMenuItem'
,
null
,
null
,
{
await
clickAndCheckLog
(
browser
,
'filePanel:registerContextMenuItem'
,
null
,
null
,
{
...
@@ -135,20 +136,24 @@ module.exports = {
...
@@ -135,20 +136,24 @@ module.exports = {
pattern
:
[]
pattern
:
[]
})
})
await
browser
.
useXpath
().
frameParent
(
async
()
=>
{
await
browser
.
useXpath
().
frameParent
(
async
()
=>
{
await
clickButton
(
browser
,
'verticalIconsFileExplorerIcons'
)
browser
.
useCss
().
clickLaunchIcon
(
'filePanel'
)
// await clickButton(browser, 'treeViewLitreeViewItemcontracts')
.
rightClick
(
'[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]'
).
useXpath
().
waitForElementVisible
(
'//*[@id="menuitemtestcommand"]'
).
click
(
'//*[@id="menuitemtestcommand"]'
,
async
()
=>
{
browser
.
rightClick
(
'*[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]'
).
waitForElementVisible
(
'//*[@id="menuitemtestcommand"]'
).
click
(
'//*[@id="menuitemtestcommand"]'
,
async
()
=>
{
// @ts-ignore
await
clickAndCheckLog
(
browser
,
null
,
{
id
:
'localPlugin'
,
name
:
'testCommand'
,
label
:
'testCommand'
,
type
:
[],
extension
:
[
'.sol'
],
path
:
[
'contracts/1_Storage.sol'
],
pattern
:
[]
},
null
,
null
)
browser
.
click
(
'//*[@data-id="verticalIconsKindlocalPlugin"]'
).
frame
(
0
,
async
()
=>
{
})
await
clickAndCheckLog
(
browser
,
null
,
{
id
:
'localPlugin'
,
name
:
'testCommand'
,
label
:
'testCommand'
,
type
:
[],
extension
:
[
'.sol'
],
path
:
[
'contracts/1_Storage.sol'
],
pattern
:
[]
},
null
,
null
)
})
})
})
})
},
},
// FILESYSTEM
'Should get current workspace'
:
async
function
(
browser
:
NightwatchBrowser
)
{
'Should get current workspace'
:
async
function
(
browser
:
NightwatchBrowser
)
{
await
clickAndCheckLog
(
browser
,
'filePanel:getCurrentWorkspace'
,
{
name
:
'default_workspace'
,
isLocalhost
:
false
,
absolutePath
:
'.workspaces/default_workspace'
},
null
,
null
)
await
clickAndCheckLog
(
browser
,
'filePanel:getCurrentWorkspace'
,
{
name
:
'default_workspace'
,
isLocalhost
:
false
,
absolutePath
:
'.workspaces/default_workspace'
},
null
,
null
)
},
},
'Should get current files'
:
async
function
(
browser
:
NightwatchBrowser
)
{
'Should get current files'
:
async
function
(
browser
:
NightwatchBrowser
)
{
await
clickAndCheckLog
(
browser
,
'fileManager:readdir'
,
{
contracts
:
{
isDirectory
:
true
},
scripts
:
{
isDirectory
:
true
},
tests
:
{
isDirectory
:
true
},
'README.txt'
:
{
isDirectory
:
false
}
},
null
,
null
)
await
clickAndCheckLog
(
browser
,
'fileManager:readdir'
,
{
contracts
:
{
isDirectory
:
true
},
scripts
:
{
isDirectory
:
true
},
tests
:
{
isDirectory
:
true
},
'README.txt'
:
{
isDirectory
:
false
}
},
null
,
'/'
)
},
},
'Should throw error on current file'
:
async
function
(
browser
:
NightwatchBrowser
)
{
'Should throw error on current file'
:
async
function
(
browser
:
NightwatchBrowser
)
{
await
clickAndCheckLog
(
browser
,
'fileManager:getCurrentFile'
,
'Error from IDE : Error: No such file or directory No file selected'
,
null
,
null
)
await
clickAndCheckLog
(
browser
,
'fileManager:getCurrentFile'
,
'Error from IDE : Error: No such file or directory No file selected'
,
null
,
null
)
...
@@ -217,11 +222,22 @@ module.exports = {
...
@@ -217,11 +222,22 @@ module.exports = {
await
clickAndCheckLog
(
browser
,
'filePanel:createWorkspace'
,
null
,
{
event
:
'setWorkspace'
,
args
:
[{
name
:
'newspace'
,
isLocalhost
:
false
}]
},
'newspace'
)
await
clickAndCheckLog
(
browser
,
'filePanel:createWorkspace'
,
null
,
{
event
:
'setWorkspace'
,
args
:
[{
name
:
'newspace'
,
isLocalhost
:
false
}]
},
'newspace'
)
await
setAppend
(
browser
)
await
setAppend
(
browser
)
},
},
'Should rename workspace'
:
async
function
(
browser
:
NightwatchBrowser
)
{
await
setAppend
(
browser
)
await
clickAndCheckLog
(
browser
,
'filePanel:renameWorkspace'
,
null
,
null
,
[
'default_workspace'
,
'renamed'
])
await
clickAndCheckLog
(
browser
,
'filePanel:getWorkspaces'
,
[
'emptyworkspace'
,
'testspace'
,
'newspace'
,
'renamed'
],
null
,
null
)
await
setAppend
(
browser
)
},
// COMPILER
// COMPILER
'Should compile a file'
:
async
function
(
browser
:
NightwatchBrowser
)
{
'Should compile a file'
:
async
function
(
browser
:
NightwatchBrowser
)
{
await
setAppend
(
browser
)
await
clickAndCheckLog
(
browser
,
'solidity:compile'
,
null
,
null
,
'contracts/1_Storage.sol'
)
await
clickAndCheckLog
(
browser
,
'solidity:compile'
,
null
,
null
,
'contracts/1_Storage.sol'
)
browser
.
pause
(
5000
,
async
()
=>
{
await
clickAndCheckLog
(
browser
,
'solidity:compile'
,
null
,
'compilationFinished'
,
null
)
await
setAppend
(
browser
)
})
},
},
'Should get compilationresults'
:
async
function
(
browser
:
NightwatchBrowser
)
{
'Should get compilationresults'
:
async
function
(
browser
:
NightwatchBrowser
)
{
...
...
apps/remix-ide/src/app/panels/file-panel.js
View file @
d6769dff
...
@@ -35,7 +35,7 @@ const modalDialogCustom = require('../ui/modal-dialog-custom')
...
@@ -35,7 +35,7 @@ const modalDialogCustom = require('../ui/modal-dialog-custom')
const
profile
=
{
const
profile
=
{
name
:
'filePanel'
,
name
:
'filePanel'
,
displayName
:
'File explorers'
,
displayName
:
'File explorers'
,
methods
:
[
'createNewFile'
,
'uploadFile'
,
'getCurrentWorkspace'
,
'getWorkspaces'
,
'createWorkspace'
,
'setWorkspace'
,
'registerContextMenuItem'
],
methods
:
[
'createNewFile'
,
'uploadFile'
,
'getCurrentWorkspace'
,
'getWorkspaces'
,
'createWorkspace'
,
'setWorkspace'
,
'registerContextMenuItem'
,
'renameWorkspace'
],
events
:
[
'setWorkspace'
,
'renameWorkspace'
,
'deleteWorkspace'
,
'createWorkspace'
],
events
:
[
'setWorkspace'
,
'renameWorkspace'
,
'deleteWorkspace'
,
'createWorkspace'
],
icon
:
'assets/img/fileManager.webp'
,
icon
:
'assets/img/fileManager.webp'
,
description
:
' - '
,
description
:
' - '
,
...
...
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