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
316bc222
Commit
316bc222
authored
Oct 19, 2021
by
bunsenstraat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more tests
parent
9b4f7552
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
1 deletion
+23
-1
plugin_api.ts
apps/remix-ide-e2e/src/tests/plugin_api.ts
+23
-1
No files found.
apps/remix-ide-e2e/src/tests/plugin_api.ts
View file @
316bc222
'use strict'
'use strict'
import
{
ExternalProfile
,
LocationProfile
,
Profile
}
from
'@remixproject/plugin-utils'
import
{
ExternalProfile
,
LocationProfile
,
Profile
}
from
'@remixproject/plugin-utils'
import
{
NightwatchBrowser
}
from
'nightwatch'
import
{
NightwatchBrowser
}
from
'nightwatch'
import
{
resolve
}
from
'url'
import
init
from
'../helpers/init'
import
init
from
'../helpers/init'
declare
global
{
declare
global
{
...
@@ -79,6 +80,14 @@ const checkForAcceptAndRemember = async function (browser: NightwatchBrowser) {
...
@@ -79,6 +80,14 @@ const checkForAcceptAndRemember = async function (browser: NightwatchBrowser) {
})
})
}
}
const
setAppend
=
async
(
browser
:
NightwatchBrowser
)
=>
{
return
new
Promise
((
resolve
)
=>
{
browser
.
waitForElementVisible
(
'//*[@id="appendToLog"]'
).
click
(
'//*[@id="appendToLog"]'
,
()
=>
{
resolve
(
true
)
})
})
}
const
clickAndCheckLog
=
async
(
browser
:
NightwatchBrowser
,
buttonText
:
string
,
methodResult
:
any
,
eventResult
:
any
,
payload
:
any
)
=>
{
const
clickAndCheckLog
=
async
(
browser
:
NightwatchBrowser
,
buttonText
:
string
,
methodResult
:
any
,
eventResult
:
any
,
payload
:
any
)
=>
{
if
(
payload
)
{
if
(
payload
)
{
await
setPayload
(
browser
,
payload
)
await
setPayload
(
browser
,
payload
)
...
@@ -109,12 +118,13 @@ module.exports = {
...
@@ -109,12 +118,13 @@ module.exports = {
'Should connect a local plugin'
:
function
(
browser
:
NightwatchBrowser
)
{
'Should connect a local plugin'
:
function
(
browser
:
NightwatchBrowser
)
{
browser
.
addLocalPlugin
(
localPluginData
)
browser
.
addLocalPlugin
(
localPluginData
)
// @ts-ignore
// @ts-ignore
.
frame
(
0
)
.
frame
(
0
)
.
useXpath
()
},
},
// FILESYSTEM
// FILESYSTEM
'Should get current workspace'
:
async
function
(
browser
:
NightwatchBrowser
)
{
'Should get current workspace'
:
async
function
(
browser
:
NightwatchBrowser
)
{
await
browser
.
pause
(
20000
)
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
)
},
},
...
@@ -170,6 +180,14 @@ module.exports = {
...
@@ -170,6 +180,14 @@ module.exports = {
await
clickAndCheckLog
(
browser
,
'filePanel:getCurrentWorkspace'
,
{
name
:
'testspace'
,
isLocalhost
:
false
,
absolutePath
:
'.workspaces/testspace'
},
null
,
null
)
await
clickAndCheckLog
(
browser
,
'filePanel:getCurrentWorkspace'
,
{
name
:
'testspace'
,
isLocalhost
:
false
,
absolutePath
:
'.workspaces/testspace'
},
null
,
null
)
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
,
null
)
},
},
'Should get all workspaces'
:
async
function
(
browser
:
NightwatchBrowser
)
{
await
clickAndCheckLog
(
browser
,
'filePanel:getWorkspaces'
,
[
'default_workspace'
,
'emptyworkspace'
,
'testspace'
],
null
,
null
)
},
'Should have set workspace event'
:
async
function
(
browser
:
NightwatchBrowser
)
{
await
setAppend
(
browser
)
await
clickAndCheckLog
(
browser
,
'filePanel:createWorkspace'
,
null
,
{
event
:
'setWorkspace'
,
args
:
[{
name
:
'newspace'
,
isLocalhost
:
false
}]
},
'newspace'
)
await
setAppend
(
browser
)
},
// COMPILER
// COMPILER
...
@@ -205,5 +223,9 @@ module.exports = {
...
@@ -205,5 +223,9 @@ module.exports = {
assertPluginIsActive
(
browser
,
'solidityUnitTesting'
)
assertPluginIsActive
(
browser
,
'solidityUnitTesting'
)
// @ts-ignore
// @ts-ignore
browser
.
frame
(
0
)
browser
.
frame
(
0
)
},
'Should test from path with solidityUnitTesting'
:
async
function
(
browser
:
NightwatchBrowser
)
{
await
clickAndCheckLog
(
browser
,
'solidityUnitTesting:testFromPath'
,
'"totalPassing":2,"totalFailing":0'
,
null
,
'tests/4_Ballot_test.sol'
)
}
}
}
}
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