Skip to content

Commit

Permalink
test(citrus-simulator-ui): assert that no delete request was made if …
Browse files Browse the repository at this point in the history
…deletion was cancelled in home.spec.ts
  • Loading branch information
muellerfluri committed Sep 2, 2024
1 parent 19b8964 commit 79277cb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions simulator-ui/tests/home.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,20 @@ test('should have updated total, successful, failed tabs after refresh button cl
test('should have same total, successful, failed tabs after cancel deletion via close-Button and cancel-Button', async ({ page }) => {
await checkIfSummaryTabsAreDisplayingRightNumbers(page, nbOfTotalTests, nbOfSuccessfulTests, nbOfFailedTests);
const closeButtons = ['testResultDeleteDialogCloseButton', 'testResultDeleteDialogCancelButton'];
let deleteRequestWasMade = false;

page.on('request', request => {
if (request.method() == 'DELETE')
deleteRequestWasMade = true
})
for (const button of closeButtons) {
await page.getByTestId('resetButton').click();
await expect(page.getByTestId('testResultDeleteDialogHeading')).toBeVisible();
await page.getByTestId(button).click();
await expect(page.getByTestId('testResultDeleteDialogHeading')).toBeHidden();

await checkIfSummaryTabsAreDisplayingRightNumbers(page, nbOfTotalTests, nbOfSuccessfulTests, nbOfFailedTests);
expect(deleteRequestWasMade).toBe(false);
}
});

Expand Down

0 comments on commit 79277cb

Please sign in to comment.