Skip to content

Commit 6dd11fd

Browse files
authored
e2e(storage-browser): add tests for upload pagination (#6635)
1 parent df129ab commit 6dd11fd

File tree

2 files changed

+43
-1
lines changed

2 files changed

+43
-1
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,16 @@ Then('the {string} button is disabled', (name: string) => {
460460
}).should('be.disabled');
461461
});
462462

463+
Then('the {string} button is enabled', (name: string) => {
464+
cy.findByRole('button', {
465+
name: new RegExp(`^${escapeRegExp(name)}$`, 'i'),
466+
}).should('not.be.disabled');
467+
});
468+
469+
Then('the table should have {string} rows', (value: string) => {
470+
cy.get('table').find('tbody tr').should('have.length', value);
471+
});
472+
463473
Then('the {string} field is invalid', (name: string) => {
464474
cy.findInputField(name)
465475
.then(($el) => $el.get(0).checkValidity())

packages/e2e/features/ui/components/storage/storage-browser/action-menu.feature

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,38 @@ Feature: Create folder with Storage Browser
106106
Then I see "All files deleted"
107107

108108
@react
109+
Scenario: upload a lot of files with pagination
110+
When I click the first button containing "public"
111+
Then I see the "Menu Toggle" button
112+
When I click the "Menu Toggle" button
113+
# upload file
114+
Then I see the "Upload" menuitem
115+
When I click the "Upload" menuitem
116+
Then the "Upload" button is disabled
117+
When I upload "250" files with random names
118+
Then I see "Not started"
119+
And the table should have "100" rows
120+
And I see the "Go to page 2" button
121+
And the "Go to page 2" button is enabled
122+
And I see the "Go to page 3" button
123+
And the "Go to page 3" button is enabled
124+
And the "Go to next page" button is enabled
125+
And the "Go to previous page" button is disabled
126+
When I click the "Go to page 2" button
127+
Then I see the "Go to page 1" button
128+
And the table should have "100" rows
129+
And the "Go to page 1" button is enabled
130+
And the "Go to next page" button is enabled
131+
And I see the "Go to page 3" button
132+
And the "Go to previous page" button is enabled
133+
When I click the "Go to page 3" button
134+
Then the table should have "50" rows
135+
And I see the "Go to page 1" button
136+
And the "Go to page 1" button is enabled
137+
And I see the "Go to page 2" button
138+
And the "Go to page 2" button is enabled
139+
And the "Go to next page" button is disabled
140+
@react
109141
Scenario: upload a folder
110142
When I click the first button containing "public"
111143
Then I see the "Menu Toggle" button
@@ -189,4 +221,4 @@ Feature: Create folder with Storage Browser
189221
Then I click the "Download" menuitem
190222
When A network failure occurs
191223
Then I click the "Download" button
192-
Then I see "All files failed to download"
224+
Then I see "All files failed to download"

0 commit comments

Comments
 (0)