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
67074edb
Commit
67074edb
authored
6 years ago
by
Ben Wheeler
Browse files
Options
Downloads
Patches
Plain Diff
added back button test
parent
3f4e9698
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/helpers/selenium-helper.js
+9
-0
9 additions, 0 deletions
test/helpers/selenium-helper.js
test/integration/sprites.test.js
+24
-0
24 additions, 0 deletions
test/integration/sprites.test.js
with
33 additions
and
0 deletions
test/helpers/selenium-helper.js
+
9
−
0
View file @
67074edb
...
@@ -14,6 +14,8 @@ class SeleniumHelper {
...
@@ -14,6 +14,8 @@ class SeleniumHelper {
'
clickText
'
,
'
clickText
'
,
'
clickButton
'
,
'
clickButton
'
,
'
clickXpath
'
,
'
clickXpath
'
,
'
elementIsVisible
'
,
'
elementIsNotVisible
'
,
'
findByText
'
,
'
findByText
'
,
'
findByXpath
'
,
'
findByXpath
'
,
'
getDriver
'
,
'
getDriver
'
,
...
@@ -24,6 +26,13 @@ class SeleniumHelper {
...
@@ -24,6 +26,13 @@ class SeleniumHelper {
]);
]);
}
}
elementIsVisible
(
element
)
{
return
this
.
driver
.
wait
(
until
.
elementIsVisible
(
element
));
}
elementIsNotVisible
(
element
)
{
return
this
.
driver
.
wait
(
until
.
elementIsNotVisible
(
element
));
}
get
scope
()
{
get
scope
()
{
// List of useful xpath scopes for finding elements
// List of useful xpath scopes for finding elements
return
{
return
{
...
...
This diff is collapsed.
Click to expand it.
test/integration/sprites.test.js
+
24
−
0
View file @
67074edb
...
@@ -4,6 +4,7 @@ import SeleniumHelper from '../helpers/selenium-helper';
...
@@ -4,6 +4,7 @@ import SeleniumHelper from '../helpers/selenium-helper';
const
{
const
{
clickText
,
clickText
,
clickXpath
,
clickXpath
,
elementIsVisible
,
findByText
,
findByText
,
findByXpath
,
findByXpath
,
getDriver
,
getDriver
,
...
@@ -124,4 +125,27 @@ describe('Working with sprites', () => {
...
@@ -124,4 +125,27 @@ describe('Working with sprites', () => {
const
logs
=
await
getLogs
();
const
logs
=
await
getLogs
();
await
expect
(
logs
).
toEqual
([]);
await
expect
(
logs
).
toEqual
([]);
});
});
test
(
'
Use browser back button to close library
'
,
async
()
=>
{
await
driver
.
get
(
'
https://www.google.com
'
);
await
loadUri
(
uri
);
await
clickXpath
(
'
//button[@title="Try It"]
'
);
await
clickText
(
'
Costumes
'
);
await
clickXpath
(
'
//button[@aria-label="Choose a Sprite"]
'
);
const
abbyElement
=
await
findByText
(
'
Abby
'
);
// Should show editor for new costume
await
elementIsVisible
(
abbyElement
);
await
driver
.
navigate
().
back
();
try
{
// should throw error because library is no longer visible
await
elementIsVisible
(
abbyElement
);
throw
'
ShouldNotGetHere
'
;
// eslint-disable-line no-throw-literal
}
catch
(
e
)
{
expect
(
e
.
constructor
.
name
).
toEqual
(
'
StaleElementReferenceError
'
);
}
const
costumesElement
=
await
findByText
(
'
Costumes
'
);
// Should show editor for new costume
await
elementIsVisible
(
costumesElement
);
const
logs
=
await
getLogs
();
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