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
9ee285cb
Commit
9ee285cb
authored
Oct 16, 2021
by
bunsenstraat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
e2e
parent
d227e4bc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
10 deletions
+50
-10
Client.ts
apps/remix-ide-e2e/src/local-plugin/src/app/Client.ts
+16
-7
plugin_api.test.ts
apps/remix-ide-e2e/src/tests/plugin_api.test.ts
+32
-1
browser_tests_plugin_api.sh
apps/remix-ide/ci/browser_tests_plugin_api.sh
+1
-1
package.json
package.json
+1
-1
No files found.
apps/remix-ide-e2e/src/local-plugin/src/app/Client.ts
View file @
9ee285cb
...
@@ -310,7 +310,11 @@ export class WorkSpacePlugin extends PluginClient {
...
@@ -310,7 +310,11 @@ export class WorkSpacePlugin extends PluginClient {
}
}
async
write
(
dir
:
string
)
{
async
write
(
dir
:
string
)
{
this
.
call
(
'fileManager'
,
'setFile'
,
dir
,
simpleContract
)
try
{
this
.
call
(
'fileManager'
,
'setFile'
,
dir
,
'simple readme'
)
}
catch
(
e
)
{
this
.
setFeedback
(
e
.
message
)
}
}
}
async
getcurrentfile
()
{
async
getcurrentfile
()
{
...
@@ -322,8 +326,13 @@ export class WorkSpacePlugin extends PluginClient {
...
@@ -322,8 +326,13 @@ export class WorkSpacePlugin extends PluginClient {
}
}
}
}
async
switchfile
(
dir
:
string
)
{
async
switchfile
(
dir
:
string
)
{
var
files
=
await
this
.
call
(
'fileManager'
,
'switchFile'
,
dir
)
try
{
const
files
=
await
this
.
call
(
'fileManager'
,
'switchFile'
,
dir
)
}
catch
(
e
)
{
this
.
setFeedback
(
e
.
message
)
}
}
}
async
zip
()
{
async
zip
()
{
...
@@ -514,13 +523,13 @@ export class WorkSpacePlugin extends PluginClient {
...
@@ -514,13 +523,13 @@ export class WorkSpacePlugin extends PluginClient {
}
}
}
}
`
`
await
this
.
call
(
'fileManager'
,
'setFile'
,
'/modifyVariable.sol'
,
f
)
//
await this.call('fileManager', 'setFile', '/modifyVariable.sol', f)
await
this
.
call
(
'fileManager'
,
'switchFile'
,
'
/modifyVariable
.sol'
)
await
this
.
call
(
'fileManager'
,
'switchFile'
,
'
tests/4_Ballot_test
.sol'
)
await
this
.
call
(
'fileManager'
,
'setFile'
,
'/modifyVariable_test.sol'
,
t
)
//
await this.call('fileManager', 'setFile', '/modifyVariable_test.sol', t)
const
result
=
await
this
.
call
(
const
result
=
await
this
.
call
(
'solidityUnitTesting'
,
'solidityUnitTesting'
,
'testFromPath'
,
'testFromPath'
,
'
modifyVariable
_test.sol'
'
tests/4_Ballot
_test.sol'
)
)
this
.
setFeedback
(
result
)
this
.
setFeedback
(
result
)
}
}
...
...
apps/remix-ide-e2e/src/tests/plugin_api.test.ts
View file @
9ee285cb
...
@@ -13,6 +13,12 @@ const localPluginData = {
...
@@ -13,6 +13,12 @@ const localPluginData = {
pluginUrl
:
'http://localhost:2020'
pluginUrl
:
'http://localhost:2020'
}
}
const
getBrowserLogs
=
function
(
browser
:
NightwatchBrowser
)
{
browser
.
getLog
(
'browser'
,
(
logEntries
)
=>
{
console
.
log
(
logEntries
)
})
}
const
assertLog
=
function
(
browser
:
NightwatchBrowser
,
buttonText
:
string
,
msg
:
any
,
payload
:
string
)
{
const
assertLog
=
function
(
browser
:
NightwatchBrowser
,
buttonText
:
string
,
msg
:
any
,
payload
:
string
)
{
if
(
payload
)
{
if
(
payload
)
{
browser
.
clearValue
(
'//*[@id="payload"]'
).
setValue
(
'//*[@id="payload"]'
,
payload
).
pause
(
1000
)
browser
.
clearValue
(
'//*[@id="payload"]'
).
setValue
(
'//*[@id="payload"]'
,
payload
).
pause
(
1000
)
...
@@ -22,16 +28,27 @@ const assertLog = function (browser: NightwatchBrowser, buttonText: string, msg:
...
@@ -22,16 +28,27 @@ const assertLog = function (browser: NightwatchBrowser, buttonText: string, msg:
.
useXpath
().
waitForElementVisible
(
`//*[text()='
${
buttonText
}
']`
).
click
(
`//*[text()='
${
buttonText
}
']`
)
.
useXpath
().
waitForElementVisible
(
`//*[text()='
${
buttonText
}
']`
).
click
(
`//*[text()='
${
buttonText
}
']`
)
.
pause
(
2000
)
.
pause
(
2000
)
getBrowserLogs
(
browser
)
if
(
msg
)
{
if
(
msg
)
{
browser
.
waitForElementVisible
(
'//*[@id="log"]'
).
assert
.
containsText
(
'//*[@id="log"]'
,
msg
)
browser
.
waitForElementVisible
(
'//*[@id="log"]'
).
verify
.
containsText
(
'//*[@id="log"]'
,
msg
)
}
}
}
}
const
assertPluginIsActive
=
function
(
browser
:
NightwatchBrowser
,
id
:
string
)
{
browser
.
waitForElementVisible
(
`//*[@data-id="verticalIconsKind
${
id
}
"]`
)
}
module
.
exports
=
{
module
.
exports
=
{
before
:
function
(
browser
:
NightwatchBrowser
,
done
:
VoidFunction
)
{
before
:
function
(
browser
:
NightwatchBrowser
,
done
:
VoidFunction
)
{
init
(
browser
,
done
,
'http://127.0.0.1:8080'
,
false
)
init
(
browser
,
done
,
'http://127.0.0.1:8080'
,
false
)
},
},
afterEach
:
function
(
browser
:
NightwatchBrowser
)
{
browser
.
getLog
(
'browser'
,
(
logEntries
)
=>
{
console
.
log
(
logEntries
)
})
},
'Should Load Plugin Manager'
:
function
(
browser
:
NightwatchBrowser
)
{
'Should Load Plugin Manager'
:
function
(
browser
:
NightwatchBrowser
)
{
browser
.
waitForElementVisible
(
'*[data-id="remixIdeSidePanel"]'
)
browser
.
waitForElementVisible
(
'*[data-id="remixIdeSidePanel"]'
)
.
pause
(
3000
)
.
pause
(
3000
)
...
@@ -81,6 +98,20 @@ module.exports = {
...
@@ -81,6 +98,20 @@ module.exports = {
},
},
'Should activate solidityUnitTesting'
:
function
(
browser
:
NightwatchBrowser
)
{
'Should activate solidityUnitTesting'
:
function
(
browser
:
NightwatchBrowser
)
{
assertLog
(
browser
,
'activate'
,
null
,
'solidityUnitTesting'
)
assertLog
(
browser
,
'activate'
,
null
,
'solidityUnitTesting'
)
browser
.
frameParent
()
assertPluginIsActive
(
browser
,
'solidityUnitTesting'
)
// @ts-ignore
browser
.
frame
(
0
)
},
'Should switch to file'
:
function
(
browser
:
NightwatchBrowser
)
{
assertLog
(
browser
,
'switch to file'
,
null
,
'contracts/1_Storage.sol'
)
assertLog
(
browser
,
'getcurrentfile'
,
'contracts/1_Storage.sol'
,
null
)
assertLog
(
browser
,
'switch to file'
,
null
,
'README.txt'
)
assertLog
(
browser
,
'getcurrentfile'
,
'README.txt'
,
null
)
},
'Should write to file'
:
function
(
browser
:
NightwatchBrowser
)
{
assertLog
(
browser
,
'write'
,
'README.txt'
,
null
)
}
}
}
}
apps/remix-ide/ci/browser_tests_plugin_api.sh
View file @
9ee285cb
...
@@ -9,7 +9,7 @@ TEST_EXITCODE=0
...
@@ -9,7 +9,7 @@ TEST_EXITCODE=0
npm run serve &
npm run serve &
npx nx serve remix-ide-e2e-src-local-plugin &
npx nx serve remix-ide-e2e-src-local-plugin &
sleep
5 &
sleep
5 &
npm run
testcafe
_local_pluginApi
||
TEST_EXITCODE
=
1
npm run
nightwatch
_local_pluginApi
||
TEST_EXITCODE
=
1
echo
"
$TEST_EXITCODE
"
echo
"
$TEST_EXITCODE
"
if
[
"
$TEST_EXITCODE
"
-eq
1
]
if
[
"
$TEST_EXITCODE
"
-eq
1
]
...
...
package.json
View file @
9ee285cb
...
@@ -90,7 +90,7 @@
...
@@ -90,7 +90,7 @@
"nightwatch_local_runAndDeploy"
:
"npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/runAndDeploy.js --env=chrome-runAndDeploy"
,
"nightwatch_local_runAndDeploy"
:
"npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/runAndDeploy.js --env=chrome-runAndDeploy"
,
"nightwatch_local_url"
:
"npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/url.spec.js --env=chrome"
,
"nightwatch_local_url"
:
"npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/url.spec.js --env=chrome"
,
"nightwatch_local_verticalIconscontextmenu"
:
"npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/verticalIconsPanel.spec.js --env=chrome"
,
"nightwatch_local_verticalIconscontextmenu"
:
"npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/verticalIconsPanel.spec.js --env=chrome"
,
"
testcafe
_local_pluginApi"
:
"npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/plugin_api.test.js --env=chrome"
,
"
nightwatch
_local_pluginApi"
:
"npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/plugin_api.test.js --env=chrome"
,
"onchange"
:
"onchange apps/remix-ide/build/app.js -- npm-run-all lint"
,
"onchange"
:
"onchange apps/remix-ide/build/app.js -- npm-run-all lint"
,
"remixd"
:
"nx build remixd && nx serve remixd --folder=./apps/remix-ide/contracts --remixide=http://127.0.0.1:8080"
,
"remixd"
:
"nx build remixd && nx serve remixd --folder=./apps/remix-ide/contracts --remixide=http://127.0.0.1:8080"
,
"selenium"
:
"selenium-standalone start"
,
"selenium"
:
"selenium-standalone start"
,
...
...
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