Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
logging-scratch-gui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Goessmann
logging-scratch-gui
Commits
2d56c816
Commit
2d56c816
authored
7 years ago
by
Paul Kaplan
Browse files
Options
Downloads
Patches
Plain Diff
Update tests to include reporter clicking and variable clicking.
parent
c8f04c09
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/helpers/selenium-helper.js
+6
-1
6 additions, 1 deletion
test/helpers/selenium-helper.js
test/integration/test.js
+21
-0
21 additions, 0 deletions
test/integration/test.js
with
27 additions
and
1 deletion
test/helpers/selenium-helper.js
+
6
−
1
View file @
2d56c816
...
...
@@ -12,6 +12,7 @@ class SeleniumHelper {
'
clickText
'
,
'
clickButton
'
,
'
clickXpath
'
,
'
findByText
'
,
'
findByXpath
'
,
'
getDriver
'
,
'
getLogs
'
...
...
@@ -29,12 +30,16 @@ class SeleniumHelper {
return
this
.
driver
.
wait
(
until
.
elementLocated
(
By
.
xpath
(
xpath
),
5
*
1000
));
}
findByText
(
text
,
scope
)
{
return
this
.
findByXpath
(
`//body//
${
scope
||
'
*
'
}
//*[contains(text(), '
${
text
}
')]`
);
}
clickXpath
(
xpath
)
{
return
this
.
findByXpath
(
xpath
).
then
(
el
=>
el
.
click
());
}
clickText
(
text
,
scope
)
{
return
this
.
clickXpath
(
`//body//
${
scope
||
'
*
'
}
//*[contains(text(), '
${
text
}
')]`
);
return
this
.
findByText
(
text
,
scope
).
then
(
el
=>
el
.
click
()
);
}
clickButton
(
text
)
{
...
...
This diff is collapsed.
Click to expand it.
test/integration/test.js
+
21
−
0
View file @
2d56c816
...
...
@@ -5,6 +5,7 @@ const {
clickText
,
clickButton
,
clickXpath
,
findByText
,
findByXpath
,
getDriver
,
getLogs
...
...
@@ -21,6 +22,7 @@ let driver;
const
blocksTabScope
=
"
*[@id='react-tabs-1']
"
;
const
costumesTabScope
=
"
*[@id='react-tabs-3']
"
;
const
soundsTabScope
=
"
*[@id='react-tabs-5']
"
;
const
reportedValueScope
=
'
*[@class="blocklyDropDownContent"]
'
;
describe
(
'
costumes, sounds and variables
'
,
()
=>
{
beforeAll
(()
=>
{
...
...
@@ -31,6 +33,18 @@ describe('costumes, sounds and variables', () => {
await
driver
.
quit
();
});
test
(
'
Blocks report when clicked in the toolbox
'
,
async
()
=>
{
await
driver
.
get
(
`file://
${
uri
}
`
);
await
clickText
(
'
Blocks
'
);
await
clickText
(
'
Operators
'
,
blocksTabScope
);
await
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
1000
));
// Wait for scroll animation
await
clickText
(
'
join
'
,
blocksTabScope
);
// Click "join <hello> <world>" block
await
findByText
(
'
helloworld
'
,
reportedValueScope
);
// Tooltip with result
const
logs
=
await
getLogs
(
errorWhitelist
);
await
expect
(
logs
).
toEqual
([]);
});
test
(
'
Adding a costume
'
,
async
()
=>
{
await
driver
.
get
(
`file://
${
uri
}
`
);
await
clickText
(
'
Costumes
'
);
...
...
@@ -93,6 +107,13 @@ describe('costumes, sounds and variables', () => {
el
=
await
findByXpath
(
"
//input[@placeholder='']
"
);
await
el
.
sendKeys
(
'
second variable
'
);
await
clickButton
(
'
OK
'
);
// Make sure reporting works on a new variable
await
clickText
(
'
Data
'
,
blocksTabScope
);
await
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
1000
));
// Wait for scroll animation
await
clickText
(
'
score
'
,
blocksTabScope
);
await
findByText
(
'
0
'
,
reportedValueScope
);
// Tooltip with result
const
logs
=
await
getLogs
(
errorWhitelist
);
await
expect
(
logs
).
toEqual
([]);
});
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment