@@ -3,14 +3,18 @@ module.exports = {
33 browser
44 . url ( 'http://localhost:8080/redirect/' )
55 . waitForElementVisible ( '#app' , 1000 )
6- . assert . count ( 'li a' , 6 )
6+ . assert . count ( 'li a' , 10 )
77 // assert correct href with base
88 . assert . attributeContains ( 'li:nth-child(1) a' , 'href' , '/redirect/relative-redirect' )
99 . assert . attributeContains ( 'li:nth-child(2) a' , 'href' , '/redirect/relative-redirect?foo=bar' )
1010 . assert . attributeContains ( 'li:nth-child(3) a' , 'href' , '/redirect/absolute-redirect' )
11- . assert . attributeContains ( 'li:nth-child(4) a' , 'href' , '/redirect/named-redirect' )
12- . assert . attributeContains ( 'li:nth-child(5) a' , 'href' , '/redirect/redirect-with-params/123' )
13- . assert . attributeContains ( 'li:nth-child(6) a' , 'href' , '/not-found' )
11+ . assert . attributeContains ( 'li:nth-child(4) a' , 'href' , '/redirect/dynamic-redirect' )
12+ . assert . attributeContains ( 'li:nth-child(5) a' , 'href' , '/redirect/dynamic-redirect/123' )
13+ . assert . attributeContains ( 'li:nth-child(6) a' , 'href' , '/redirect/dynamic-redirect?to=foo' )
14+ . assert . attributeContains ( 'li:nth-child(7) a' , 'href' , '/redirect/dynamic-redirect#baz' )
15+ . assert . attributeContains ( 'li:nth-child(8) a' , 'href' , '/redirect/named-redirect' )
16+ . assert . attributeContains ( 'li:nth-child(9) a' , 'href' , '/redirect/redirect-with-params/123' )
17+ . assert . attributeContains ( 'li:nth-child(10) a' , 'href' , '/not-found' )
1418
1519 . assert . containsText ( '.view' , 'default' )
1620
@@ -27,14 +31,30 @@ module.exports = {
2731 . assert . containsText ( '.view' , 'bar' )
2832
2933 . click ( 'li:nth-child(4) a' )
30- . assert . urlEquals ( 'http://localhost:8080/redirect/baz ' )
31- . assert . containsText ( '.view' , 'baz ' )
34+ . assert . urlEquals ( 'http://localhost:8080/redirect/bar ' )
35+ . assert . containsText ( '.view' , 'bar ' )
3236
3337 . click ( 'li:nth-child(5) a' )
3438 . assert . urlEquals ( 'http://localhost:8080/redirect/with-params/123' )
3539 . assert . containsText ( '.view' , '123' )
3640
3741 . click ( 'li:nth-child(6) a' )
42+ . assert . urlEquals ( 'http://localhost:8080/redirect/foo' )
43+ . assert . containsText ( '.view' , 'foo' )
44+
45+ . click ( 'li:nth-child(7) a' )
46+ . assert . urlEquals ( 'http://localhost:8080/redirect/baz' )
47+ . assert . containsText ( '.view' , 'baz' )
48+
49+ . click ( 'li:nth-child(8) a' )
50+ . assert . urlEquals ( 'http://localhost:8080/redirect/baz' )
51+ . assert . containsText ( '.view' , 'baz' )
52+
53+ . click ( 'li:nth-child(9) a' )
54+ . assert . urlEquals ( 'http://localhost:8080/redirect/with-params/123' )
55+ . assert . containsText ( '.view' , '123' )
56+
57+ . click ( 'li:nth-child(10) a' )
3858 . assert . urlEquals ( 'http://localhost:8080/redirect/' )
3959 . assert . containsText ( '.view' , 'default' )
4060
@@ -54,6 +74,26 @@ module.exports = {
5474 . assert . urlEquals ( 'http://localhost:8080/redirect/bar' )
5575 . assert . containsText ( '.view' , 'bar' )
5676
77+ . url ( 'http://localhost:8080/redirect/dynamic-redirect' )
78+ . waitForElementVisible ( '#app' , 1000 )
79+ . assert . urlEquals ( 'http://localhost:8080/redirect/bar' )
80+ . assert . containsText ( '.view' , 'bar' )
81+
82+ . url ( 'http://localhost:8080/redirect/dynamic-redirect/123' )
83+ . waitForElementVisible ( '#app' , 1000 )
84+ . assert . urlEquals ( 'http://localhost:8080/redirect/with-params/123' )
85+ . assert . containsText ( '.view' , '123' )
86+
87+ . url ( 'http://localhost:8080/redirect/dynamic-redirect?to=foo' )
88+ . waitForElementVisible ( '#app' , 1000 )
89+ . assert . urlEquals ( 'http://localhost:8080/redirect/foo' )
90+ . assert . containsText ( '.view' , 'foo' )
91+
92+ . url ( 'http://localhost:8080/redirect/dynamic-redirect#baz' )
93+ . waitForElementVisible ( '#app' , 1000 )
94+ . assert . urlEquals ( 'http://localhost:8080/redirect/baz' )
95+ . assert . containsText ( '.view' , 'baz' )
96+
5797 . url ( 'http://localhost:8080/redirect/named-redirect' )
5898 . waitForElementVisible ( '#app' , 1000 )
5999 . assert . urlEquals ( 'http://localhost:8080/redirect/baz' )
0 commit comments