diff options
Diffstat (limited to 'client/e2e/src/videos.e2e-spec.ts')
-rw-r--r-- | client/e2e/src/videos.e2e-spec.ts | 47 |
1 files changed, 20 insertions, 27 deletions
diff --git a/client/e2e/src/videos.e2e-spec.ts b/client/e2e/src/videos.e2e-spec.ts index c19ab3092..27706a506 100644 --- a/client/e2e/src/videos.e2e-spec.ts +++ b/client/e2e/src/videos.e2e-spec.ts | |||
@@ -31,7 +31,9 @@ describe('Videos workflow', () => { | |||
31 | let myAccountPage: MyAccountPage | 31 | let myAccountPage: MyAccountPage |
32 | let loginPage: LoginPage | 32 | let loginPage: LoginPage |
33 | 33 | ||
34 | const videoName = new Date().getTime() + ' video' | 34 | let videoName = new Date().getTime() + ' video' |
35 | const video2Name = new Date().getTime() + ' second video' | ||
36 | const playlistName = new Date().getTime() + ' playlist' | ||
35 | let videoWatchUrl: string | 37 | let videoWatchUrl: string |
36 | 38 | ||
37 | beforeEach(async () => { | 39 | beforeEach(async () => { |
@@ -122,41 +124,42 @@ describe('Videos workflow', () => { | |||
122 | 124 | ||
123 | await videoWatchPage.clickOnUpdate() | 125 | await videoWatchPage.clickOnUpdate() |
124 | 126 | ||
125 | await videoUpdatePage.updateName('my new name') | 127 | videoName += ' updated' |
128 | await videoUpdatePage.updateName(videoName) | ||
126 | 129 | ||
127 | await videoUpdatePage.validUpdate() | 130 | await videoUpdatePage.validUpdate() |
128 | 131 | ||
129 | const name = await videoWatchPage.getVideoName() | 132 | const name = await videoWatchPage.getVideoName() |
130 | expect(name).toEqual('my new name') | 133 | expect(name).toEqual(videoName) |
131 | }) | 134 | }) |
132 | 135 | ||
133 | it('Should add the video in my playlist', async () => { | 136 | it('Should add the video in my playlist', async () => { |
134 | if (await skipIfUploadNotSupported()) return | 137 | if (await skipIfUploadNotSupported()) return |
135 | 138 | ||
136 | await videoWatchPage.clickOnSave() | 139 | await videoWatchPage.clickOnSave() |
137 | await videoWatchPage.saveToWatchLater() | 140 | |
141 | await videoWatchPage.createPlaylist(playlistName) | ||
142 | |||
143 | await videoWatchPage.saveToPlaylist(playlistName) | ||
138 | 144 | ||
139 | await videoUploadPage.navigateTo() | 145 | await videoUploadPage.navigateTo() |
140 | 146 | ||
141 | await videoUploadPage.uploadVideo() | 147 | await videoUploadPage.uploadVideo() |
142 | await videoUploadPage.validSecondUploadStep('second video') | 148 | await videoUploadPage.validSecondUploadStep(video2Name) |
143 | 149 | ||
144 | await videoWatchPage.clickOnSave() | 150 | await videoWatchPage.clickOnSave() |
145 | await videoWatchPage.saveToWatchLater() | 151 | await videoWatchPage.saveToPlaylist(playlistName) |
146 | }) | 152 | }) |
147 | 153 | ||
148 | it('Should have the watch later playlist in my account', async () => { | 154 | it('Should have the playlist in my account', async () => { |
149 | if (await skipIfUploadNotSupported()) return | 155 | if (await skipIfUploadNotSupported()) return |
150 | 156 | ||
151 | await myAccountPage.navigateToMyPlaylists() | 157 | await myAccountPage.navigateToMyPlaylists() |
152 | 158 | ||
153 | const name = await myAccountPage.getLastUpdatedPlaylistName() | 159 | const videosNumberText = await myAccountPage.getPlaylistVideosText(playlistName) |
154 | expect(name).toEqual('Watch later') | ||
155 | |||
156 | const videosNumberText = await myAccountPage.getLastUpdatedPlaylistVideosText() | ||
157 | expect(videosNumberText).toEqual('2 videos') | 160 | expect(videosNumberText).toEqual('2 videos') |
158 | 161 | ||
159 | await myAccountPage.clickOnLastUpdatedPlaylist() | 162 | await myAccountPage.clickOnPlaylist(playlistName) |
160 | 163 | ||
161 | const count = await myAccountPage.countTotalPlaylistElements() | 164 | const count = await myAccountPage.countTotalPlaylistElements() |
162 | expect(count).toEqual(2) | 165 | expect(count).toEqual(2) |
@@ -167,35 +170,25 @@ describe('Videos workflow', () => { | |||
167 | 170 | ||
168 | await myAccountPage.playPlaylist() | 171 | await myAccountPage.playPlaylist() |
169 | 172 | ||
170 | await videoWatchPage.waitUntilVideoName('second video', 20000 * 1000) | 173 | await videoWatchPage.waitUntilVideoName(video2Name, 20000 * 1000) |
171 | }) | 174 | }) |
172 | 175 | ||
173 | it('Should have the video in my account', async () => { | 176 | it('Should delete the video 2', async () => { |
174 | if (await skipIfUploadNotSupported()) return | 177 | if (await skipIfUploadNotSupported()) return |
175 | 178 | ||
176 | await myAccountPage.navigateToMyVideos() | 179 | await myAccountPage.navigateToMyVideos() |
177 | 180 | ||
178 | const lastVideoName = await myAccountPage.getLastVideoName() | 181 | await myAccountPage.removeVideo(video2Name) |
179 | expect(lastVideoName).toEqual('second video') | ||
180 | }) | ||
181 | |||
182 | it('Should delete the last video', async () => { | ||
183 | if (await skipIfUploadNotSupported()) return | ||
184 | |||
185 | await myAccountPage.removeLastVideo() | ||
186 | await myAccountPage.validRemove() | 182 | await myAccountPage.validRemove() |
187 | 183 | ||
188 | const count = await myAccountPage.countVideos() | 184 | const count = await myAccountPage.countVideos([ videoName, video2Name ]) |
189 | expect(count).toEqual(1) | 185 | expect(count).toEqual(1) |
190 | }) | 186 | }) |
191 | 187 | ||
192 | it('Should delete the first video', async () => { | 188 | it('Should delete the first video', async () => { |
193 | if (await skipIfUploadNotSupported()) return | 189 | if (await skipIfUploadNotSupported()) return |
194 | 190 | ||
195 | await myAccountPage.removeLastVideo() | 191 | await myAccountPage.removeVideo(videoName) |
196 | await myAccountPage.validRemove() | 192 | await myAccountPage.validRemove() |
197 | |||
198 | const count = await myAccountPage.countVideos() | ||
199 | expect(count).toEqual(0) | ||
200 | }) | 193 | }) |
201 | }) | 194 | }) |