Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Aug 14, 2016
1 parent 58fcf56 commit 9024df1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"eslint-plugin-html": "^1.5.1",
"file-loader": "^0.9.0",
"nightwatch": "^0.9.4",
"nightwatch-helpers": "^1.2.0",
"selenium-server": "2.52.0",
"stylus": "^0.54.5",
"stylus-loader": "^2.1.1",
Expand Down
3 changes: 2 additions & 1 deletion test/nightwatch.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"src_folders" : ["test/specs"],
"custom_assertions_path": ["test/assertions"],
"custom_commands_path": ["node_modules/nightwatch-helpers/commands"],
"custom_assertions_path": ["node_modules/nightwatch-helpers/assertions"],

"selenium" : {
"start_process" : true,
Expand Down
20 changes: 10 additions & 10 deletions test/specs/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module.exports = {
'vue-devtools e2e tests': function (browser) {
browser
.url('http://localhost:' + (process.env.PORT || 8081))
.waitForElementVisible('.app', 5000)
.waitForElementVisible('.message', 1000)
.assert.containsText('.message', 'Ready. Detected Vue')
.assert.elementPresent('.instance')
.assert.containsText('.instance', 'Root')
Expand All @@ -16,7 +16,7 @@ module.exports = {
.assert.containsText('.data-field', 'obj: Object')

// should expand root by default
.assert.elementCount('.instance', 4)
.assert.count('.instance', 4)

// select child instance
.click('.instance .instance:nth-child(1) .self')
Expand All @@ -27,24 +27,24 @@ module.exports = {

// expand child instance
.click('.instance .instance:nth-child(2) .arrow-wrapper')
.assert.elementCount('.instance', 6)
.assert.count('.instance', 6)

// add/remove component from app side
.frame('target')
.click('.add')
.frame(null)
.assert.elementCount('.instance', 9)
.assert.count('.instance', 9)
.frame('target')
.click('.remove')
.frame(null)
.assert.elementCount('.instance', 8)
.assert.count('.instance', 8)

// filter components
.setValue('.search-box', 'counter')
.assert.elementCount('.instance', 1)
.assert.count('.instance', 1)
.clearValue('.search-box')
.setValue('.search-box', 'target')
.assert.elementCount('.instance', 5)
.assert.count('.instance', 5)

// vuex
.frame('target')
Expand All @@ -54,7 +54,7 @@ module.exports = {
.assert.containsText('#counter p', '1')
.frame(null)
.click('.button.vuex')
.assert.elementCount('.history .entry', 4)
.assert.count('.history .entry', 4)
.assert.containsText('.vuex-state-inspector', 'type: "DECREMENT"')
.assert.containsText('.vuex-state-inspector', 'count: 1')

Expand Down Expand Up @@ -85,7 +85,7 @@ module.exports = {
// revert
.click('.history .entry:nth-child(4)')
.click('.history .entry:nth-child(4) .action:nth-child(2)')
.assert.elementCount('.history .entry', 3)
.assert.count('.history .entry', 3)
.assert.cssClassPresent('.history .entry:nth-child(3)', 'active')
.assert.containsText('.vuex-state-inspector', 'count: 2')
.frame('target')
Expand All @@ -94,7 +94,7 @@ module.exports = {

// commit
.click('.history .entry:nth-child(3) .action')
.assert.elementCount('.history .entry', 1)
.assert.count('.history .entry', 1)
.assert.cssClassPresent('.history .entry:nth-child(1)', 'active')
.assert.containsText('.vuex-state-inspector', 'count: 2')
.frame('target')
Expand Down

0 comments on commit 9024df1

Please sign in to comment.