Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: fix flaky omnichannel-units tests #33790

Merged
merged 2 commits into from
Nov 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 9 additions & 14 deletions apps/meteor/tests/e2e/omnichannel/omnichannel-units.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,8 @@ test.describe('OC - Manage Units', () => {
await poOmnichannelUnits.btnSave.click();
await expect(poOmnichannelUnits.contextualBar).not.toBeVisible();

await test.step('expect unit to have been created', async () => {
await poOmnichannelUnits.search(unitName);
await expect(poOmnichannelUnits.findRowByName(unitName)).toBeVisible();
});
await poOmnichannelUnits.search(unitName);
await expect(poOmnichannelUnits.findRowByName(unitName)).toBeVisible();
});

await test.step('expect to delete unit', async () => {
Expand Down Expand Up @@ -114,9 +112,7 @@ test.describe('OC - Manage Units', () => {
await expect(poOmnichannelUnits.contextualBar).toBeVisible();
await poOmnichannelUnits.inputName.fill(editedUnitName);
await poOmnichannelUnits.btnSave.click();
});

await test.step('expect unit to have been edited', async () => {
await expect(poOmnichannelUnits.contextualBar).not.toBeVisible();
await expect(poOmnichannelUnits.inputSearch).toBeVisible();
await poOmnichannelUnits.search(editedUnitName);
await expect(poOmnichannelUnits.findRowByName(editedUnitName)).toBeVisible();
Expand All @@ -126,9 +122,8 @@ test.describe('OC - Manage Units', () => {
await poOmnichannelUnits.findRowByName(editedUnitName).click();
await poOmnichannelUnits.selectMonitor('user3');
await poOmnichannelUnits.btnSave.click();
});
await expect(poOmnichannelUnits.contextualBar).not.toBeVisible();

await test.step('expect unit to have been edited with 2 monitors', async () => {
await poOmnichannelUnits.search(editedUnitName);
await poOmnichannelUnits.findRowByName(editedUnitName).click();

Expand All @@ -141,6 +136,7 @@ test.describe('OC - Manage Units', () => {
await poOmnichannelUnits.findRowByName(editedUnitName).click();
await poOmnichannelUnits.selectMonitor('user2');
await poOmnichannelUnits.btnSave.click();
await expect(poOmnichannelUnits.contextualBar).not.toBeVisible();

await poOmnichannelUnits.search(editedUnitName);
await poOmnichannelUnits.findRowByName(editedUnitName).click();
Expand All @@ -160,6 +156,7 @@ test.describe('OC - Manage Units', () => {
});

await expect(poOmnichannelUnits.contextualBar).not.toBeVisible();
await expect(poOmnichannelUnits.findRowByName(editedUnitName)).not.toBeVisible();
});
});

Expand All @@ -183,9 +180,8 @@ test.describe('OC - Manage Units', () => {
await expect(poOmnichannelUnits.contextualBar).toBeVisible();
await poOmnichannelUnits.selectDepartment({ name: department2.data.name, _id: department2.data._id });
await poOmnichannelUnits.btnSave.click();
});
await expect(poOmnichannelUnits.contextualBar).not.toBeVisible();

await test.step('expect department to be in the chosen departments list and have title', async () => {
await poOmnichannelUnits.search(unit.name);
await poOmnichannelUnits.findRowByName(unit.name).click();
await expect(poOmnichannelUnits.contextualBar).toBeVisible();
Expand All @@ -201,11 +197,9 @@ test.describe('OC - Manage Units', () => {
await poOmnichannelUnits.findRowByName(unit.name).click();
await expect(poOmnichannelUnits.contextualBar).toBeVisible();
await poOmnichannelUnits.selectDepartment({ name: department2.data.name, _id: department2.data._id });
await poOmnichannelUnits.selectMonitor('user2');
await poOmnichannelUnits.btnSave.click();
});
await expect(poOmnichannelUnits.contextualBar).not.toBeVisible();

await test.step('expect department to not be in the chosen departments list', async () => {
await poOmnichannelUnits.search(unit.name);
await poOmnichannelUnits.findRowByName(unit.name).click();
await expect(poOmnichannelUnits.contextualBar).toBeVisible();
Expand All @@ -224,6 +218,7 @@ test.describe('OC - Manage Units', () => {
});

await expect(poOmnichannelUnits.contextualBar).not.toBeVisible();
await expect(poOmnichannelUnits.findRowByName(unit.name)).not.toBeVisible();
});
});
});
Loading