|
|
@@ -5,8 +5,8 @@ module.exports = {
|
|
|
browser
|
|
|
.url('http://localhost:8080/examples/grid/')
|
|
|
.waitForElementVisible('table', 1000)
|
|
|
- .assert.elementCount('th', 2)
|
|
|
- .assert.elementCount('th.active', 0)
|
|
|
+ .assert.count('th', 2)
|
|
|
+ .assert.count('th.active', 0)
|
|
|
.assert.containsText('th:nth-child(1)', 'Name')
|
|
|
.assert.containsText('th:nth-child(2)', 'Power')
|
|
|
assertTable([
|
|
|
@@ -18,10 +18,10 @@ module.exports = {
|
|
|
|
|
|
browser
|
|
|
.click('th:nth-child(1)')
|
|
|
- .assert.elementCount('th.active:nth-child(1)', 1)
|
|
|
- .assert.elementCount('th.active:nth-child(2)', 0)
|
|
|
- .assert.elementCount('th:nth-child(1) .arrow.dsc', 1)
|
|
|
- .assert.elementCount('th:nth-child(2) .arrow.dsc', 0)
|
|
|
+ .assert.count('th.active:nth-child(1)', 1)
|
|
|
+ .assert.count('th.active:nth-child(2)', 0)
|
|
|
+ .assert.count('th:nth-child(1) .arrow.dsc', 1)
|
|
|
+ .assert.count('th:nth-child(2) .arrow.dsc', 0)
|
|
|
assertTable([
|
|
|
{ name: 'Jet Li', power: 8000 },
|
|
|
{ name: 'Jackie Chan', power: 7000 },
|
|
|
@@ -31,10 +31,10 @@ module.exports = {
|
|
|
|
|
|
browser
|
|
|
.click('th:nth-child(2)')
|
|
|
- .assert.elementCount('th.active:nth-child(1)', 0)
|
|
|
- .assert.elementCount('th.active:nth-child(2)', 1)
|
|
|
- .assert.elementCount('th:nth-child(1) .arrow.dsc', 1)
|
|
|
- .assert.elementCount('th:nth-child(2) .arrow.dsc', 1)
|
|
|
+ .assert.count('th.active:nth-child(1)', 0)
|
|
|
+ .assert.count('th.active:nth-child(2)', 1)
|
|
|
+ .assert.count('th:nth-child(1) .arrow.dsc', 1)
|
|
|
+ .assert.count('th:nth-child(2) .arrow.dsc', 1)
|
|
|
assertTable([
|
|
|
{ name: 'Chuck Norris', power: Infinity },
|
|
|
{ name: 'Bruce Lee', power: 9000 },
|
|
|
@@ -44,10 +44,10 @@ module.exports = {
|
|
|
|
|
|
browser
|
|
|
.click('th:nth-child(2)')
|
|
|
- .assert.elementCount('th.active:nth-child(1)', 0)
|
|
|
- .assert.elementCount('th.active:nth-child(2)', 1)
|
|
|
- .assert.elementCount('th:nth-child(1) .arrow.dsc', 1)
|
|
|
- .assert.elementCount('th:nth-child(2) .arrow.asc', 1)
|
|
|
+ .assert.count('th.active:nth-child(1)', 0)
|
|
|
+ .assert.count('th.active:nth-child(2)', 1)
|
|
|
+ .assert.count('th:nth-child(1) .arrow.dsc', 1)
|
|
|
+ .assert.count('th:nth-child(2) .arrow.asc', 1)
|
|
|
assertTable([
|
|
|
{ name: 'Jackie Chan', power: 7000 },
|
|
|
{ name: 'Jet Li', power: 8000 },
|
|
|
@@ -57,10 +57,10 @@ module.exports = {
|
|
|
|
|
|
browser
|
|
|
.click('th:nth-child(1)')
|
|
|
- .assert.elementCount('th.active:nth-child(1)', 1)
|
|
|
- .assert.elementCount('th.active:nth-child(2)', 0)
|
|
|
- .assert.elementCount('th:nth-child(1) .arrow.asc', 1)
|
|
|
- .assert.elementCount('th:nth-child(2) .arrow.asc', 1)
|
|
|
+ .assert.count('th.active:nth-child(1)', 1)
|
|
|
+ .assert.count('th.active:nth-child(2)', 0)
|
|
|
+ .assert.count('th:nth-child(1) .arrow.asc', 1)
|
|
|
+ .assert.count('th:nth-child(2) .arrow.asc', 1)
|
|
|
assertTable([
|
|
|
{ name: 'Bruce Lee', power: 9000 },
|
|
|
{ name: 'Chuck Norris', power: Infinity },
|
|
|
@@ -85,7 +85,7 @@ module.exports = {
|
|
|
browser.end()
|
|
|
|
|
|
function assertTable (data) {
|
|
|
- browser.assert.elementCount('td', data.length * columns.length)
|
|
|
+ browser.assert.count('td', data.length * columns.length)
|
|
|
for (var i = 0; i < data.length; i++) {
|
|
|
for (var j = 0; j < columns.length; j++) {
|
|
|
browser.assert.containsText(
|