@@ -31,17 +31,136 @@ describe('Abe', function() {
31
31
. setValue ( 'div[data-precontrib-templates=single] > div > input' , 'ftest' )
32
32
. click ( 'button[type="submit"]' )
33
33
. waitForElementVisible ( 'form[id="abeForm"]' , 2000 )
34
- . assert . urlEquals ( "http://localhost:3003/abe/editor/articles/ftest.html" , "Clicked URL Matches with URL of the New Window" )
35
- . end ( ) ;
34
+ . assert . urlEquals ( "http://localhost:3003/abe/editor/articles/ftest.html" , "Clicked URL Matches with URL of the New Window" ) ;
36
35
} ) ;
37
36
38
37
it ( 'The created single article is found in the manager' , function ( client ) {
39
38
client
40
39
. useXpath ( )
41
40
. url ( 'http://localhost:3003/abe/editor' )
42
41
. waitForElementVisible ( '//body' )
42
+ . pause ( 1000 )
43
+ . assert . containsText ( "//table[@id='navigation-list']/tbody/tr[1]/td[2]/a" , "/articles/ftest.html" ) ;
44
+ } ) ;
45
+
46
+ it ( 'The created single article is edited and updated with no change' , function ( client ) {
47
+ client
48
+ . useXpath ( )
49
+ . url ( 'http://localhost:3003/abe/editor/articles/ftest.html#slug' )
50
+ . waitForElementVisible ( '//body' )
51
+ . assert . title ( 'Abe' )
52
+ . click ( "//button[@class='btn btn-primary'][2]" )
53
+ . pause ( 2000 )
54
+ . assert . urlEquals ( "http://localhost:3003/abe/editor/articles/ftest.html" , "Clicked URL Matches with URL of the New Window" ) ;
55
+ } ) ;
56
+
57
+ it ( 'The updated single article is found in the manager' , function ( client ) {
58
+ client
59
+ . useXpath ( )
60
+ . url ( 'http://localhost:3003/abe/editor' )
61
+ . waitForElementVisible ( '//body' )
62
+ . pause ( 1000 )
63
+ . assert . containsText ( "//table[@id='navigation-list']/tbody/tr[1]/td[2]/a" , "/articles/ftest.html" ) ;
64
+ } ) ;
65
+
66
+ it ( 'The updated single article is edited once more with a new name' , function ( client ) {
67
+ client
68
+ . useXpath ( )
69
+ . url ( 'http://localhost:3003/abe/editor/articles/ftest.html#slug' )
70
+ . waitForElementVisible ( '//body' )
71
+ . assert . title ( 'Abe' )
72
+ . setValue ( "//div[@data-precontrib-templates='single']//input[@id='name']" , 'updated' )
73
+ . click ( "//button[@class='btn btn-primary'][2]" )
74
+ . pause ( 2000 )
75
+ . assert . urlEquals ( "http://localhost:3003/abe/editor/articles/ftestupdated.html" , "Clicked URL Matches with URL of the New Window" ) ;
76
+ } ) ;
77
+
78
+ it ( 'The updated single article is found in the manager' , function ( client ) {
79
+ client
80
+ . useXpath ( )
81
+ . url ( 'http://localhost:3003/abe/editor' )
82
+ . waitForElementVisible ( '//body' )
83
+ . pause ( 1000 )
84
+ . assert . containsText ( "//table[@id='navigation-list']/tbody/tr[1]/td[2]/a" , "/articles/ftestupdated.html" ) ;
85
+ } ) ;
86
+
87
+ it ( 'The updated single article is duplicated' , function ( client ) {
88
+ client
89
+ . useXpath ( )
90
+ . url ( 'http://localhost:3003/abe/editor/articles/ftestupdated.html#slug' )
91
+ . waitForElementVisible ( '//body' )
92
+ . assert . title ( 'Abe' )
93
+ . clearValue ( "//div[@data-precontrib-templates='single']//input[@id='name']" )
94
+ . setValue ( "//div[@data-precontrib-templates='single']//input[@id='name']" , 'ftest' )
95
+ . click ( "//button[@class='btn btn-primary'][1]" )
96
+ . pause ( 2000 )
97
+ . assert . urlEquals ( "http://localhost:3003/abe/editor/articles/ftest.html" , "Clicked URL Matches with URL of the New Window" ) ;
98
+ } ) ;
99
+
100
+ it ( 'The updated single article + duplicated are found in the manager' , function ( client ) {
101
+ client
102
+ . useXpath ( )
103
+ . url ( 'http://localhost:3003/abe/editor' )
104
+ . waitForElementVisible ( '//body' )
105
+ . pause ( 1000 )
43
106
. assert . containsText ( "//table[@id='navigation-list']/tbody/tr[1]/td[2]/a" , "/articles/ftest.html" )
44
- . end ( ) ;
107
+ . assert . containsText ( "//table[@id='navigation-list']/tbody/tr[2]/td[2]/a" , "/articles/ftestupdated.html" ) ;
108
+ } ) ;
109
+
110
+ it ( 'The updated article is deleted in the manager' , function ( client ) {
111
+ client
112
+ . useXpath ( )
113
+ . url ( 'http://localhost:3003/abe/editor' )
114
+ . waitForElementVisible ( '//body' )
115
+ . pause ( 1000 )
116
+ . click ( "//table[@id='navigation-list']/tbody/tr[2]/td[7]/div/a[last()]" )
117
+ . pause ( 1000 )
118
+ . acceptAlert ( )
119
+ . url ( 'http://localhost:3003/abe/editor' )
120
+ . pause ( 2000 )
121
+ . expect . element ( "//table[@id='navigation-list']/tbody/tr[2]/td[2]/a" ) . text . to . not . contain ( '/articles/ftestupdated.html' ) ;
122
+ } ) ;
123
+
124
+ it ( 'The updated single article is published' , function ( client ) {
125
+ client
126
+ . useXpath ( )
127
+ . url ( 'http://localhost:3003/abe/editor/articles/ftest.html#slug' )
128
+ . waitForElementVisible ( '//body' )
129
+ . assert . title ( 'Abe' )
130
+ . click ( "//div[@class='btns']/button[3]" )
131
+ . pause ( 2000 )
132
+ //.assert.containsText("//div[@class='display-status']/span", "publish")
133
+ . url ( 'http://localhost:3003/abe/editor' )
134
+ . waitForElementVisible ( '//body' )
135
+ . assert . cssClassPresent ( "//table[@id='navigation-list']/tbody/tr[1]/td[6]/a" , "label-published" ) ;
136
+ } ) ;
137
+
138
+ it ( 'The updated article is unpublished in the manager' , function ( client ) {
139
+ client
140
+ . useXpath ( )
141
+ . url ( 'http://localhost:3003/abe/editor' )
142
+ . waitForElementVisible ( '//body' )
143
+ . pause ( 1000 )
144
+ . click ( "//table[@id='navigation-list']/tbody/tr[1]/td[7]/div/a" )
145
+ . pause ( 1000 )
146
+ . acceptAlert ( )
147
+ . url ( 'http://localhost:3003/abe/editor' )
148
+ . pause ( 2000 )
149
+ . assert . cssClassPresent ( "//table[@id='navigation-list']/tbody/tr[1]/td[5]/a" , "label-draft" ) ;
150
+ } ) ;
151
+
152
+ it ( 'The updated article is deleted in the manager' , function ( client ) {
153
+ client
154
+ . useXpath ( )
155
+ . url ( 'http://localhost:3003/abe/editor' )
156
+ . waitForElementVisible ( '//body' )
157
+ . pause ( 1000 )
158
+ . click ( "//table[@id='navigation-list']/tbody/tr[1]/td[7]/div/a" )
159
+ . pause ( 1000 )
160
+ . acceptAlert ( )
161
+ . url ( 'http://localhost:3003/abe/editor' )
162
+ . pause ( 2000 )
163
+ . expect . element ( "//table[@id='navigation-list']/tbody/tr[1]/td[2]/a" ) . text . to . not . contain ( '/articles/ftest.html' ) ;
45
164
} ) ;
46
165
} ) ;
47
166
} ) ;
0 commit comments