From 38e7887159b3c4c8aace191a2a09c06e2a451189 Mon Sep 17 00:00:00 2001 From: Jose Gomez Date: Wed, 22 Jan 2025 16:47:00 -0600 Subject: [PATCH 1/5] fix: route to the server URL and added a forced retries to the null-items test --- playwright/masonry/null-items.spec.ts | 6 ++++++ playwright/masonry/utils/getServerURL.ts | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/playwright/masonry/null-items.spec.ts b/playwright/masonry/null-items.spec.ts index d543bfd8ca..4716b3928a 100644 --- a/playwright/masonry/null-items.spec.ts +++ b/playwright/masonry/null-items.spec.ts @@ -3,12 +3,18 @@ import getServerURL from './utils/getServerURL'; import selectors from './utils/selectors'; test.describe('Masonry: Null items', () => { + // If the execution of the command that runs the test is not + // on the right directory, the retries will not work, so we need it + // to be configured here. + test.describe.configure({retries: 3}) + test('should not throw an error when null/undefined items are inserted', async ({ page }) => { await page.setViewportSize({ width: 1000, height: 1000 }); await page.goto(getServerURL({ virtualize: true })); // @ts-expect-error - TS2339 - Property 'ERROR_COUNT' does not exist on type 'Window & typeof globalThis'. const initialErrors = await page.evaluate(() => window.ERROR_COUNT); + // expect(initialErrors).toBeFalsy(); expect(initialErrors).toEqual(0); // click the insert null items button diff --git a/playwright/masonry/utils/getServerURL.ts b/playwright/masonry/utils/getServerURL.ts index 760c924f06..5bebd8fbbb 100644 --- a/playwright/masonry/utils/getServerURL.ts +++ b/playwright/masonry/utils/getServerURL.ts @@ -1,3 +1,4 @@ +const BASE_URL = 'http://localhost:8888'; const BASE_PATH = '/integration-test/masonry'; const normalizeValue = (val: boolean | number) => { @@ -38,7 +39,7 @@ const getServerURL = (options?: Options | null): string => { .join('&'); } - return `${BASE_PATH}?${serializedOptions}`; + return `${BASE_URL}${BASE_PATH}?${serializedOptions}`; }; export default getServerURL; From df84d62b07ef7d0e44d727fa812c71462459a8a2 Mon Sep 17 00:00:00 2001 From: Jose Gomez Date: Wed, 22 Jan 2025 16:58:36 -0600 Subject: [PATCH 2/5] updated: comment of the configured retries --- playwright/masonry/null-items.spec.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/playwright/masonry/null-items.spec.ts b/playwright/masonry/null-items.spec.ts index 4716b3928a..fc43dc93e2 100644 --- a/playwright/masonry/null-items.spec.ts +++ b/playwright/masonry/null-items.spec.ts @@ -3,9 +3,7 @@ import getServerURL from './utils/getServerURL'; import selectors from './utils/selectors'; test.describe('Masonry: Null items', () => { - // If the execution of the command that runs the test is not - // on the right directory, the retries will not work, so we need it - // to be configured here. + // Manually configuring the reetries for this flaky test test.describe.configure({retries: 3}) test('should not throw an error when null/undefined items are inserted', async ({ page }) => { @@ -14,7 +12,6 @@ test.describe('Masonry: Null items', () => { // @ts-expect-error - TS2339 - Property 'ERROR_COUNT' does not exist on type 'Window & typeof globalThis'. const initialErrors = await page.evaluate(() => window.ERROR_COUNT); - // expect(initialErrors).toBeFalsy(); expect(initialErrors).toEqual(0); // click the insert null items button From 833dcc0b1b4bb66407b75d00b84fcb477360bb49 Mon Sep 17 00:00:00 2001 From: Jose Gomez Date: Wed, 22 Jan 2025 17:27:43 -0600 Subject: [PATCH 3/5] fix: misspelling --- playwright/masonry/null-items.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playwright/masonry/null-items.spec.ts b/playwright/masonry/null-items.spec.ts index fc43dc93e2..c2347c29d6 100644 --- a/playwright/masonry/null-items.spec.ts +++ b/playwright/masonry/null-items.spec.ts @@ -3,7 +3,7 @@ import getServerURL from './utils/getServerURL'; import selectors from './utils/selectors'; test.describe('Masonry: Null items', () => { - // Manually configuring the reetries for this flaky test + // Manually configuring the retries for this flaky test test.describe.configure({retries: 3}) test('should not throw an error when null/undefined items are inserted', async ({ page }) => { From c284e95e3bfe6476967b9f984c14a4b4bedc0513 Mon Sep 17 00:00:00 2001 From: Jose Gomez Date: Thu, 23 Jan 2025 11:14:21 -0600 Subject: [PATCH 4/5] update: masonry get server url depending on dev enviroment --- playwright/masonry/utils/getServerURL.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playwright/masonry/utils/getServerURL.ts b/playwright/masonry/utils/getServerURL.ts index 5bebd8fbbb..bf1204dcd0 100644 --- a/playwright/masonry/utils/getServerURL.ts +++ b/playwright/masonry/utils/getServerURL.ts @@ -39,7 +39,7 @@ const getServerURL = (options?: Options | null): string => { .join('&'); } - return `${BASE_URL}${BASE_PATH}?${serializedOptions}`; + return `${process.env.NODE_ENV!=='development' ? BASE_URL : ''}${BASE_PATH}?${serializedOptions}`; }; export default getServerURL; From 90a8979de6acb03445bda254c000949b7d89ef28 Mon Sep 17 00:00:00 2001 From: Jose Gomez Date: Thu, 23 Jan 2025 11:53:54 -0600 Subject: [PATCH 5/5] change: env variable checking from NODE_ENV => CI --- playwright/masonry/utils/getServerURL.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playwright/masonry/utils/getServerURL.ts b/playwright/masonry/utils/getServerURL.ts index bf1204dcd0..ac40b8ebfe 100644 --- a/playwright/masonry/utils/getServerURL.ts +++ b/playwright/masonry/utils/getServerURL.ts @@ -39,7 +39,7 @@ const getServerURL = (options?: Options | null): string => { .join('&'); } - return `${process.env.NODE_ENV!=='development' ? BASE_URL : ''}${BASE_PATH}?${serializedOptions}`; + return `${process.env.CI ? '' : BASE_URL}${BASE_PATH}?${serializedOptions}`; }; export default getServerURL;