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
4a4016ff
Commit
4a4016ff
authored
Jan 29, 2014
by
Pascal Hartig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update browser-tests JS style
parent
d7be11ee
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
841 additions
and
819 deletions
+841
-819
browser-tests/Gruntfile.js
browser-tests/Gruntfile.js
+14
-15
browser-tests/allTests.js
browser-tests/allTests.js
+46
-27
browser-tests/knownIssues.js
browser-tests/knownIssues.js
+87
-87
browser-tests/page.js
browser-tests/page.js
+146
-146
browser-tests/pageLaxMode.js
browser-tests/pageLaxMode.js
+19
-19
browser-tests/test.js
browser-tests/test.js
+371
-370
browser-tests/testOperations.js
browser-tests/testOperations.js
+158
-155
No files found.
browser-tests/Gruntfile.js
View file @
4a4016ff
module
.
exports
=
function
(
grunt
)
{
grunt
.
loadNpmTasks
(
'
grunt-simple-mocha
'
);
'
use strict
'
;
grunt
.
loadNpmTasks
(
'
grunt-simple-mocha
'
);
var
gruntConfig
=
{
simplemocha
:
{
options
:
{
reporter
:
'
mocha-known-issues-reporter
'
},
files
:
{
src
:
'
allTests.js
'
}
}
};
grunt
.
initConfig
(
gruntConfig
);
grunt
.
initConfig
({
simplemocha
:
{
options
:
{
reporter
:
'
mocha-known-issues-reporter
'
},
files
:
{
src
:
'
allTests.js
'
}
}
});
// build tasks
grunt
.
registerTask
(
'
test
'
,
[
'
simplemocha
'
]);
// build tasks
grunt
.
registerTask
(
'
test
'
,
[
'
simplemocha
'
]);
};
browser-tests/allTests.js
View file @
4a4016ff
var
testSuite
=
require
(
'
./test.js
'
),
fs
=
require
(
'
fs
'
),
argv
=
require
(
'
optimist
'
).
default
(
'
laxMode
'
,
false
).
argv
,
rootUrl
=
"
http://localhost:8000/
"
,
frameworkNamePattern
=
/^
[
a-z-_
]
+$/
;
'
use strict
'
;
// collect together the framework names from each of the subfolders
var
list
=
fs
.
readdirSync
(
"
../architecture-examples/
"
)
.
map
(
function
(
folderName
)
{
return
{
name
:
folderName
,
path
:
"
architecture-examples/
"
+
folderName
}
});
list
=
list
.
concat
(
fs
.
readdirSync
(
"
../labs/architecture-examples/
"
)
.
map
(
function
(
folderName
)
{
return
{
name
:
folderName
,
path
:
"
labs/architecture-examples/
"
+
folderName
}
}));
list
=
list
.
concat
(
fs
.
readdirSync
(
"
../labs/dependency-examples/
"
)
.
map
(
function
(
folderName
)
{
return
{
name
:
folderName
,
path
:
"
labs/dependency-examples/
"
+
folderName
}
}));
var
testSuite
=
require
(
'
./test.js
'
);
var
fs
=
require
(
'
fs
'
);
var
argv
=
require
(
'
optimist
'
).
default
(
'
laxMode
'
,
false
).
argv
;
var
rootUrl
=
'
http://localhost:8000/
'
;
var
frameworkNamePattern
=
/^
[
a-z-_
]
+$/
;
list
=
list
.
concat
(
fs
.
readdirSync
(
"
../dependency-examples/
"
)
.
map
(
function
(
folderName
)
{
return
{
name
:
folderName
,
path
:
"
dependency-examples/
"
+
folderName
}
}));
// collect together the framework names from each of the subfolders
var
list
=
fs
.
readdirSync
(
'
../architecture-examples/
'
)
.
map
(
function
(
folderName
)
{
return
{
name
:
folderName
,
path
:
'
architecture-examples/
'
+
folderName
};
})
.
concat
(
fs
.
readdirSync
(
'
../labs/architecture-examples/
'
)
.
map
(
function
(
folderName
)
{
return
{
name
:
folderName
,
path
:
'
labs/architecture-examples/
'
+
folderName
};
})
)
.
concat
(
fs
.
readdirSync
(
'
../labs/dependency-examples/
'
)
.
map
(
function
(
folderName
)
{
return
{
name
:
folderName
,
path
:
'
labs/dependency-examples/
'
+
folderName
};
})
)
.
concat
(
fs
.
readdirSync
(
'
../dependency-examples/
'
)
.
map
(
function
(
folderName
)
{
return
{
name
:
folderName
,
path
:
'
dependency-examples/
'
+
folderName
};
})
);
// apps that are not hosted at the root of their folder need to be handled explicitly
var
exceptions
=
[
{
name
:
"
chaplin-brunch
"
,
path
:
"
labs/dependency-examples/chaplin-brunch/public
"
}
{
name
:
'
chaplin-brunch
'
,
path
:
'
labs/dependency-examples/chaplin-brunch/public
'
}
];
list
=
list
.
map
(
function
(
framework
)
{
var
exception
=
exceptions
.
filter
(
function
(
exFramework
)
{
return
exFramework
.
name
===
framework
.
name
});
return
exception
.
length
>
0
?
exception
[
0
]
:
framework
;
list
=
list
.
map
(
function
(
framework
)
{
var
exception
=
exceptions
.
filter
(
function
(
exFramework
)
{
return
exFramework
.
name
===
framework
.
name
;
});
return
exception
.
length
>
0
?
exception
[
0
]
:
framework
;
});
// filter out any folders that are not frameworks (.e.g hidden files)
list
=
list
.
filter
(
function
(
framework
)
{
return
frameworkNamePattern
.
test
(
framework
.
name
);
});
list
=
list
.
filter
(
function
(
framework
)
{
return
frameworkNamePattern
.
test
(
framework
.
name
);
});
// if a specific framework has been named, just run this one
if
(
argv
.
framework
)
{
list
=
list
.
filter
(
function
(
framework
)
{
return
framework
.
name
===
argv
.
framework
});
if
(
argv
.
framework
)
{
list
=
list
.
filter
(
function
(
framework
)
{
return
framework
.
name
===
argv
.
framework
;
});
}
// run the tests for each framework
var
testIndex
=
1
;
list
.
forEach
(
function
(
framework
)
{
testSuite
.
todoMVCTest
(
framework
.
name
,
rootUrl
+
framework
.
path
+
"
/index.html
"
,
argv
.
speedMode
,
argv
.
laxMode
);
list
.
forEach
(
function
(
framework
)
{
testSuite
.
todoMVCTest
(
framework
.
name
,
rootUrl
+
framework
.
path
+
'
/index.html
'
,
argv
.
speedMode
,
argv
.
laxMode
);
});
browser-tests/knownIssues.js
View file @
4a4016ff
This diff is collapsed.
Click to expand it.
browser-tests/page.js
View file @
4a4016ff
This diff is collapsed.
Click to expand it.
browser-tests/pageLaxMode.js
View file @
4a4016ff
var
webdriver
=
require
(
'
selenium-webdriver
'
),
Page
=
require
(
"
./page
"
);
'
use strict
'
;
function
PageLaxMode
(
browser
)
{
Page
.
apply
(
this
,
[
browser
]
);
var
webdriver
=
require
(
'
selenium-webdriver
'
);
var
Page
=
require
(
'
./page
'
);
this
.
tryGetToggleForItemAtIndex
=
function
(
index
)
{
// the specification dictates that the checkbox should have the 'toggle' CSS class. Some implementations deviate from
// this, hence in lax mode we simply look for any checkboxes within the specified 'li'.
var
xpath
=
this
.
xPathForItemAtIndex
(
index
)
+
"
//input[@type='checkbox']
"
;
return
browser
.
findElements
(
webdriver
.
By
.
xpath
(
xpath
));
}
module
.
exports
=
function
PageLaxMode
(
browser
)
{
Page
.
apply
(
this
,
[
browser
]);
this
.
getEditInputForItemAtIndex
=
function
(
index
)
{
// the specification dictates that the input element that allows the user to edit a todo item should have a CSS
// class of 'edit'. In lax mode, we also look for an input of type 'text'.
this
.
tryGetToggleForItemAtIndex
=
function
(
index
)
{
// the specification dictates that the checkbox should have the 'toggle' CSS class. Some implementations deviate from
// this, hence in lax mode we simply look for any checkboxes within the specified 'li'.
var
xpath
=
this
.
xPathForItemAtIndex
(
index
)
+
'
//input[@type="checkbox"]
'
;
return
browser
.
findElements
(
webdriver
.
By
.
xpath
(
xpath
));
};
var
xpath
=
"
(
"
+
this
.
xPathForItemAtIndex
(
index
)
+
"
//input[@type='text']
"
+
"
|
"
+
this
.
xPathForItemAtIndex
(
index
)
+
"
//input[contains(@class,'edit')]
"
+
"
)
"
;
return
browser
.
findElement
(
webdriver
.
By
.
xpath
(
xpath
));
}
}
this
.
getEditInputForItemAtIndex
=
function
(
index
)
{
// the specification dictates that the input element that allows the user to edit a todo item should have a CSS
// class of 'edit'. In lax mode, we also look for an input of type 'text'.
module
.
exports
=
PageLaxMode
;
\ No newline at end of file
var
xpath
=
'
(
'
+
this
.
xPathForItemAtIndex
(
index
)
+
'
//input[@type="text"]
'
+
'
|
'
+
this
.
xPathForItemAtIndex
(
index
)
+
'
//input[contains(@class,"edit")]
'
+
'
)
'
;
return
browser
.
findElement
(
webdriver
.
By
.
xpath
(
xpath
));
};
};
browser-tests/test.js
View file @
4a4016ff
This diff is collapsed.
Click to expand it.
browser-tests/testOperations.js
View file @
4a4016ff
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