Skip to content

Commit

Permalink
implement delete vfolder test
Browse files Browse the repository at this point in the history
  • Loading branch information
gee05053 committed Dec 6, 2023
1 parent a88a633 commit f77af2f
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
26 changes: 24 additions & 2 deletions cypress/commands/DataPage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,36 @@ import {findShadowRoot} from '../helper/FindShadowRoot.cy';
Cypress.Commands.add('createVfolder', (vfolderName: string) => {
findShadowRoot('backend-ai-webui').find('#data').click();
cy.wait(400);
const createVfolderDialog = findShadowRoot('backend-ai-webui > backend-ai-data-view').find('#add-folder');
const createDialogOpenButton = findShadowRoot('backend-ai-webui > backend-ai-data-view').find('#add-folder');
const vfolderNameInput = findShadowRoot('backend-ai-webui > backend-ai-data-view > #add-folder-name').find('input');
const createButton = findShadowRoot('backend-ai-webui > backend-ai-data-view').find('#add-button');
createVfolderDialog.click();
createDialogOpenButton.click();
vfolderNameInput.type(vfolderName);
createButton.click();
cy.wait(5000);
findShadowRoot('backend-ai-webui > backend-ai-data-view > backend-ai-storage-list')
.find(`#controls[folder-name=${vfolderName}]`)
.should('exist');
});

Cypress.Commands.add('deleteVfolder', (vfolderName: string) => {
findShadowRoot('backend-ai-webui').find('#data').click();
cy.wait(400);
const deleteDialogOpenButton =
findShadowRoot('backend-ai-webui > backend-ai-data-view > backend-ai-storage-list')
.find(`#controls[folder-name=${vfolderName}]`)
.find('mwc-icon-button[icon="delete"]');
const deleteVfolderNameInput =
findShadowRoot(
'backend-ai-webui > backend-ai-data-view > backend-ai-storage-list > #delete-folder-name'
).find('input');
const deleteButton =
findShadowRoot('backend-ai-webui > backend-ai-data-view > backend-ai-storage-list')
.find('#delete-button');
deleteDialogOpenButton.click();
deleteVfolderNameInput.type(vfolderName);
deleteButton.click();
findShadowRoot('backend-ai-webui > backend-ai-data-view > backend-ai-storage-list')
.find(`lablup-shields[folder-name=${vfolderName}][description="deleted-complete"]`)
.should('exist');
});
1 change: 1 addition & 0 deletions cypress/e2e/e2eTest.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ describe('Initial cypress E2E test', () => {
cy.login('[email protected]', 'test123!', 'http://127.0.0.1:8090');
cy.wait(400);
cy.createVfolder('test-e2eTest');
cy.deleteVfolder('test-e2eTest');
});
});
1 change: 1 addition & 0 deletions src/components/backend-ai-storage-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1792,6 +1792,7 @@ export default class BackendAiStorageList extends BackendAIPage {
<lablup-shields
app=""
color="${color}"
folder-name="${rowData.item.name}"
description="${rowData.item.status}"
ui="flat"
></lablup-shields>
Expand Down

0 comments on commit f77af2f

Please sign in to comment.