Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
todomvc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Sven Franck
todomvc
Commits
a88a5bf2
Commit
a88a5bf2
authored
Jun 01, 2015
by
Sam Saccone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: Enable dynamic finding of elements
Allowing for multiple lookup selectors.
parent
f81ae654
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
7 deletions
+20
-7
tests/page.js
tests/page.js
+20
-7
No files found.
tests/page.js
View file @
a88a5bf2
...
...
@@ -103,15 +103,28 @@ module.exports = function Page(browser) {
return
this
.
tryFindByXpath
(
xpath
);
};
// ----------------- page actions
this
.
ensureAppIsVisible
=
function
()
{
return
browser
.
findElements
(
webdriver
.
By
.
css
(
'
#todoapp
'
))
this
.
findFirstExisting
=
function
()
{
var
args
=
[].
slice
.
call
(
arguments
);
if
(
args
.
length
===
0
)
{
throw
new
Error
(
'
Unable to find any matching elements
'
);
}
return
browser
.
findElements
(
args
.
pop
())
.
then
(
function
(
elms
)
{
if
(
elms
.
length
>
0
)
{
return
true
;
}
else
{
throw
new
Error
(
'
Unable to find application root, did you start your local server?
'
);
if
(
elms
.
length
)
{
return
elms
[
0
];
}
return
this
.
findFirstExisting
(
args
);
}.
bind
(
this
));
};
// ----------------- page actions
this
.
ensureAppIsVisible
=
function
()
{
return
this
.
findFirstExisting
(
webdriver
.
By
.
css
(
'
#todoapp
'
),
webdriver
.
By
.
css
(
'
.todoapp
'
))
.
thenCatch
(
function
()
{
throw
new
Error
(
'
Unable to find application root, did you start your local server?
'
);
});
};
...
...
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