Skip to content

Commit

Permalink
test: Prevent playwright from unselecting options by mistake (#32158)
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksandernsilva authored Apr 9, 2024
1 parent 0a70db5 commit 87ad98f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions apps/meteor/tests/e2e/omnichannel/omnichannel-appearance.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,26 @@ test.describe.serial('OC - Livechat Appearance', () => {

test('OC - Livechat Appearance - Hide system messages', async ({ page }) => {
await test.step('expect to have default values', async () => {
await poLivechatAppearance.inputHideSystemMessages.click();
// Clicking at the edge of the element to prevent playwright from clicking a chip by mistake
await poLivechatAppearance.inputHideSystemMessages.click({ position: { x: 0, y: 0 } });
await expect(poLivechatAppearance.findHideSystemMessageOption('uj')).toHaveAttribute('aria-selected', 'true');
await expect(poLivechatAppearance.findHideSystemMessageOption('ul')).toHaveAttribute('aria-selected', 'true');
await expect(poLivechatAppearance.findHideSystemMessageOption('livechat-close')).toHaveAttribute('aria-selected', 'true');
await poLivechatAppearance.inputHideSystemMessages.click();
await poLivechatAppearance.inputHideSystemMessages.click({ position: { x: 0, y: 0 } });
});

await test.step('expect to change values', async () => {
await poLivechatAppearance.inputHideSystemMessages.click();
// Clicking at the edge of the element to prevent playwright from clicking a chip by mistake
await poLivechatAppearance.inputHideSystemMessages.click({ position: { x: 0, y: 0 } });
await poLivechatAppearance.findHideSystemMessageOption('livechat_transfer_history').click();
await poLivechatAppearance.findHideSystemMessageOption('livechat-close').click();
await poLivechatAppearance.btnSave.click();
});

await test.step('expect to have saved changes', async () => {
await page.reload();
await poLivechatAppearance.inputHideSystemMessages.click();
// Clicking at the edge of the element to prevent playwright from clicking a chip by mistake
await poLivechatAppearance.inputHideSystemMessages.click({ position: { x: 0, y: 0 } });
await expect(poLivechatAppearance.findHideSystemMessageOption('uj')).toHaveAttribute('aria-selected', 'true');
await expect(poLivechatAppearance.findHideSystemMessageOption('ul')).toHaveAttribute('aria-selected', 'true');
await expect(poLivechatAppearance.findHideSystemMessageOption('livechat_transfer_history')).toHaveAttribute('aria-selected', 'true');
Expand Down

0 comments on commit 87ad98f

Please sign in to comment.