Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(e2e): add storage-browser offline tests #6206

Merged
merged 7 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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('I simulate network disconnection', () => {
ashwinkumar6 marked this conversation as resolved.
Show resolved Hide resolved
ashwinkumar6 marked this conversation as resolved.
Show resolved Hide resolved
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
jordanvn marked this conversation as resolved.
Show resolved Hide resolved

@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 I simulate network disconnection
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 I simulate network disconnection
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 I simulate network disconnection
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 I simulate network disconnection
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 I simulate network disconnection
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"

ashwinkumar6 marked this conversation as resolved.
Show resolved Hide resolved
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
Loading