Skip to content

Commit

Permalink
chore: add e2e tests for batch jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
stepan662 committed Jul 27, 2023
1 parent 961b048 commit 27f74ec
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
5 changes: 5 additions & 0 deletions e2e/cypress/common/batchJobs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,8 @@ export function executeBatchOperation() {
cy.waitForDom();
cy.gcy('batch-operation-dialog-ok', { timeout: 10_000 }).click();
}

export function deleteSelected() {
selectOperation('Delete');
executeBatchOperationWithConfirmation();
}
12 changes: 3 additions & 9 deletions e2e/cypress/e2e/translations/groupActions.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ import { waitForGlobalLoading } from '../../common/loading';
import { generateExampleKeys } from '../../common/apiCalls/testData/testData';
import { deleteProject } from '../../common/apiCalls/common';
import { gcy } from '../../common/shared';
import {
selectOperation,
executeBatchOperation,
executeBatchOperationWithConfirmation,
} from '../../common/batchJobs';
import { deleteSelected } from '../../common/batchJobs';

describe('Group actions', () => {
let project: ProjectDTO = null;
Expand All @@ -37,8 +33,7 @@ describe('Group actions', () => {
gcy('translations-row-checkbox').first().click();
gcy('translations-select-all-button').click();
waitForGlobalLoading(500);
selectOperation('Delete');
executeBatchOperationWithConfirmation();
deleteSelected();
waitForGlobalLoading(500);
gcy('global-empty-list').should('be.visible');
});
Expand All @@ -48,8 +43,7 @@ describe('Group actions', () => {
gcy('translations-select-all-button').click();
waitForGlobalLoading();
gcy('translations-row-checkbox').first().click();
selectOperation('Delete');
executeBatchOperationWithConfirmation();
deleteSelected();
waitForGlobalLoading(500);
gcy('translations-key-count').contains('1').should('be.visible');
});
Expand Down

0 comments on commit 27f74ec

Please sign in to comment.