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
6b5dd747
Commit
6b5dd747
authored
May 07, 2020
by
ioedeveloper
Committed by
yann300
May 07, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Editor scroll
parent
3373887f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
28 deletions
+24
-28
editorScroll.js
test-browser/commands/editorScroll.js
+21
-0
scrollUp.js
test-browser/commands/scrollUp.js
+0
-25
editor.test.js
test-browser/tests/editor.test.js
+3
-3
No files found.
test-browser/commands/editorScroll.js
0 → 100644
View file @
6b5dd747
const
EventEmitter
=
require
(
'events'
)
// fix for editor scroll
class
ScrollEditor
extends
EventEmitter
{
command
(
direction
,
numberOfTimes
)
{
const
browser
=
this
.
api
browser
.
waitForElementPresent
(
'.ace_text-input'
)
for
(
let
i
=
0
;
i
<
numberOfTimes
;
i
++
){
if
(
direction
.
toLowerCase
()
===
'up'
)
browser
.
sendKeys
(
'.ace_text-input'
,
browser
.
Keys
.
ARROW_UP
)
if
(
direction
.
toLowerCase
()
===
'down'
)
browser
.
sendKeys
(
'.ace_text-input'
,
browser
.
Keys
.
ARROW_DOWN
)
}
browser
.
perform
((
done
)
=>
{
done
()
this
.
emit
(
'complete'
)
})
return
this
}
}
module
.
exports
=
ScrollEditor
test-browser/commands/scrollUp.js
deleted
100644 → 0
View file @
3373887f
const
EventEmitter
=
require
(
'events'
)
class
ScrollUp
extends
EventEmitter
{
command
(
target
,
height
)
{
this
.
api
.
perform
((
done
)
=>
{
_scrollUp
(
this
.
api
,
target
,
height
,
()
=>
{
done
()
this
.
emit
(
'complete'
)
})
})
return
this
}
}
function
_scrollUp
(
browser
,
target
,
height
,
cb
)
{
browser
.
execute
(
function
(
target
,
height
)
{
const
element
=
document
.
querySelector
(
target
)
element
.
scrollTop
=
element
.
scrollHeight
-
height
},
[
target
,
height
],
function
()
{
cb
()
})
}
module
.
exports
=
ScrollUp
test-browser/tests/editor.test.js
View file @
6b5dd747
...
...
@@ -76,13 +76,13 @@ module.exports = {
browser
.
addFile
(
'sourcehighlight.js'
,
sourcehighlightScript
)
.
switchFile
(
'browser/sourcehighlight.js'
)
.
executeScript
(
'remix.exeCurrent()'
)
.
scrollUp
(
'*[data-id="editorInput"]'
,
100
)
.
pause
(
5000
)
.
scrollUp
(
'.ace_scroller'
,
100
)
.
editorScroll
(
'down'
,
60
)
.
waitForElementPresent
(
'.highlightLine32'
)
.
checkElementStyle
(
'.highlightLine32'
,
'background-color'
,
'rgb(8, 108, 181)'
)
.
waitForElementPresent
(
'.highlightLine40'
)
.
checkElementStyle
(
'.highlightLine40'
,
'background-color'
,
'rgb(8, 108, 181)'
)
.
waitForElementPresent
(
'.highlightLine50'
)
.
checkElementStyle
(
'.highlightLine50'
,
'background-color'
,
'rgb(8, 108, 181)'
)
.
end
()
},
...
...
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