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
1f7b7417
Commit
1f7b7417
authored
Oct 23, 2021
by
bunsenstraat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
context test
parent
fa670bd7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
2 deletions
+36
-2
Client.ts
apps/remix-ide-e2e/src/local-plugin/src/app/Client.ts
+5
-0
app.tsx
apps/remix-ide-e2e/src/local-plugin/src/app/app.tsx
+6
-0
plugin_api.ts
apps/remix-ide-e2e/src/tests/plugin_api.ts
+25
-2
No files found.
apps/remix-ide-e2e/src/local-plugin/src/app/Client.ts
View file @
1f7b7417
...
...
@@ -3,6 +3,11 @@ import { createClient } from '@remixproject/plugin-webview'
export
class
RemixPlugin
extends
PluginClient
{
constructor
()
{
super
()
this
.
methods
=
[
'testCommand'
]
createClient
(
this
)
}
async
testCommand
(
data
:
any
)
{
}
}
apps/remix-ide-e2e/src/local-plugin/src/app/app.tsx
View file @
1f7b7417
...
...
@@ -36,6 +36,11 @@ function App () {
client
.
onload
(
async
()
=>
{
const
customProfiles
=
[
'menuicons'
,
'tabs'
,
'solidityUnitTesting'
]
client
.
testCommand
=
async
(
data
:
any
)
=>
{
console
.
log
(
data
)
setLog
(
data
)
}
let
addProfiles
=
[]
for
(
const
name
of
customProfiles
)
{
const
p
=
await
client
.
call
(
'manager'
,
'getProfile'
,
name
)
...
...
@@ -72,6 +77,7 @@ function App () {
}
catch
(
e
)
{
}
const
args
=
ob
||
[
payload
]
console
.
log
(
'calling :'
,
profile
.
name
,
method
,
...
args
)
await
client
.
call
(
'manager'
,
'activatePlugin'
,
profile
.
name
)
const
result
=
await
client
.
call
(
profile
.
name
as
any
,
method
,
...
args
)
console
.
log
(
'result :'
,
result
)
setLog
(
result
)
...
...
apps/remix-ide-e2e/src/tests/plugin_api.ts
View file @
1f7b7417
...
...
@@ -93,8 +93,10 @@ const clickAndCheckLog = async (browser: NightwatchBrowser, buttonText: string,
}
if
(
methodResult
&&
typeof
methodResult
!==
'string'
)
{
methodResult
=
JSON
.
stringify
(
methodResult
)
}
if
(
eventResult
&&
typeof
eventResult
!==
'string'
)
{
eventResult
=
JSON
.
stringify
(
eventResult
)
}
await
clickButton
(
browser
,
buttonText
)
await
checkForAcceptAndRemember
(
browser
)
if
(
buttonText
)
{
await
clickButton
(
browser
,
buttonText
)
await
checkForAcceptAndRemember
(
browser
)
}
await
debugValues
(
browser
,
'methods'
,
methodResult
)
await
debugValues
(
browser
,
'events'
,
eventResult
)
}
...
...
@@ -122,6 +124,25 @@ module.exports = {
// FILESYSTEM
'Should create context menu item'
:
async
function
(
browser
:
NightwatchBrowser
)
{
await
clickAndCheckLog
(
browser
,
'filePanel:registerContextMenuItem'
,
null
,
null
,
{
id
:
'localPlugin'
,
name
:
'testCommand'
,
label
:
'testCommand'
,
type
:
[],
extension
:
[
'.sol'
],
path
:
[],
pattern
:
[]
})
await
browser
.
useXpath
().
frameParent
(
async
()
=>
{
await
clickButton
(
browser
,
'verticalIconsFileExplorerIcons'
)
// await clickButton(browser, 'treeViewLitreeViewItemcontracts')
browser
.
rightClick
(
'*[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]'
).
waitForElementVisible
(
'//*[@id="menuitemtestcommand"]'
).
click
(
'//*[@id="menuitemtestcommand"]'
,
async
()
=>
{
await
clickAndCheckLog
(
browser
,
null
,
{
id
:
'localPlugin'
,
name
:
'testCommand'
,
label
:
'testCommand'
,
type
:
[],
extension
:
[
'.sol'
],
path
:
[
'contracts/1_Storage.sol'
],
pattern
:
[]
},
null
,
null
)
})
})
},
'Should get current workspace'
:
async
function
(
browser
:
NightwatchBrowser
)
{
await
clickAndCheckLog
(
browser
,
'filePanel:getCurrentWorkspace'
,
{
name
:
'default_workspace'
,
isLocalhost
:
false
,
absolutePath
:
'.workspaces/default_workspace'
},
null
,
null
)
},
...
...
@@ -224,6 +245,8 @@ module.exports = {
await
clickAndCheckLog
(
browser
,
'dGitProvider:log'
,
'commit-message'
,
null
,
null
)
},
// context menu
// UNIT TESTING
'Should activate solidityUnitTesting'
:
async
function
(
browser
:
NightwatchBrowser
)
{
await
clickAndCheckLog
(
browser
,
'manager:activatePlugin'
,
null
,
null
,
'solidityUnitTesting'
)
...
...
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