From bd19cf2dae7dc9ede9ac8be3d07a65683dba60a0 Mon Sep 17 00:00:00 2001 From: Janaina Coelho Date: Thu, 28 Sep 2023 15:23:48 -0300 Subject: [PATCH 1/2] tests: add some expects that were missing --- apps/meteor/tests/e2e/threads.spec.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/apps/meteor/tests/e2e/threads.spec.ts b/apps/meteor/tests/e2e/threads.spec.ts index 6d6b8ee6f1223..1a1c2c67ea3c9 100644 --- a/apps/meteor/tests/e2e/threads.spec.ts +++ b/apps/meteor/tests/e2e/threads.spec.ts @@ -104,6 +104,9 @@ test.describe.serial('Threads', () => { await page.locator('[data-qa-id="edit-message"]').click(); await page.locator('[name="msg"]').last().fill('this message was edited'); await page.keyboard.press('Enter'); + await expect(page.locator('//main//aside >> [data-qa-type="message"]').last().locator('[data-qa-type="message-body"]')).toContainText( + 'this message was edited', + ); }); test('expect quote the thread message', async ({ page }) => { @@ -118,6 +121,11 @@ test.describe.serial('Threads', () => { test('expect star the thread message', async ({ page }) => { await poHomeChannel.content.openLastThreadMessageMenu(); await page.locator('[data-qa-id="star-message"]').click(); + await page.getByRole('button').and(page.getByTitle('Options')).click(); + await page.locator('[data-key="starred-messages"]').click(); + await expect(page.locator('//main//aside >> [data-qa-type="message"]').last().locator('[data-qa-type="message-body"]')).toContainText( + 'this is a message for reply', + ); }); test('expect copy the message', async ({ page }) => { From 4c36b58d81d6eee0befa91202170e3446e4b1741 Mon Sep 17 00:00:00 2001 From: Janaina Coelho Date: Fri, 29 Sep 2023 11:27:29 -0300 Subject: [PATCH 2/2] test: change locators --- apps/meteor/tests/e2e/threads.spec.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/apps/meteor/tests/e2e/threads.spec.ts b/apps/meteor/tests/e2e/threads.spec.ts index 1a1c2c67ea3c9..d9e181d2706bc 100644 --- a/apps/meteor/tests/e2e/threads.spec.ts +++ b/apps/meteor/tests/e2e/threads.spec.ts @@ -104,9 +104,7 @@ test.describe.serial('Threads', () => { await page.locator('[data-qa-id="edit-message"]').click(); await page.locator('[name="msg"]').last().fill('this message was edited'); await page.keyboard.press('Enter'); - await expect(page.locator('//main//aside >> [data-qa-type="message"]').last().locator('[data-qa-type="message-body"]')).toContainText( - 'this message was edited', - ); + await expect(poHomeChannel.content.lastUserMessageBody).toHaveText('this message was edited'); }); test('expect quote the thread message', async ({ page }) => { @@ -123,9 +121,7 @@ test.describe.serial('Threads', () => { await page.locator('[data-qa-id="star-message"]').click(); await page.getByRole('button').and(page.getByTitle('Options')).click(); await page.locator('[data-key="starred-messages"]').click(); - await expect(page.locator('//main//aside >> [data-qa-type="message"]').last().locator('[data-qa-type="message-body"]')).toContainText( - 'this is a message for reply', - ); + await expect(poHomeChannel.content.lastUserMessageBody).toHaveText('this is a message for reply'); }); test('expect copy the message', async ({ page }) => {