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
0201621d
Commit
0201621d
authored
Oct 13, 2021
by
filip mertens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more tests
parent
0e504484
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
48 additions
and
33 deletions
+48
-33
.gitignore
.gitignore
+1
-0
Client.ts
apps/remix-ide-e2e/src/local-plugin/src/app/Client.ts
+4
-9
app.tsx
apps/remix-ide-e2e/src/local-plugin/src/app/app.tsx
+7
-6
logger.tsx
apps/remix-ide-e2e/src/local-plugin/src/app/logger.tsx
+13
-4
plugin-api.test.ts
apps/remix-ide-e2e/src/local-plugin/tests/plugin-api.test.ts
+22
-11
browser_tests_plugin_api.sh
apps/remix-ide/ci/browser_tests_plugin_api.sh
+1
-3
No files found.
.gitignore
View file @
0201621d
...
...
@@ -52,3 +52,4 @@ testem.log
# System Files
.DS_Store
.vscode/settings.json
.vscode/launch.json
apps/remix-ide-e2e/src/local-plugin/src/app/Client.ts
View file @
0201621d
...
...
@@ -35,10 +35,9 @@ export class WorkSpacePlugin extends PluginClient {
constructor
()
{
super
()
console
.
log
(
'CONSTRUCTOR'
)
createClient
(
this
)
this
.
methods
=
[
'
qr'
,
'dismiss'
,
'
customAction'
]
this
.
methods
=
[
'customAction'
]
this
.
onload
()
.
then
(
async
(
x
)
=>
{
...
...
@@ -482,7 +481,7 @@ export class WorkSpacePlugin extends PluginClient {
}
async
soltest
()
{
const
f
=
`pragma solidity >=0.4.0
<0.7.0
;
const
f
=
`pragma solidity >=0.4.0;
contract SimpleStorage {
uint storedData;
...
...
@@ -498,7 +497,7 @@ export class WorkSpacePlugin extends PluginClient {
}
`
const
t
=
`pragma solidity >=0.4.0
<0.7.0
;
const
t
=
`pragma solidity >=0.4.0;
import "remix_tests.sol"; // this import is automatically injected by Remix.
import "./modifyVariable.sol";
...
...
@@ -515,10 +514,6 @@ export class WorkSpacePlugin extends PluginClient {
}
}
`
console
.
log
(
f
)
console
.
log
(
t
)
await
this
.
call
(
'fileManager'
,
'setFile'
,
'/modifyVariable.sol'
,
f
)
await
this
.
call
(
'fileManager'
,
'switchFile'
,
'/modifyVariable.sol'
)
await
this
.
call
(
'fileManager'
,
'setFile'
,
'/modifyVariable_test.sol'
,
t
)
...
...
@@ -527,7 +522,7 @@ export class WorkSpacePlugin extends PluginClient {
'testFromPath'
,
'modifyVariable_test.sol'
)
return
result
.
errors
this
.
setFeedback
(
result
)
}
async
disableCallBacks
()
{
...
...
apps/remix-ide-e2e/src/local-plugin/src/app/app.tsx
View file @
0201621d
...
...
@@ -8,21 +8,22 @@ export const client = new WorkSpacePlugin()
function
App
()
{
const
[
payload
,
setPayload
]
=
useState
<
string
>
(
''
)
const
[
result
,
setResult
]
=
useState
<
string
>
()
const
[
append
,
setAppend
]
=
useState
<
boolean
>
(
false
)
const
handleChange
=
({
target
}:
any
)
=>
{
setPayload
(
target
.
value
)
}
const
test
=
async
()
=>
{
setResult
(
''
)
const
r
=
await
client
.
soltest
()
setResult
(
'test done'
)
const
setAppendChange
=
({
target
}:
any
)
=>
{
console
.
log
(
'append'
,
target
.
checked
)
setAppend
(
target
.
checked
)
}
return
(
<
div
className=
"App"
>
<
div
>
v5
</
div
>
<
Logger
></
Logger
>
<
Logger
append=
{
append
}
></
Logger
>
<
input
id=
'appendToLog'
type=
'checkbox'
onChange=
{
setAppendChange
}
/><
label
>
append logs
</
label
>
<
button
className=
'btn btn-primary btn-sm'
onClick=
{
async
()
=>
await
client
.
zip
()
}
>
zip
</
button
>
<
button
className=
'btn btn-primary btn-sm'
onClick=
{
async
()
=>
await
client
.
ipfspush
()
}
>
ipfs push
</
button
>
<
button
className=
'btn btn-primary btn-sm'
onClick=
{
async
()
=>
await
client
.
ipfspull
(
payload
)
}
>
ipfs pull
</
button
>
...
...
@@ -30,7 +31,7 @@ function App () {
<
button
className=
'btn btn-primary btn-sm'
onClick=
{
async
()
=>
await
client
.
getAccounts
()
}
>
get accounts
</
button
>
<
button
className=
'btn btn-primary btn-sm'
onClick=
{
async
()
=>
await
client
.
setSettings
()
}
>
set settings to injected
</
button
>
<
button
className=
'btn btn-primary btn-sm'
onClick=
{
async
()
=>
await
client
.
getSettings
()
}
>
get settings
</
button
>
<
button
className=
'btn btn-primary btn-sm'
onClick=
{
async
()
=>
await
test
()
}
>
run sol test
</
button
>
<
button
className=
'btn btn-primary btn-sm'
onClick=
{
async
()
=>
await
client
.
sol
test
()
}
>
run sol test
</
button
>
<
button
className=
'btn btn-primary btn-sm'
onClick=
{
async
()
=>
await
client
.
highlight
(
payload
)
}
>
highlight
</
button
>
<
button
className=
'btn btn-primary btn-sm'
onClick=
{
async
()
=>
await
client
.
addAnnotation
(
payload
)
}
>
annotation
</
button
>
<
button
className=
'btn btn-primary btn-sm'
onClick=
{
async
()
=>
await
client
.
clearAnnotations
(
payload
)
}
>
clear annotation
</
button
>
...
...
apps/remix-ide-e2e/src/local-plugin/src/app/logger.tsx
View file @
0201621d
import
React
from
'react'
import
React
,
{
useEffect
,
useState
}
from
'react'
import
{
useBehaviorSubject
}
from
'./usesubscribe/index'
import
{
client
}
from
'./app'
interface
loggerProps
{
append
:
boolean
}
export
const
Logger
:
React
.
FC
<
loggerProps
>
=
(
{}
)
=>
{
export
const
Logger
:
React
.
FC
<
loggerProps
>
=
(
props
)
=>
{
const
log
=
useBehaviorSubject
(
client
.
feedback
)
return
(<
div
id=
'log'
>
{
typeof
log
===
'string'
?
log
:
JSON
.
stringify
(
log
)
}
</
div
>)
const
[
value
,
setValue
]
=
useState
<
string
>
(
''
)
useEffect
(()
=>
{
setValue
(
value
=>
{
const
addValue
=
typeof
log
===
'string'
?
log
:
JSON
.
stringify
(
log
)
return
props
.
append
?
`
${
value
}
${
addValue
}
`
:
addValue
})
},
[
log
])
return
(<
div
id=
'log'
>
{
value
}
</
div
>)
}
apps/remix-ide-e2e/src/local-plugin/tests/plugin-api.test.ts
View file @
0201621d
import
{
Selector
,
RequestLogger
,
Role
}
from
'testcafe'
import
{
Profile
,
LocationProfile
,
ExternalProfile
}
from
'@remixproject/plugin-utils'
const
logger
=
RequestLogger
()
const
role
=
Role
(
process
.
env
.
TEST_URL
||
'http://localhost:8080'
,
async
t
=>
{
})
fixture
`DGIT production tests`
.
page
(
process
.
env
.
TEST_URL
||
'http://localhost:8080'
)
fixture
`Plugin API tests`
.
page
(
process
.
env
.
TEST_URL
||
'http://127.0.0.1:8080'
)
.
beforeEach
(
async
t
=>
{
}).
afterEach
(
async
t
=>
{
console
.
log
(
await
t
.
getBrowserConsoleMessages
())
})
const
openPlugin
=
async
(
t
:
TestController
,
plugin
:
string
)
=>
{
await
t
.
click
(
`#icon-panel div[plugin="
${
plugin
}
"]`
)
...
...
@@ -20,7 +16,7 @@ interface dataIdSelectorInterface extends Selector {
select
(
id
:
string
):
Promise
<
any
>
}
const
dataIdSelector
=
async
(
id
:
string
)
=>
{
return
Selector
(
`[data-id="
${
id
}
"]`
)
}
const
dataIdSelector
=
async
(
id
:
string
)
=>
{
return
Selector
(
`[data-id="
${
id
}
"]`
)
}
const
installPlugin
=
async
(
t
:
TestController
,
profile
:
Profile
&
LocationProfile
&
ExternalProfile
)
=>
{
await
t
.
click
(
'*[plugin="pluginManager"]'
)
...
...
@@ -46,7 +42,7 @@ const localPluginData = {
location
:
'sidePanel'
,
url
:
'http://localhost:2020'
,
canActivate
:
[
'dGitProvider,flattener'
'dGitProvider,flattener
,solidityUnitTesting
'
]
}
...
...
@@ -64,7 +60,7 @@ test('install plugin', async t => {
test
.
disablePageReloads
(
'switch to plugin'
,
async
t
=>
{
await
t
.
click
(
'#verticalIconsKindpluginManager'
)
// .click('[data-id="pluginManagerComponentActivateButtondgittest"]')
// .click('[data-id="pluginManagerComponentActivateButtondgittest"]')
.
click
(
'[data-id="verticalIconsKindlocalplugin"]'
)
.
switchToIframe
(
'#plugin-localplugin'
)
})
...
...
@@ -123,3 +119,18 @@ test.disablePageReloads('open a file', async t => {
await
expectLogMessage
(
t
,
file
)
})
test
.
disablePageReloads
(
'run a test file'
,
async
t
=>
{
await
t
.
click
(
'#appendToLog'
)
.
click
(
Selector
(
'Button'
)
.
withText
(
'run sol test'
))
.
switchToMainWindow
()
.
click
(
'#remember'
)
.
click
(
Selector
(
'span'
).
withText
(
'Accept'
))
.
switchToIframe
(
'#plugin-localplugin'
)
.
click
(
Selector
(
'Button'
)
.
withText
(
'run sol test'
)).
wait
(
5000
)
await
expectLogMessage
(
t
,
'"totalPassing":1,"totalFailing":0'
)
})
apps/remix-ide/ci/browser_tests_plugin_api.sh
View file @
0201621d
...
...
@@ -8,9 +8,7 @@ TEST_EXITCODE=0
npm run serve &
npx nx serve remix-ide-e2e-src-local-plugin &
sleep
5
sleep
5 &
npm run testcafe_local_pluginApi
||
TEST_EXITCODE
=
1
echo
"
$TEST_EXITCODE
"
...
...
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