Skip to content

Commit

Permalink
test(e2e): add storage-browser offline tests (#6206)
Browse files Browse the repository at this point in the history
* test(e2e): add storage-browser offline tests

* address feedback

* fix EOF

* fix EOF

* Update packages/e2e/cypress/integration/common/shared.ts

Co-authored-by: Caleb Pollman <[email protected]>

* address feedback

---------

Co-authored-by: Caleb Pollman <[email protected]>
  • Loading branch information
ashwinkumar6 and calebpollman authored Jan 10, 2025
1 parent 8757f03 commit f575deb
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 48 deletions.
6 changes: 6 additions & 0 deletions packages/e2e/cypress/integration/common/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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"
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,26 @@ 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"
Then I see "test.txt"

@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
Expand All @@ -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"

Original file line number Diff line number Diff line change
Expand Up @@ -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"

Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down

0 comments on commit f575deb

Please sign in to comment.