@@ -7,10 +7,11 @@ import {
77 downloadFirstFile ,
88 dragAndDropFile ,
99 playwrightConfig ,
10+ requireShareLink ,
1011 saveClipboardItem ,
1112} from "../../utils/dev/testUtils" ;
1213
13- const { password, timeout, shareLinks , fileLinks } = playwrightConfig ;
14+ const { password, timeout, fileLinks } = playwrightConfig ;
1415
1516export async function upload_workflow ( { page } : PlaywrightProps ) {
1617 const { folderRowSelector, folderRowTestID, fileCountID, uploadButton, dropZone, tableCellID, passwordInput } =
@@ -150,13 +151,13 @@ export async function download_workflow({ page, context }: PlaywrightProps) {
150151
151152 // Regular window downloads
152153 let otherPage = await context . newPage ( ) ;
153- await otherPage . goto ( shareLinks [ "folder-no-password" ] ! ) ;
154+ await otherPage . goto ( requireShareLink ( "folder-no-password" ) ) ;
154155 await otherPage . waitForLoadState ( "networkidle" ) ;
155156 await downloadFirstFile ( otherPage ) ;
156157 await otherPage . close ( ) ;
157158
158159 otherPage = await context . newPage ( ) ;
159- await otherPage . goto ( shareLinks [ "folder-with-password" ] ! ) ;
160+ await otherPage . goto ( requireShareLink ( "folder-with-password" ) ) ;
160161 await otherPage . waitForLoadState ( "networkidle" ) ;
161162 await otherPage . getByTestId ( passwordInputID ) . fill ( password ) ;
162163 await otherPage . getByTestId ( submitButtonID ) . click ( ) ;
@@ -176,14 +177,14 @@ export async function download_workflow({ page, context }: PlaywrightProps) {
176177
177178 // Download share link (folder) without password
178179 otherPage = await incognitoContext . newPage ( ) ;
179- await otherPage . goto ( shareLinks [ "folder-no-password" ] ! ) ;
180+ await otherPage . goto ( requireShareLink ( "folder-no-password" ) ) ;
180181 await otherPage . waitForLoadState ( "networkidle" ) ;
181182 await downloadFirstFile ( otherPage ) ;
182183 await otherPage . close ( ) ;
183184
184185 // Download share link (folder) with password
185186 otherPage = await incognitoContext . newPage ( ) ;
186- await otherPage . goto ( shareLinks [ "folder-with-password" ] ! ) ;
187+ await otherPage . goto ( requireShareLink ( "folder-with-password" ) ) ;
187188 await otherPage . waitForLoadState ( "networkidle" ) ;
188189 await otherPage . getByTestId ( passwordInputID ) . fill ( password ) ;
189190 await otherPage . getByTestId ( submitButtonID ) . click ( ) ;
@@ -193,14 +194,14 @@ export async function download_workflow({ page, context }: PlaywrightProps) {
193194
194195 // Download individual file without password
195196 otherPage = await incognitoContext . newPage ( ) ;
196- await otherPage . goto ( shareLinks [ "file-no-password" ] ! ) ;
197+ await otherPage . goto ( requireShareLink ( "file-no-password" ) ) ;
197198 await otherPage . waitForLoadState ( "networkidle" ) ;
198199 await downloadFirstFile ( otherPage ) ;
199200 await otherPage . close ( ) ;
200201
201202 // Download individual file with password
202203 otherPage = await incognitoContext . newPage ( ) ;
203- await otherPage . goto ( shareLinks [ "file-with-password" ] ! ) ;
204+ await otherPage . goto ( requireShareLink ( "file-with-password" ) ) ;
204205 await otherPage . waitForLoadState ( "networkidle" ) ;
205206 await otherPage . getByTestId ( passwordInputID ) . fill ( password ) ;
206207 await otherPage . getByTestId ( submitButtonID ) . click ( ) ;
@@ -239,12 +240,12 @@ export async function delete_file({ page }: PlaywrightProps) {
239240
240241 // Check that the share links are no longer accessible
241242 // Folder no password link
242- await page . goto ( shareLinks [ "folder-no-password" ] ! ) ;
243+ await page . goto ( requireShareLink ( "folder-no-password" ) ) ;
243244 await page . waitForLoadState ( "networkidle" ) ;
244245 expect ( await page . getByTestId ( "not_found" ) . textContent ( ) ) . toContain ( "This link is no longer active" ) ;
245246
246247 // Folder with password link
247- await page . goto ( shareLinks [ "folder-with-password" ] ! ) ;
248+ await page . goto ( requireShareLink ( "folder-with-password" ) ) ;
248249 await page . waitForLoadState ( "networkidle" ) ;
249250 await page . getByTestId ( passwordInputID ) . fill ( password ) ;
250251 await page . getByTestId ( submitButtonID ) . click ( ) ;
0 commit comments