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
Eugene Shen
todomvc
Commits
0fe43bab
Commit
0fe43bab
authored
9 years ago
by
Sam Saccone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wip
parent
9f5e3f03
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
7 deletions
+19
-7
tests/page.js
tests/page.js
+19
-7
No files found.
tests/page.js
View file @
0fe43bab
...
...
@@ -87,11 +87,17 @@ module.exports = function Page(browser) {
};
this
.
getItemElements
=
function
()
{
return
this
.
tryFindByXpath
(
this
.
getTodoListXpath
()
+
'
/li
'
);
return
this
.
getTodoListXpath
()
.
then
(
function
(
xpath
)
{
return
this
.
tryFindByXpath
(
xpath
+
'
/li
'
);
}.
bind
(
this
));
};
this
.
getNonCompletedItemElements
=
function
()
{
return
this
.
tryFindByXpath
(
this
.
getTodoListXpath
()
+
'
/li[not(contains(@class,"completed"))]
'
);
return
this
.
getTodoListXpath
()
.
then
(
function
(
xpath
)
{
return
this
.
tryFindByXpath
(
xpath
+
'
/li[not(contains(@class,"completed"))]
'
);
}.
bind
(
this
));
};
this
.
getItemsCountElement
=
function
()
{
...
...
@@ -107,8 +113,10 @@ module.exports = function Page(browser) {
};
this
.
getItemLabels
=
function
()
{
var
xpath
=
this
.
getTodoListXpath
()
+
'
/li//label
'
;
return
this
.
tryFindByXpath
(
xpath
);
return
this
.
getTodoListXpath
()
.
then
(
function
(
xpath
)
{
return
this
.
tryFindByXpath
(
xpath
+
'
/li//label
'
);
}.
bind
(
this
));
};
this
.
findFirstExisting
=
function
()
{
...
...
@@ -150,9 +158,13 @@ module.exports = function Page(browser) {
};
this
.
enterItem
=
function
(
itemText
)
{
var
textField
=
this
.
getItemInputField
();
textField
.
sendKeys
(
itemText
);
textField
.
sendKeys
(
webdriver
.
Key
.
ENTER
);
return
this
.
getItemInputField
()
.
then
(
function
(
textField
)
{
return
textField
.
sendKeys
(
itemText
)
.
then
(
function
()
{
return
textField
.
sendKeys
(
webdriver
.
Key
.
ENTER
);
});
});
};
this
.
toggleItemAtIndex
=
function
(
index
)
{
...
...
This diff is collapsed.
Click to expand it.
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