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
6cc2b5ef
Commit
6cc2b5ef
authored
Apr 24, 2020
by
ioedeveloper
Committed by
Aniket
Apr 24, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added custom command for element selection at position (index)
parent
b4d51cac
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
7 deletions
+32
-7
browser_tests.sh
ci/browser_tests.sh
+3
-2
clickElementAtPosition.js
test-browser/commands/clickElementAtPosition.js
+24
-0
solidityUnittests.js
test-browser/tests/solidityUnittests.js
+5
-5
No files found.
ci/browser_tests.sh
View file @
6cc2b5ef
...
...
@@ -21,8 +21,9 @@ setupRemixd
sleep
5
npm run nightwatch_parallel
||
TEST_EXITCODE
=
1
npm run nightwatch_local_runAndDeploy
||
TEST_EXITCODE
=
1
npm run nightwatch_local_solidityUnitTests
||
TEST_EXITCODE
=
1
#npm run nightwatch_parallel || TEST_EXITCODE=1
#npm run nightwatch_local_runAndDeploy || TEST_EXITCODE=1
echo
"
$TEST_EXITCODE
"
if
[
"
$TEST_EXITCODE
"
-eq
1
]
...
...
test-browser/commands/clickElementAtPosition.js
0 → 100644
View file @
6cc2b5ef
const
EventEmitter
=
require
(
'events'
)
class
ClickElement
extends
EventEmitter
{
command
(
cssSelector
,
index
=
0
)
{
this
.
api
.
perform
((
done
)
=>
{
_clickElement
(
this
.
api
,
cssSelector
,
index
,
()
=>
{
done
()
this
.
emit
(
'complete'
)
})
})
return
this
}
}
function
_clickElement
(
browser
,
cssSelector
,
index
,
cb
)
{
browser
.
waitForElementPresent
(
cssSelector
)
.
execute
(
function
(
cssSelector
,
index
)
{
document
.
querySelectorAll
(
cssSelector
)[
index
].
click
()
},
[
cssSelector
,
index
],
function
()
{
cb
()
})
}
module
.
exports
=
ClickElement
test-browser/tests/solidityUnittests.js
View file @
6cc2b5ef
...
...
@@ -42,7 +42,7 @@ module.exports = {
.
click
(
'*[data-id="verticalIconsKindsolidityUnitTesting"]'
)
.
waitForElementPresent
(
'*[data-id="testTabCheckAllTests"]'
)
.
click
(
'*[data-id="testTabCheckAllTests"]'
)
.
click
(
'.singleTestLabel:nth-of-type(2)'
)
.
click
ElementAtPosition
(
'.singleTestLabel'
,
1
)
.
scrollAndClick
(
'*[data-id="testTabRunTestsTabRunAction"]'
)
.
pause
(
15000
)
.
assert
.
containsText
(
'*[data-id="testTabSolidityUnitTestsOutput"]'
,
'browser/simple_storage_test.sol (MyTest)'
)
...
...
@@ -60,7 +60,7 @@ module.exports = {
.
click
(
'*[data-id="verticalIconsKindsolidityUnitTesting"]'
)
.
waitForElementPresent
(
'*[data-id="testTabCheckAllTests"]'
)
.
click
(
'*[data-id="testTabCheckAllTests"]'
)
.
click
(
'.singleTestLabel:nth-of-type(3)'
)
.
click
ElementAtPosition
(
'.singleTestLabel'
,
2
)
.
scrollAndClick
(
'*[data-id="testTabRunTestsTabRunAction"]'
)
.
pause
(
20000
)
.
assert
.
containsText
(
'*[data-id="testTabSolidityUnitTestsOutput"]'
,
'browser/ks2b_test.sol (kickstarterTest)'
)
...
...
@@ -81,7 +81,7 @@ module.exports = {
.
switchFile
(
'browser/compilationError_test.sol'
)
.
clickLaunchIcon
(
'solidityUnitTesting'
)
.
click
(
'*[data-id="testTabCheckAllTests"]'
)
.
click
(
'.singleTestLabel:nth-of-type(4)'
)
.
click
ElementAtPosition
(
'.singleTestLabel'
,
3
)
.
scrollAndClick
(
'*[data-id="testTabRunTestsTabRunAction"]'
)
.
pause
(
10000
)
.
waitForElementPresent
(
'*[data-id="testTabSolidityUnitTestsSummary"]'
)
...
...
@@ -95,7 +95,7 @@ module.exports = {
.
switchFile
(
'browser/deployError_test.sol'
)
.
clickLaunchIcon
(
'solidityUnitTesting'
)
.
click
(
'*[data-id="testTabCheckAllTests"]'
)
.
click
(
'.singleTestLabel:nth-of-type(5)'
)
.
click
ElementAtPosition
(
'.singleTestLabel'
,
4
)
.
scrollAndClick
(
'*[data-id="testTabRunTestsTabRunAction"]'
)
.
pause
(
10000
)
.
waitForElementPresent
(
'*[data-id="testTabSolidityUnitTestsSummary"]'
)
...
...
@@ -109,7 +109,7 @@ module.exports = {
.
switchFile
(
'browser/methodFailure_test.sol'
)
.
clickLaunchIcon
(
'solidityUnitTesting'
)
.
click
(
'*[data-id="testTabCheckAllTests"]'
)
.
click
(
'.singleTestLabel:nth-of-type(6)'
)
.
click
ElementAtPosition
(
'.singleTestLabel'
,
5
)
.
scrollAndClick
(
'*[data-id="testTabRunTestsTabRunAction"]'
)
.
pause
(
15000
)
.
waitForElementPresent
(
'*[data-id="testTabSolidityUnitTestsSummary"]'
)
...
...
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