diff --git a/packages/e2e/cypress/integration/common/shared.ts b/packages/e2e/cypress/integration/common/shared.ts index cb7fe2ba46..6b1f22b963 100644 --- a/packages/e2e/cypress/integration/common/shared.ts +++ b/packages/e2e/cypress/integration/common/shared.ts @@ -655,3 +655,9 @@ When( (folderName: string, count: string) => cy.fileInputUpload(`${folderName}/${randomFileName}`, parseInt(count)) ); + +When('A network failure occurs', () => { + cy.intercept('', (req) => { + req.destroy(); + }); +}); diff --git a/packages/e2e/features/ui/components/storage/storage-browser/action-menu.feature b/packages/e2e/features/ui/components/storage/storage-browser/action-menu.feature index 66db29817e..e2e4f2dcd3 100644 --- a/packages/e2e/features/ui/components/storage/storage-browser/action-menu.feature +++ b/packages/e2e/features/ui/components/storage/storage-browser/action-menu.feature @@ -2,12 +2,12 @@ Feature: Create folder with Storage Browser Background: Given I'm running the example "ui/components/storage/storage-browser/default-auth" + And I type my "email" with status "CONFIRMED" + And I type my password + And I click the "Sign in" button @react Scenario: Create folder successfully creates a new empty folder - When I type my "email" with status "CONFIRMED" - Then I type my password - Then I click the "Sign in" button When I click the first button containing "public" When I click the first button containing "DoNotDeleteThisFolder_CanDeleteAllChildren" Then I see the "Menu Toggle" button @@ -29,9 +29,6 @@ Feature: Create folder with Storage Browser @react Scenario: Create folder fails on overwrite of existing folder name - When I type my "email" with status "CONFIRMED" - Then I type my password - Then I click the "Sign in" button When I click the first button containing "public" Then I see the "Menu Toggle" button When I click the "Menu Toggle" button @@ -47,9 +44,6 @@ Feature: Create folder with Storage Browser @react Scenario: Create folder input shows error message when folder name contains "/" - When I type my "email" with status "CONFIRMED" - Then I type my password - Then I click the "Sign in" button When I click the first button containing "public" Then I see the "Menu Toggle" button When I click the "Menu Toggle" button @@ -64,9 +58,6 @@ Feature: Create folder with Storage Browser @react Scenario: upload, list, copy and delete a file using toggle menu - When I type my "email" with status "CONFIRMED" - Then I type my password - Then I click the "Sign in" button When I click the first button containing "public" Then I see the "Menu Toggle" button When I click the "Menu Toggle" button @@ -109,9 +100,6 @@ Feature: Create folder with Storage Browser @react Scenario: upload a folder - When I type my "email" with status "CONFIRMED" - Then I type my password - Then I click the "Sign in" button When I click the first button containing "public" Then I see the "Menu Toggle" button When I click the "Menu Toggle" button @@ -134,3 +122,55 @@ Feature: Create folder with Storage Browser Then I click the "Delete" button Then I see "All files deleted" + @react + Scenario: Upload file shows a Network error if offline + When I click the first button containing "public" + Then I see the "Menu Toggle" button + When I click the "Menu Toggle" button + Then I see the "Upload" menuitem + When I click the "Upload" menuitem + Then I upload "1" files with random names + When A network failure occurs + Then I click the "Upload" button + Then I see "All files failed to upload" + + @react + Scenario: List location items shows a Network error if offline + When I see the first button containing "public" + When A network failure occurs + Then I click the first button containing "public" + Then I see "Network Error" + + @react + Scenario: Create folder shows a Network error if offline + When I click the first button containing "public" + Then I see the "Menu Toggle" button + When I click the "Menu Toggle" button + Then I see the "Create Folder" menuitem + When I click the "Create Folder" menuitem + Then I see "Folder name" + Then I type a new "Folder name" with random value + When A network failure occurs + Then I click the "Create Folder" button + Then I see "There was an issue creating the folder" + + @react + Scenario: Copy file shows a Network error if offline + When I click the first button containing "public" + Then I click checkbox for file "001_dont_delete_file.txt" + When I click the "Menu Toggle" button + When I click the "Copy" menuitem + Then I click the "DoNotDeleteThisFolder_CanDeleteAllChildren/" button + When A network failure occurs + Then I click the "Copy" button + Then I see "All files failed to copy" + + @react + Scenario: Delete file shows a Network error if offline + When I click the first button containing "public" + Then I click checkbox for file "001_dont_delete_file.txt" + When I click the "Menu Toggle" button + Then I click the "Delete" menuitem + When A network failure occurs + Then I click the "Delete" button + Then I see "All files failed to delete" diff --git a/packages/e2e/features/ui/components/storage/storage-browser/download.feature b/packages/e2e/features/ui/components/storage/storage-browser/download.feature index 74d7c34673..3859c60a79 100644 --- a/packages/e2e/features/ui/components/storage/storage-browser/download.feature +++ b/packages/e2e/features/ui/components/storage/storage-browser/download.feature @@ -2,20 +2,17 @@ Feature: Download on Storage Browser Background: Given I'm running the example "ui/components/storage/storage-browser/default-auth" + And I type my "email" with status "CONFIRMED" + And I type my password + And I click the "Sign in" button @react Scenario: Download is available for files - When I type my "email" with status "CONFIRMED" - Then I type my password - Then I click the "Sign in" button When I click the first button containing "public" Then I see download for file "001_dont_delete_file.txt" Then I click and see download succeed for "001_dont_delete_file.txt" @react Scenario: Download is not available for folder - When I type my "email" with status "CONFIRMED" - Then I type my password - Then I click the "Sign in" button When I click the first button containing "public" Then I see no download for folder "DO_NOT_DELETE/" diff --git a/packages/e2e/features/ui/components/storage/storage-browser/drag-and-drop.feature b/packages/e2e/features/ui/components/storage/storage-browser/drag-and-drop.feature index 616dd8c9a2..39eb86884c 100644 --- a/packages/e2e/features/ui/components/storage/storage-browser/drag-and-drop.feature +++ b/packages/e2e/features/ui/components/storage/storage-browser/drag-and-drop.feature @@ -2,12 +2,12 @@ Feature: Drag and drop files within Storage Browser Background: Given I'm running the example "ui/components/storage/storage-browser/default-auth" + And I type my "email" with status "CONFIRMED" + And I type my password + And I click the "Sign in" button @react Scenario: Drag and drop file into Location Detail view - When I type my "email" with status "CONFIRMED" - Then I type my password - Then I click the "Sign in" button When I click the first button containing "public" When I drag and drop a file into the storage browser with file name "test.txt" Then I see "Upload" @@ -15,20 +15,13 @@ Feature: Drag and drop files within Storage Browser @react Scenario: Drag and drop folder into Location Detail view - When I type my "email" with status "CONFIRMED" - Then I type my password - Then I click the "Sign in" button When I click the first button containing "public" When I drag and drop a folder into the storage browser with name "test" Then I see "Upload" Then I see "test" - @react Scenario: Drag and drop file into Upload Action view - When I type my "email" with status "CONFIRMED" - Then I type my password - Then I click the "Sign in" button When I click the first button containing "public" Then I see the "Menu Toggle" button When I click the "Menu Toggle" button @@ -38,4 +31,3 @@ Feature: Drag and drop files within Storage Browser Then I press the "{esc}" key When I drag and drop a file into the storage browser with file name "test.txt" Then I see "test.txt" - \ No newline at end of file diff --git a/packages/e2e/features/ui/components/storage/storage-browser/filter-locations.feature b/packages/e2e/features/ui/components/storage/storage-browser/filter-locations.feature index 60a7a44fc4..7f32e9b976 100644 --- a/packages/e2e/features/ui/components/storage/storage-browser/filter-locations.feature +++ b/packages/e2e/features/ui/components/storage/storage-browser/filter-locations.feature @@ -15,4 +15,3 @@ Feature: StorageBrowser Filter Locations Then I do not see the button containing "private" When I click the button containing "Clear search" Then I see the first button containing "private" - diff --git a/packages/e2e/features/ui/components/storage/storage-browser/navigate-locations.feature b/packages/e2e/features/ui/components/storage/storage-browser/navigate-locations.feature index 03f0566cfe..e6aca9ac0f 100644 --- a/packages/e2e/features/ui/components/storage/storage-browser/navigate-locations.feature +++ b/packages/e2e/features/ui/components/storage/storage-browser/navigate-locations.feature @@ -2,12 +2,12 @@ Feature: Storage Browser navigate breadcrumbs Background: Given I'm running the example "ui/components/storage/storage-browser/default-auth" + And I type my "email" with status "CONFIRMED" + And I type my password + And I click the "Sign in" button @react Scenario: Navigate back to Home - When I type my "email" with status "CONFIRMED" - Then I type my password - Then I click the "Sign in" button When I click the first button containing "public" Then I see the "Home" button When I click the "Home" button @@ -16,9 +16,6 @@ Feature: Storage Browser navigate breadcrumbs @react Scenario: Navigate back up to prefix - When I type my "email" with status "CONFIRMED" - Then I type my password - Then I click the "Sign in" button When I click the first button containing "public" Then I see the "DO_NOT_DELETE/" button When I click the "DO_NOT_DELETE/" button @@ -29,9 +26,6 @@ Feature: Storage Browser navigate breadcrumbs @react Scenario: Navigate to parent folder from nested child folder - When I type my "email" with status "CONFIRMED" - Then I type my password - Then I click the "Sign in" button When I click the first button containing "public" Then I see the "DO_NOT_DELETE/" button When I click the "DO_NOT_DELETE/" button diff --git a/packages/e2e/features/ui/components/storage/storage-browser/search-locations.feature b/packages/e2e/features/ui/components/storage/storage-browser/search-locations.feature index 0858699da8..cd4289967e 100644 --- a/packages/e2e/features/ui/components/storage/storage-browser/search-locations.feature +++ b/packages/e2e/features/ui/components/storage/storage-browser/search-locations.feature @@ -2,12 +2,12 @@ Feature: Search with Storage Browser Background: Given I'm running the example "ui/components/storage/storage-browser/default-auth" + And I type my "email" with status "CONFIRMED" + And I type my password + And I click the "Sign in" button @react Scenario: Search folders and subfolders with matching results - When I type my "email" with status "CONFIRMED" - Then I type my password - Then I click the "Sign in" button When I click the first button containing "public" Then I see the button containing "DoNotDeleteThisFolder_CanDeleteAllChildren" When I see input with placeholder "Search current folder" and type "DO_NOT" @@ -26,9 +26,6 @@ Feature: Search with Storage Browser @react Scenario: Search with no matching results - When I type my "email" with status "CONFIRMED" - Then I type my password - Then I click the "Sign in" button When I click the first button containing "public" When I see input with placeholder "Search current folder" and type "XXXXXXXX" Then I click the "Search" button