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
8930a042
Commit
8930a042
authored
Feb 08, 2020
by
ioedeveloper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Created a custom command for testing DOM element styles and added more tests to homepage test
parent
208df28b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
77 additions
and
6 deletions
+77
-6
checkElementStyle.js
test-browser/commands/checkElementStyle.js
+24
-0
homepage.js
test-browser/tests/homepage.js
+53
-6
No files found.
test-browser/commands/checkElementStyle.js
0 → 100644
View file @
8930a042
const
EventEmitter
=
require
(
'events'
)
class
checkElementStyle
extends
EventEmitter
{
command
(
cssSelector
,
styleProperty
,
expectedResult
)
{
this
.
api
.
perform
((
done
)
=>
{
checkStyle
(
this
.
api
,
cssSelector
,
styleProperty
,
expectedResult
,
()
=>
{
done
()
this
.
emit
(
'complete'
)
})
})
return
this
}
}
function
checkStyle
(
browser
,
cssSelector
,
styleProperty
,
expectedResult
,
callback
)
{
browser
.
execute
(
function
(
cssSelector
,
styleProperty
)
{
return
window
.
getComputedStyle
(
document
.
querySelector
(
cssSelector
)).
getPropertyValue
(
styleProperty
)
},
[
cssSelector
,
styleProperty
],
function
(
result
)
{
browser
.
assert
.
equal
(
result
.
value
,
expectedResult
)
callback
()
})
}
module
.
exports
=
checkElementStyle
test-browser/tests/homepage.js
View file @
8930a042
...
...
@@ -9,16 +9,63 @@ module.exports = {
'Loads Icon
\'
s Panel'
:
function
(
browser
)
{
browser
.
waitForElementVisible
(
'#icon-panel'
,
10000
)
.
waitForElementVisible
(
'#icon-panel > div > div[class^="homeIcon"]'
)
.
waitForElementVisible
(
'#fileExplorerIcons > div:nth-child(1)'
)
.
waitForElementVisible
(
'#settingsIcons > div:nth-child(1)'
)
.
waitForElementVisible
(
'#settingsIcons > div:nth-child(2)'
)
.
waitForElementVisible
(
'#
icon-panel #
fileExplorerIcons > div:nth-child(1)'
)
.
waitForElementVisible
(
'#
icon-panel #
settingsIcons > div:nth-child(1)'
)
.
waitForElementVisible
(
'#
icon-panel #
settingsIcons > div:nth-child(2)'
)
},
'Loads Side Panel'
:
function
(
browser
)
{
browser
.
waitForElementVisible
(
'#side-panel'
)
.
assert
.
containsText
(
'h6[class^="swapitTitle"]'
,
'FILE EXPLORERS'
)
.
waitForElementVisible
(
'div[class^="treeview"]'
)
.
waitForElementVisible
(
'ul[key="browser"] > li:nth-child(4)'
)
.
assert
.
containsText
(
'#side-panel h6[class^="swapitTitle"]'
,
'FILE EXPLORERS'
)
.
waitForElementVisible
(
'#side-panel div[class^="treeview"]'
)
.
waitForElementVisible
(
'#side-panel ul[key="browser"] > li:nth-child(4)'
)
},
'Loads Main View'
:
function
(
browser
)
{
browser
.
waitForElementVisible
(
'#main-panel > div[class^="mainview"] > div[class^="pluginsContainer"]'
)
.
waitForElementVisible
(
'#main-panel div[class^="homeContainer"] > div:nth-child(2)'
)
.
waitForElementVisible
(
'#main-panel div[class^="row hpSections"] > div:nth-child(1)'
)
.
waitForElementVisible
(
'#main-panel div[class^="panel"] > div[class^="terminal_container"]:nth-child(2)'
)
},
'Toggles Side Panel'
:
function
(
browser
)
{
browser
.
waitForElementVisible
(
'#side-panel'
)
.
assert
.
visible
(
'#side-panel'
)
.
assert
.
containsText
(
'#side-panel h6[class^="swapitTitle"]'
,
'FILE EXPLORERS'
)
.
clickLaunchIcon
(
'fileExplorers'
)
.
assert
.
hidden
(
'#side-panel'
)
.
clickLaunchIcon
(
'fileExplorers'
)
.
assert
.
visible
(
'#side-panel'
)
.
assert
.
containsText
(
'#side-panel h6[class^="swapitTitle"]'
,
'FILE EXPLORERS'
)
},
'Toggles Terminal'
:
function
(
browser
)
{
browser
.
waitForElementVisible
(
'#main-panel div[class^="panel"] > div[class^="terminal_container"]'
)
.
assert
.
visible
(
'#main-panel div[class^="panel"] > div[class^="terminal_container"]:nth-child(2)'
)
.
click
(
'div[class^="bar"] > div[class^="menu"] > i'
)
.
checkElementStyle
(
'div[class^="bar"] > div[class^="menu"]'
,
'height'
,
'35px'
)
.
click
(
'div[class^="bar"] > div[class^="menu"] > i'
)
.
assert
.
visible
(
'#main-panel div[class^="panel"] > div[class^="terminal_container"]:nth-child(2)'
)
},
'Toggles File Explorer Browser'
:
function
(
browser
)
{
browser
.
waitForElementVisible
(
'#side-panel div[class^="treeview"]'
)
.
assert
.
visible
(
'ul[key="browser"]'
)
.
click
(
'li[key="browser"] > div[key="browser"] > div.fas'
)
.
assert
.
hidden
(
'ul[key="browser"]'
)
.
click
(
'li[key="browser"] > div[key="browser"] > div.fas'
)
.
assert
.
visible
(
'ul[key="browser"]'
)
},
'Switch Tabs using tabs icon'
:
function
(
browser
)
{
browser
.
waitForElementVisible
(
'#side-panel div[class^="treeview"]'
)
.
switchFile
(
'browser/3_Ballot.sol'
)
.
assert
.
containsText
(
'div[title="browser/3_Ballot.sol"] > span'
,
'3_Ballot.sol'
)
.
click
(
'div.dropdown.px-1 > span.dropdownCaret'
)
.
click
(
'#homeItem'
)
.
assert
.
containsText
(
'div[title="home"] > span'
,
'Home'
)
.
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