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
d1fc4739
Commit
d1fc4739
authored
Mar 29, 2021
by
ioedeveloper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor verifyContracts custom command
parent
39883337
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
43 deletions
+11
-43
verifyContracts.ts
apps/remix-ide-e2e/src/commands/verifyContracts.ts
+6
-36
waitForElementContainsText.ts
.../remix-ide-e2e/src/commands/waitForElementContainsText.ts
+2
-2
compiler_api.test.ts
apps/remix-ide-e2e/src/tests/compiler_api.test.ts
+1
-2
debugger.spec.ts
apps/remix-ide-e2e/src/tests/debugger.spec.ts
+1
-2
package.json
package.json
+1
-1
No files found.
apps/remix-ide-e2e/src/commands/verifyContracts.ts
View file @
d1fc4739
import
{
NightwatchBrowser
,
NightwatchCallbackResult
}
from
'nightwatch'
import
{
NightwatchBrowser
}
from
'nightwatch'
import
EventEmitter
from
'events'
class
VerifyContracts
extends
EventEmitter
{
...
...
@@ -13,7 +13,7 @@ class VerifyContracts extends EventEmitter {
}
}
function
getCompiledContracts
(
browser
:
NightwatchBrowser
,
opts
:
{
wait
:
number
,
version
?:
string
},
callback
:
(
result
:
NightwatchCallbackResult
<
any
>
)
=>
void
)
{
function
verifyContracts
(
browser
:
NightwatchBrowser
,
compiledContractNames
:
string
[],
opts
:
{
wait
:
number
,
version
?:
string
},
callback
:
VoidFunction
)
{
browser
.
clickLaunchIcon
(
'solidity'
)
.
pause
(
opts
.
wait
)
...
...
@@ -29,43 +29,13 @@ function getCompiledContracts (browser: NightwatchBrowser, opts: { wait: number,
.
assert
.
containsText
(
'*[data-id="treeViewLicompiler/version"]'
,
`version:\n
${
opts
.
version
}
`
)
.
modalFooterCancelClick
()
.
perform
(
done
)
}
else
done
()
})
.
execute
(
function
()
{
const
contracts
=
document
.
querySelectorAll
(
'*[data-id="compiledContracts"] option'
)
as
NodeListOf
<
HTMLInputElement
>
if
(
!
contracts
)
{
return
null
}
else
{
const
ret
=
[]
for
(
let
c
=
0
;
c
<
contracts
.
length
;
c
++
)
{
ret
.
push
(
contracts
[
c
].
value
)
}
return
ret
}
},
[],
function
(
result
)
{
callback
(
result
)
compiledContractNames
.
forEach
((
name
)
=>
{
browser
.
waitForElementContainsText
(
'[data-id="compiledContracts"]'
,
name
,
60000
)
})
}
function
verifyContracts
(
browser
:
NightwatchBrowser
,
compiledContractNames
:
string
[],
opts
:
{
wait
:
number
,
version
?:
string
},
callback
:
VoidFunction
)
{
getCompiledContracts
(
browser
,
opts
,
(
result
:
NightwatchCallbackResult
<
any
>
)
=>
{
if
(
result
.
value
)
{
for
(
const
contract
in
compiledContractNames
)
{
console
.
log
(
' - '
+
compiledContractNames
[
contract
],
result
.
value
)
if
(
result
.
value
.
indexOf
(
compiledContractNames
[
contract
])
===
-
1
)
{
browser
.
assert
.
fail
(
'compiled contract '
+
compiledContractNames
+
' not found'
,
'info about error'
,
''
)
browser
.
end
()
return
}
}
}
else
{
browser
.
assert
.
fail
(
'compiled contract '
+
compiledContractNames
+
' not found - none found'
,
'info about error'
,
''
)
browser
.
end
()
}
console
.
log
(
'contracts all found '
+
compiledContractNames
)
done
()
callback
()
}
})
}
...
...
apps/remix-ide-e2e/src/commands/waitForElementContainsText.ts
View file @
d1fc4739
...
...
@@ -9,7 +9,7 @@ class WaitForElementContainsText extends EventEmitter {
if
(
typeof
result
.
value
===
'string'
&&
result
.
value
.
indexOf
(
value
)
!==
-
1
)
{
clearInterval
(
runid
)
clearTimeout
(
waitId
)
this
.
api
.
assert
.
ok
(
true
,
`WaitForElementContainsText
${
id
}
contains
${
value
}
after
${
timeout
}
`
)
this
.
api
.
assert
.
ok
(
true
,
`WaitForElementContainsText
${
id
}
contains
${
value
}
`
)
this
.
emit
(
'complete'
)
}
})
...
...
@@ -17,7 +17,7 @@ class WaitForElementContainsText extends EventEmitter {
waitId
=
setTimeout
(()
=>
{
clearInterval
(
runid
)
this
.
api
.
assert
.
fail
(
`TimeoutError: An error occurred while running .waitForElementContainsText() command on
${
id
}
`
)
this
.
api
.
assert
.
fail
(
`TimeoutError: An error occurred while running .waitForElementContainsText() command on
${
id
}
after
${
timeout
}
milliseconds
`
)
},
timeout
)
return
this
}
...
...
apps/remix-ide-e2e/src/tests/compiler_api.test.ts
View file @
d1fc4739
...
...
@@ -53,8 +53,7 @@ module.exports = {
'Should produce a stack too deep error'
:
function
(
browser
:
NightwatchBrowser
)
{
browser
.
clickLaunchIcon
(
'fileExplorers'
)
.
click
(
'li[data-id="treeViewLitreeViewItemREADME.txt"'
)
.
setSolidityCompilerVersion
(
'soljson-v0.8.1+commit.df193b15.js'
)
.
addFile
(
'ContractStackLimit.sol'
,
{
content
:
contractStackLimit
})
.
clickLaunchIcon
(
'solidity'
)
.
waitForElementContainsText
(
'*[data-id="compiledErrors"]'
,
'CompilerError: Stack too deep when compiling inline assembly: Variable headStart is 1 slot(s) too deep inside the stack.'
,
60000
)
...
...
apps/remix-ide-e2e/src/tests/debugger
→
apps/remix-ide-e2e/src/tests/debugger
.spec.ts
View file @
d1fc4739
...
...
@@ -188,8 +188,7 @@ module.exports = {
browser
.
addFile
(
'test_jsGetTrace.js'
,
{
content
:
jsGetTrace
})
.
executeScript
(
'remix.exeCurrent()'
)
.pause(5000)
.journalChildIncludes('result { "gas": "0x5863", "return": "0x0000000000000000000000000000000000000000000000000000000000000000", "structLogs":')
.
waitForElementContainsText
(
'*[data-id="terminalJournal"]'
,
'result { "gas": "0x5863", "return": "0x0000000000000000000000000000000000000000000000000000000000000000", "structLogs":'
,
60000
)
},
'Should call the debugger api: debug'
:
function
(
browser
:
NightwatchBrowser
)
{
...
...
package.json
View file @
d1fc4739
...
...
@@ -57,7 +57,7 @@
"nightwatch_local_firefox"
:
"npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js --env=firefox"
,
"nightwatch_local_chrome"
:
"npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js --env=chrome"
,
"nightwatch_local_ballot"
:
"npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/ballot.test.js --env=chrome"
,
"nightwatch_local_ballot_0_4_11"
:
"npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/ballot_0_4_11.spec.js --env=
firefox
"
,
"nightwatch_local_ballot_0_4_11"
:
"npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/ballot_0_4_11.spec.js --env=
chrome
"
,
"nightwatch_local_usingWorker"
:
"npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/usingWebWorker.test.js --env=chrome"
,
"nightwatch_local_libraryDeployment"
:
"npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/libraryDeployment.test.js --env=chrome"
,
"nightwatch_local_solidityImport"
:
"npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/solidityImport.test.js --env=chrome"
,
...
...
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