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
68e94cf0
Commit
68e94cf0
authored
May 11, 2020
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add more tests
parent
bff67fd7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
76 additions
and
0 deletions
+76
-0
elementIsNotPresent.js
test-browser/commands/elementIsNotPresent.js
+15
-0
elementIsPresent.js
test-browser/commands/elementIsPresent.js
+15
-0
editor.test.js
test-browser/tests/editor.test.js
+46
-0
No files found.
test-browser/commands/elementIsNotPresent.js
0 → 100644
View file @
68e94cf0
const
EventEmitter
=
require
(
'events'
)
class
ElementIsPresent
extends
EventEmitter
{
command
(
cssSelector
)
{
this
.
api
.
execute
((
cssSelector
)
=>
{
return
!!
document
.
querySelector
(
cssSelector
)
},
[
cssSelector
],
(
result
)
=>
{
this
.
api
.
assert
.
equal
(
false
,
result
.
value
,
`
${
cssSelector
}
should not be present`
)
this
.
emit
(
'complete'
)
})
return
this
}
}
module
.
exports
=
ElementIsPresent
test-browser/commands/elementIsPresent.js
0 → 100644
View file @
68e94cf0
const
EventEmitter
=
require
(
'events'
)
class
ElementIsPresent
extends
EventEmitter
{
command
(
cssSelector
)
{
this
.
api
.
execute
((
cssSelector
)
=>
{
return
!!
document
.
querySelector
(
cssSelector
)
},
[
cssSelector
],
(
result
)
=>
{
this
.
api
.
assert
.
equal
(
true
,
result
.
value
,
`
${
cssSelector
}
should be present`
)
this
.
emit
(
'complete'
)
})
return
this
}
}
module
.
exports
=
ElementIsPresent
test-browser/tests/editor.test.js
View file @
68e94cf0
...
...
@@ -83,6 +83,28 @@ module.exports = {
.
checkElementStyle
(
'.highlightLine40'
,
'background-color'
,
'rgb(8, 108, 181)'
)
.
waitForElementPresent
(
'.highlightLine50'
)
.
checkElementStyle
(
'.highlightLine50'
,
'background-color'
,
'rgb(8, 108, 181)'
)
},
'Should remove 1 highlight from source code'
:
function
(
browser
)
{
browser
.
addFile
(
'removeSourcehighlightScript.js'
,
removeSourcehighlightScript
)
.
switchFile
(
'browser/removeSourcehighlightScript.js'
)
.
executeScript
(
'remix.exeCurrent()'
)
.
switchFile
(
'browser/3_Ballot.sol'
)
.
editorScroll
(
'down'
,
60
)
.
elementIsNotPresent
(
'.highlightLine32'
)
.
checkElementStyle
(
'.highlightLine40'
,
'background-color'
,
'rgb(8, 108, 181)'
)
.
checkElementStyle
(
'.highlightLine50'
,
'background-color'
,
'rgb(8, 108, 181)'
)
},
'Should remove all highlights from source code'
:
function
(
browser
)
{
browser
.
addFile
(
'removeAllSourcehighlightScript.js'
,
removeAllSourcehighlightScript
)
.
switchFile
(
'browser/removeAllSourcehighlightScript.js'
)
.
executeScript
(
'remix.exeCurrent()'
)
.
switchFile
(
'browser/3_Ballot.sol'
)
.
editorScroll
(
'down'
,
60
)
.
elementIsNotPresent
(
'.highlightLine32'
)
.
elementIsNotPresent
(
'.highlightLine40'
)
.
elementIsNotPresent
(
'.highlightLine50'
)
.
end
()
},
...
...
@@ -149,3 +171,27 @@ const sourcehighlightScript = {
})()
`
}
const
removeSourcehighlightScript
=
{
content
:
`
(async () => {
try {
await remix.call('editor', 'discardHighlightAt', 32, 'browser/3_Ballot.sol')
} catch (e) {
console.log(e.message)
}
})()
`
}
const
removeAllSourcehighlightScript
=
{
content
:
`
(async () => {
try {
await remix.call('editor', 'discardHighlight')
} catch (e) {
console.log(e.message)
}
})()
`
}
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