Skip to content

Commit

Permalink
Fix intermittent end-to-end test failures in editing transaction types
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcameron committed Mar 6, 2024
1 parent 38cf14b commit 3fddec8
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions test/end-to-end/transactionType/transactionType.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,26 +35,31 @@ test.describe('transaction types', () => {

test('successfully creates a transaction type', async () => {
await TU.buttons.create();
await TU.locator('div.modal-dialog');
await TU.waitForSelector('div.modal-dialog');
await TU.input('$ctrl.transactionType.text', newType.text);
await TU.select('$ctrl.transactionType.type', newType.type);
await TU.buttons.submit();
await TU.modal.submit();
await components.notification.hasSuccess();
});

test('successfully updates an existing transaction type', async () => {
await TU.reloadPage(); // Force a page reload
// Wait for the page to resort by 'text' (eg label)
// So that the new transaction type is visible; apparently
// being "below the fold" affects the ability to click
// on the "edit" link for the transaction.
await TU.locator('div[role="button"]').first().click();
await TU.locator('div[role="button"]').first().click();
await TU.waitForSelector(`div:has-text("${newType.text}")`);

// Open the edit modal and edit the transaction type
const editButton = `[data-edit-type="${newType.text}"]`;
await TU.waitForSelector(editButton);

await TU.locator(editButton).click();
await TU.waitForSelector('.modal-dialog');

await TU.input('$ctrl.transactionType.text', updateType.text);
await TU.select('$ctrl.transactionType.type', updateType.type);

await TU.modal.submit();

await components.notification.hasSuccess();
});

Expand Down

0 comments on commit 3fddec8

Please sign in to comment.