|
| 1 | +module.exports = { |
| 2 | + 'Hash mode': function (browser) { |
| 3 | + browser |
| 4 | + .url('http://localhost:8080/hash-mode/') |
| 5 | + .waitForElementVisible('#app', 1000) |
| 6 | + .assert.count('li', 4) |
| 7 | + .assert.count('li a', 3) |
| 8 | + .assert.attributeContains('li:nth-child(1) a', 'href', '/hash-mode/#/') |
| 9 | + .assert.attributeContains('li:nth-child(2) a', 'href', '/hash-mode/#/foo') |
| 10 | + .assert.attributeContains('li:nth-child(3) a', 'href', '/hash-mode/#/bar') |
| 11 | + .assert.containsText('.view', 'home') |
| 12 | + |
| 13 | + .click('li:nth-child(2) a') |
| 14 | + .assert.urlEquals('http://localhost:8080/hash-mode/#/foo') |
| 15 | + .assert.containsText('.view', 'foo') |
| 16 | + |
| 17 | + .click('li:nth-child(3) a') |
| 18 | + .assert.urlEquals('http://localhost:8080/hash-mode/#/bar') |
| 19 | + .assert.containsText('.view', 'bar') |
| 20 | + |
| 21 | + .click('li:nth-child(1) a') |
| 22 | + .assert.urlEquals('http://localhost:8080/hash-mode/#/') |
| 23 | + .assert.containsText('.view', 'home') |
| 24 | + |
| 25 | + .click('li:nth-child(4)') |
| 26 | + .assert.urlEquals('http://localhost:8080/hash-mode/#/bar') |
| 27 | + .assert.containsText('.view', 'bar') |
| 28 | + |
| 29 | + // check initial visit |
| 30 | + .url('http://localhost:8080/hash-mode/#/foo') |
| 31 | + .waitForElementVisible('#app', 1000) |
| 32 | + .assert.containsText('.view', 'foo') |
| 33 | + .end() |
| 34 | + } |
| 35 | +} |
0 commit comments