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

WIP: variant container for gen2 SDKs #3828

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion packages/react/src/blocks/PersonalizationContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export function PersonalizationContainer(props: PersonalizationContainerProps) {
}}
className={`builder-personalization-container ${
props.attributes.className
} ${isClient ? '' : 'builder-personalization-container-loading'}`}
}${isClient ? '' : ' builder-personalization-container-loading'}`}
>
{/* If editing a specific varient */}
{Builder.isEditing &&
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Browser } from '@playwright/test';
import { expect } from '@playwright/test';
import { excludeGen2, test } from '../helpers/index.js';
import { test } from '../helpers/index.js';
const SELECTOR = 'div[builder-content-id]';

const createContextWithCookies = async ({
Expand Down Expand Up @@ -35,7 +35,6 @@
page: _page,
baseURL,
browser,
sdk,
packageName,
}: Pick<
Parameters<Parameters<typeof test>[2]>[0],
Expand All @@ -47,7 +46,6 @@
test.skip(packageName === 'gen1-next14-pages');
// gen1-remix started failing on this test for an unknown reason.
test.skip(packageName === 'gen1-remix');
test.skip(excludeGen2(sdk));

if (!baseURL) throw new Error('Missing baseURL');

Expand Down Expand Up @@ -97,9 +95,9 @@

await page.goto('/personalization-container');

await expect(page.getByText(TEXTS.DEFAULT_CONTENT).locator('visible=true')).toBeVisible();

Check failure on line 98 in packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts

View workflow job for this annotation

GitHub Actions / Gen 2 SDKs (react-native)

[react-native] › personalization-container.spec.ts:75:7 › Personalization Container › entire page › #1/2: Render default w/ SSR

1) [react-native] › personalization-container.spec.ts:75:7 › Personalization Container › entire page › #1/2: Render default w/ SSR Error: Timed out 5000ms waiting for expect(locator).toBeVisible() Locator: getByText('Default').locator('visible=true') Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 5000ms - waiting for getByText('Default').locator('visible=true') 96 | await page.goto('/personalization-container'); 97 | > 98 | await expect(page.getByText(TEXTS.DEFAULT_CONTENT).locator('visible=true')).toBeVisible(); | ^ 99 | await expect(page.getByText(TEXTS.NON_PERSONALIZED).locator('visible=true')).toBeVisible(); 100 | await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_A })).toBeHidden(); 101 | await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_B })).toBeHidden(); at /home/runner/work/builder/builder/packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts:98:85

Check failure on line 98 in packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts

View workflow job for this annotation

GitHub Actions / Gen 2 SDKs (react-native)

[react-native] › personalization-container.spec.ts:75:7 › Personalization Container › entire page › #2/2: Render default w/ SSR

4) [react-native] › personalization-container.spec.ts:75:7 › Personalization Container › entire page › #2/2: Render default w/ SSR Error: Timed out 5000ms waiting for expect(locator).toBeVisible() Locator: getByText('Default').locator('visible=true') Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 5000ms - waiting for getByText('Default').locator('visible=true') 96 | await page.goto('/personalization-container'); 97 | > 98 | await expect(page.getByText(TEXTS.DEFAULT_CONTENT).locator('visible=true')).toBeVisible(); | ^ 99 | await expect(page.getByText(TEXTS.NON_PERSONALIZED).locator('visible=true')).toBeVisible(); 100 | await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_A })).toBeHidden(); 101 | await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_B })).toBeHidden(); at /home/runner/work/builder/builder/packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts:98:85

Check failure on line 98 in packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts

View workflow job for this annotation

GitHub Actions / Gen 2 SDKs (nextjs-sdk-next-app)

[nextjs-sdk-next-app] › personalization-container.spec.ts:75:7 › Personalization Container › entire page › #1/2: Render default w/ SSR

1) [nextjs-sdk-next-app] › personalization-container.spec.ts:75:7 › Personalization Container › entire page › #1/2: Render default w/ SSR Error: Timed out 5000ms waiting for expect(locator).toBeVisible() Locator: getByText('Default').locator('visible=true') Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 5000ms - waiting for getByText('Default').locator('visible=true') 96 | await page.goto('/personalization-container'); 97 | > 98 | await expect(page.getByText(TEXTS.DEFAULT_CONTENT).locator('visible=true')).toBeVisible(); | ^ 99 | await expect(page.getByText(TEXTS.NON_PERSONALIZED).locator('visible=true')).toBeVisible(); 100 | await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_A })).toBeHidden(); 101 | await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_B })).toBeHidden(); at /home/runner/work/builder/builder/packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts:98:85

Check failure on line 98 in packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts

View workflow job for this annotation

GitHub Actions / Gen 2 SDKs (nextjs-sdk-next-app)

[nextjs-sdk-next-app] › personalization-container.spec.ts:75:7 › Personalization Container › entire page › #2/2: Render default w/ SSR

4) [nextjs-sdk-next-app] › personalization-container.spec.ts:75:7 › Personalization Container › entire page › #2/2: Render default w/ SSR Error: Timed out 5000ms waiting for expect(locator).toBeVisible() Locator: getByText('Default').locator('visible=true') Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 5000ms - waiting for getByText('Default').locator('visible=true') 96 | await page.goto('/personalization-container'); 97 | > 98 | await expect(page.getByText(TEXTS.DEFAULT_CONTENT).locator('visible=true')).toBeVisible(); | ^ 99 | await expect(page.getByText(TEXTS.NON_PERSONALIZED).locator('visible=true')).toBeVisible(); 100 | await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_A })).toBeHidden(); 101 | await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_B })).toBeHidden(); at /home/runner/work/builder/builder/packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts:98:85
await expect(page.getByText(TEXTS.NON_PERSONALIZED).locator('visible=true')).toBeVisible();
await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_A })).toBeHidden();

Check failure on line 100 in packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts

View workflow job for this annotation

GitHub Actions / Gen 2 SDKs (sveltekit)

[sveltekit] › personalization-container.spec.ts:75:7 › Personalization Container › entire page › #1/2: Render default w/ SSR

1) [sveltekit] › personalization-container.spec.ts:75:7 › Personalization Container › entire page › #1/2: Render default w/ SSR Error: Timed out 5000ms waiting for expect(locator).toBeHidden() Locator: locator('div[builder-content-id]').filter({ hasText: 'Experiment A' }) Expected: hidden Received: visible Call log: - expect.toBeHidden with timeout 5000ms - waiting for locator('div[builder-content-id]').filter({ hasText: 'Experiment A' }) - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" 98 | await expect(page.getByText(TEXTS.DEFAULT_CONTENT).locator('visible=true')).toBeVisible(); 99 | await expect(page.getByText(TEXTS.NON_PERSONALIZED).locator('visible=true')).toBeVisible(); > 100 | await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_A })).toBeHidden(); | ^ 101 | await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_B })).toBeHidden(); 102 | }); 103 | at /home/runner/work/builder/builder/packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts:100:79

Check failure on line 100 in packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts

View workflow job for this annotation

GitHub Actions / Gen 2 SDKs (sveltekit)

[sveltekit] › personalization-container.spec.ts:75:7 › Personalization Container › entire page › #2/2: Render default w/ SSR

4) [sveltekit] › personalization-container.spec.ts:75:7 › Personalization Container › entire page › #2/2: Render default w/ SSR Error: Timed out 5000ms waiting for expect(locator).toBeHidden() Locator: locator('div[builder-content-id]').filter({ hasText: 'Experiment A' }) Expected: hidden Received: visible Call log: - expect.toBeHidden with timeout 5000ms - waiting for locator('div[builder-content-id]').filter({ hasText: 'Experiment A' }) - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" 98 | await expect(page.getByText(TEXTS.DEFAULT_CONTENT).locator('visible=true')).toBeVisible(); 99 | await expect(page.getByText(TEXTS.NON_PERSONALIZED).locator('visible=true')).toBeVisible(); > 100 | await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_A })).toBeHidden(); | ^ 101 | await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_B })).toBeHidden(); 102 | }); 103 | at /home/runner/work/builder/builder/packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts:100:79

Check failure on line 100 in packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts

View workflow job for this annotation

GitHub Actions / Gen 2 SDKs (svelte)

[svelte] › personalization-container.spec.ts:75:7 › Personalization Container › entire page › #1/2: Render default w/ SSR

1) [svelte] › personalization-container.spec.ts:75:7 › Personalization Container › entire page › #1/2: Render default w/ SSR Error: Timed out 5000ms waiting for expect(locator).toBeHidden() Locator: locator('div[builder-content-id]').filter({ hasText: 'Experiment A' }) Expected: hidden Received: visible Call log: - expect.toBeHidden with timeout 5000ms - waiting for locator('div[builder-content-id]').filter({ hasText: 'Experiment A' }) - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" 98 | await expect(page.getByText(TEXTS.DEFAULT_CONTENT).locator('visible=true')).toBeVisible(); 99 | await expect(page.getByText(TEXTS.NON_PERSONALIZED).locator('visible=true')).toBeVisible(); > 100 | await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_A })).toBeHidden(); | ^ 101 | await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_B })).toBeHidden(); 102 | }); 103 | at /home/runner/work/builder/builder/packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts:100:79

Check failure on line 100 in packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts

View workflow job for this annotation

GitHub Actions / Gen 2 SDKs (svelte)

[svelte] › personalization-container.spec.ts:75:7 › Personalization Container › entire page › #2/2: Render default w/ SSR

4) [svelte] › personalization-container.spec.ts:75:7 › Personalization Container › entire page › #2/2: Render default w/ SSR Error: Timed out 5000ms waiting for expect(locator).toBeHidden() Locator: locator('div[builder-content-id]').filter({ hasText: 'Experiment A' }) Expected: hidden Received: visible Call log: - expect.toBeHidden with timeout 5000ms - waiting for locator('div[builder-content-id]').filter({ hasText: 'Experiment A' }) - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" 98 | await expect(page.getByText(TEXTS.DEFAULT_CONTENT).locator('visible=true')).toBeVisible(); 99 | await expect(page.getByText(TEXTS.NON_PERSONALIZED).locator('visible=true')).toBeVisible(); > 100 | await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_A })).toBeHidden(); | ^ 101 | await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_B })).toBeHidden(); 102 | }); 103 | at /home/runner/work/builder/builder/packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts:100:79
await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_B })).toBeHidden();
});

Expand All @@ -126,9 +124,9 @@

await page.goto('/personalization-container');

await expect(page.getByText(TEXTS.EXPERIMENT_A).locator('visible=true')).toBeVisible();

Check failure on line 127 in packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts

View workflow job for this annotation

GitHub Actions / Gen 2 SDKs (solid-start)

[solid-start] › personalization-container.spec.ts:104:7 › Personalization Container › entire page › #1/2: Render variant A w/ SSR

1) [solid-start] › personalization-container.spec.ts:104:7 › Personalization Container › entire page › #1/2: Render variant A w/ SSR Error: Timed out 5000ms waiting for expect(locator).toBeVisible() Locator: getByText('Experiment A').locator('visible=true') Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 5000ms - waiting for getByText('Experiment A').locator('visible=true') 125 | await page.goto('/personalization-container'); 126 | > 127 | await expect(page.getByText(TEXTS.EXPERIMENT_A).locator('visible=true')).toBeVisible(); | ^ 128 | await expect(page.getByText(TEXTS.NON_PERSONALIZED).locator('visible=true')).toBeVisible(); 129 | await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_B })).toBeHidden(); 130 | await expect(page.locator(SELECTOR, { hasText: TEXTS.DEFAULT_CONTENT })).toBeHidden(); at /home/runner/work/builder/builder/packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts:127:82

Check failure on line 127 in packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts

View workflow job for this annotation

GitHub Actions / Gen 2 SDKs (solid-start)

[solid-start] › personalization-container.spec.ts:104:7 › Personalization Container › entire page › #2/2: Render variant A w/ SSR

3) [solid-start] › personalization-container.spec.ts:104:7 › Personalization Container › entire page › #2/2: Render variant A w/ SSR Error: Timed out 5000ms waiting for expect(locator).toBeVisible() Locator: getByText('Experiment A').locator('visible=true') Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 5000ms - waiting for getByText('Experiment A').locator('visible=true') 125 | await page.goto('/personalization-container'); 126 | > 127 | await expect(page.getByText(TEXTS.EXPERIMENT_A).locator('visible=true')).toBeVisible(); | ^ 128 | await expect(page.getByText(TEXTS.NON_PERSONALIZED).locator('visible=true')).toBeVisible(); 129 | await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_B })).toBeHidden(); 130 | await expect(page.locator(SELECTOR, { hasText: TEXTS.DEFAULT_CONTENT })).toBeHidden(); at /home/runner/work/builder/builder/packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts:127:82

Check failure on line 127 in packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts

View workflow job for this annotation

GitHub Actions / Gen 2 SDKs (sveltekit)

[sveltekit] › personalization-container.spec.ts:104:7 › Personalization Container › entire page › #1/2: Render variant A w/ SSR

2) [sveltekit] › personalization-container.spec.ts:104:7 › Personalization Container › entire page › #1/2: Render variant A w/ SSR Error: Timed out 5000ms waiting for expect(locator).toBeVisible() Locator: getByText('Experiment A').locator('visible=true') Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 5000ms - waiting for getByText('Experiment A').locator('visible=true') 125 | await page.goto('/personalization-container'); 126 | > 127 | await expect(page.getByText(TEXTS.EXPERIMENT_A).locator('visible=true')).toBeVisible(); | ^ 128 | await expect(page.getByText(TEXTS.NON_PERSONALIZED).locator('visible=true')).toBeVisible(); 129 | await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_B })).toBeHidden(); 130 | await expect(page.locator(SELECTOR, { hasText: TEXTS.DEFAULT_CONTENT })).toBeHidden(); at /home/runner/work/builder/builder/packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts:127:82

Check failure on line 127 in packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts

View workflow job for this annotation

GitHub Actions / Gen 2 SDKs (sveltekit)

[sveltekit] › personalization-container.spec.ts:104:7 › Personalization Container › entire page › #2/2: Render variant A w/ SSR

5) [sveltekit] › personalization-container.spec.ts:104:7 › Personalization Container › entire page › #2/2: Render variant A w/ SSR Error: Timed out 5000ms waiting for expect(locator).toBeVisible() Locator: getByText('Experiment A').locator('visible=true') Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 5000ms - waiting for getByText('Experiment A').locator('visible=true') 125 | await page.goto('/personalization-container'); 126 | > 127 | await expect(page.getByText(TEXTS.EXPERIMENT_A).locator('visible=true')).toBeVisible(); | ^ 128 | await expect(page.getByText(TEXTS.NON_PERSONALIZED).locator('visible=true')).toBeVisible(); 129 | await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_B })).toBeHidden(); 130 | await expect(page.locator(SELECTOR, { hasText: TEXTS.DEFAULT_CONTENT })).toBeHidden(); at /home/runner/work/builder/builder/packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts:127:82

Check failure on line 127 in packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts

View workflow job for this annotation

GitHub Actions / Gen 2 SDKs (vue)

[vue] › personalization-container.spec.ts:104:7 › Personalization Container › entire page › #1/2: Render variant A w/ SSR

1) [vue] › personalization-container.spec.ts:104:7 › Personalization Container › entire page › #1/2: Render variant A w/ SSR Error: Timed out 5000ms waiting for expect(locator).toBeVisible() Locator: getByText('Experiment A').locator('visible=true') Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 5000ms - waiting for getByText('Experiment A').locator('visible=true') 125 | await page.goto('/personalization-container'); 126 | > 127 | await expect(page.getByText(TEXTS.EXPERIMENT_A).locator('visible=true')).toBeVisible(); | ^ 128 | await expect(page.getByText(TEXTS.NON_PERSONALIZED).locator('visible=true')).toBeVisible(); 129 | await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_B })).toBeHidden(); 130 | await expect(page.locator(SELECTOR, { hasText: TEXTS.DEFAULT_CONTENT })).toBeHidden(); at /home/runner/work/builder/builder/packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts:127:82

Check failure on line 127 in packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts

View workflow job for this annotation

GitHub Actions / Gen 2 SDKs (vue)

[vue] › personalization-container.spec.ts:104:7 › Personalization Container › entire page › #2/2: Render variant A w/ SSR

3) [vue] › personalization-container.spec.ts:104:7 › Personalization Container › entire page › #2/2: Render variant A w/ SSR Error: Timed out 5000ms waiting for expect(locator).toBeVisible() Locator: getByText('Experiment A').locator('visible=true') Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 5000ms - waiting for getByText('Experiment A').locator('visible=true') 125 | await page.goto('/personalization-container'); 126 | > 127 | await expect(page.getByText(TEXTS.EXPERIMENT_A).locator('visible=true')).toBeVisible(); | ^ 128 | await expect(page.getByText(TEXTS.NON_PERSONALIZED).locator('visible=true')).toBeVisible(); 129 | await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_B })).toBeHidden(); 130 | await expect(page.locator(SELECTOR, { hasText: TEXTS.DEFAULT_CONTENT })).toBeHidden(); at /home/runner/work/builder/builder/packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts:127:82

Check failure on line 127 in packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts

View workflow job for this annotation

GitHub Actions / Gen 2 SDKs (angular)

[angular] › personalization-container.spec.ts:104:7 › Personalization Container › entire page › #1/2: Render variant A w/ SSR

1) [angular] › personalization-container.spec.ts:104:7 › Personalization Container › entire page › #1/2: Render variant A w/ SSR Error: Timed out 5000ms waiting for expect(locator).toBeVisible() Locator: getByText('Experiment A').locator('visible=true') Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 5000ms - waiting for getByText('Experiment A').locator('visible=true') 125 | await page.goto('/personalization-container'); 126 | > 127 | await expect(page.getByText(TEXTS.EXPERIMENT_A).locator('visible=true')).toBeVisible(); | ^ 128 | await expect(page.getByText(TEXTS.NON_PERSONALIZED).locator('visible=true')).toBeVisible(); 129 | await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_B })).toBeHidden(); 130 | await expect(page.locator(SELECTOR, { hasText: TEXTS.DEFAULT_CONTENT })).toBeHidden(); at /home/runner/work/builder/builder/packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts:127:82

Check failure on line 127 in packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts

View workflow job for this annotation

GitHub Actions / Gen 2 SDKs (angular)

[angular] › personalization-container.spec.ts:104:7 › Personalization Container › entire page › #2/2: Render variant A w/ SSR

3) [angular] › personalization-container.spec.ts:104:7 › Personalization Container › entire page › #2/2: Render variant A w/ SSR Error: Timed out 5000ms waiting for expect(locator).toBeVisible() Locator: getByText('Experiment A').locator('visible=true') Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 5000ms - waiting for getByText('Experiment A').locator('visible=true') 125 | await page.goto('/personalization-container'); 126 | > 127 | await expect(page.getByText(TEXTS.EXPERIMENT_A).locator('visible=true')).toBeVisible(); | ^ 128 | await expect(page.getByText(TEXTS.NON_PERSONALIZED).locator('visible=true')).toBeVisible(); 129 | await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_B })).toBeHidden(); 130 | await expect(page.locator(SELECTOR, { hasText: TEXTS.DEFAULT_CONTENT })).toBeHidden(); at /home/runner/work/builder/builder/packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts:127:82

Check failure on line 127 in packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts

View workflow job for this annotation

GitHub Actions / Gen 2 SDKs (react-native)

[react-native] › personalization-container.spec.ts:104:7 › Personalization Container › entire page › #1/2: Render variant A w/ SSR

2) [react-native] › personalization-container.spec.ts:104:7 › Personalization Container › entire page › #1/2: Render variant A w/ SSR Error: Timed out 5000ms waiting for expect(locator).toBeVisible() Locator: getByText('Experiment A').locator('visible=true') Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 5000ms - waiting for getByText('Experiment A').locator('visible=true') 125 | await page.goto('/personalization-container'); 126 | > 127 | await expect(page.getByText(TEXTS.EXPERIMENT_A).locator('visible=true')).toBeVisible(); | ^ 128 | await expect(page.getByText(TEXTS.NON_PERSONALIZED).locator('visible=true')).toBeVisible(); 129 | await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_B })).toBeHidden(); 130 | await expect(page.locator(SELECTOR, { hasText: TEXTS.DEFAULT_CONTENT })).toBeHidden(); at /home/runner/work/builder/builder/packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts:127:82

Check failure on line 127 in packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts

View workflow job for this annotation

GitHub Actions / Gen 2 SDKs (react-native)

[react-native] › personalization-container.spec.ts:104:7 › Personalization Container › entire page › #2/2: Render variant A w/ SSR

5) [react-native] › personalization-container.spec.ts:104:7 › Personalization Container › entire page › #2/2: Render variant A w/ SSR Error: Timed out 5000ms waiting for expect(locator).toBeVisible() Locator: getByText('Experiment A').locator('visible=true') Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 5000ms - waiting for getByText('Experiment A').locator('visible=true') 125 | await page.goto('/personalization-container'); 126 | > 127 | await expect(page.getByText(TEXTS.EXPERIMENT_A).locator('visible=true')).toBeVisible(); | ^ 128 | await expect(page.getByText(TEXTS.NON_PERSONALIZED).locator('visible=true')).toBeVisible(); 129 | await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_B })).toBeHidden(); 130 | await expect(page.locator(SELECTOR, { hasText: TEXTS.DEFAULT_CONTENT })).toBeHidden(); at /home/runner/work/builder/builder/packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts:127:82

Check failure on line 127 in packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts

View workflow job for this annotation

GitHub Actions / Gen 2 SDKs (nuxt)

[nuxt] › personalization-container.spec.ts:104:7 › Personalization Container › entire page › #1/2: Render variant A w/ SSR

1) [nuxt] › personalization-container.spec.ts:104:7 › Personalization Container › entire page › #1/2: Render variant A w/ SSR Error: Timed out 5000ms waiting for expect(locator).toBeVisible() Locator: getByText('Experiment A').locator('visible=true') Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 5000ms - waiting for getByText('Experiment A').locator('visible=true') 125 | await page.goto('/personalization-container'); 126 | > 127 | await expect(page.getByText(TEXTS.EXPERIMENT_A).locator('visible=true')).toBeVisible(); | ^ 128 | await expect(page.getByText(TEXTS.NON_PERSONALIZED).locator('visible=true')).toBeVisible(); 129 | await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_B })).toBeHidden(); 130 | await expect(page.locator(SELECTOR, { hasText: TEXTS.DEFAULT_CONTENT })).toBeHidden(); at /home/runner/work/builder/builder/packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts:127:82

Check failure on line 127 in packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts

View workflow job for this annotation

GitHub Actions / Gen 2 SDKs (nuxt)

[nuxt] › personalization-container.spec.ts:104:7 › Personalization Container › entire page › #2/2: Render variant A w/ SSR

3) [nuxt] › personalization-container.spec.ts:104:7 › Personalization Container › entire page › #2/2: Render variant A w/ SSR Error: Timed out 5000ms waiting for expect(locator).toBeVisible() Locator: getByText('Experiment A').locator('visible=true') Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 5000ms - waiting for getByText('Experiment A').locator('visible=true') 125 | await page.goto('/personalization-container'); 126 | > 127 | await expect(page.getByText(TEXTS.EXPERIMENT_A).locator('visible=true')).toBeVisible(); | ^ 128 | await expect(page.getByText(TEXTS.NON_PERSONALIZED).locator('visible=true')).toBeVisible(); 129 | await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_B })).toBeHidden(); 130 | await expect(page.locator(SELECTOR, { hasText: TEXTS.DEFAULT_CONTENT })).toBeHidden(); at /home/runner/work/builder/builder/packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts:127:82

Check failure on line 127 in packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts

View workflow job for this annotation

GitHub Actions / Gen 2 SDKs (qwik-city)

[qwik-city] › personalization-container.spec.ts:104:7 › Personalization Container › entire page › #1/2: Render variant A w/ SSR

1) [qwik-city] › personalization-container.spec.ts:104:7 › Personalization Container › entire page › #1/2: Render variant A w/ SSR Error: Timed out 5000ms waiting for expect(locator).toBeVisible() Locator: getByText('Experiment A').locator('visible=true') Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 5000ms - waiting for getByText('Experiment A').locator('visible=true') 125 | await page.goto('/personalization-container'); 126 | > 127 | await expect(page.getByText(TEXTS.EXPERIMENT_A).locator('visible=true')).toBeVisible(); | ^ 128 | await expect(page.getByText(TEXTS.NON_PERSONALIZED).locator('visible=true')).toBeVisible(); 129 | await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_B })).toBeHidden(); 130 | await expect(page.locator(SELECTOR, { hasText: TEXTS.DEFAULT_CONTENT })).toBeHidden(); at /home/runner/work/builder/builder/packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts:127:82

Check failure on line 127 in packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts

View workflow job for this annotation

GitHub Actions / Gen 2 SDKs (qwik-city)

[qwik-city] › personalization-container.spec.ts:104:7 › Personalization Container › entire page › #2/2: Render variant A w/ SSR

3) [qwik-city] › personalization-container.spec.ts:104:7 › Personalization Container › entire page › #2/2: Render variant A w/ SSR Error: Timed out 5000ms waiting for expect(locator).toBeVisible() Locator: getByText('Experiment A').locator('visible=true') Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 5000ms - waiting for getByText('Experiment A').locator('visible=true') 125 | await page.goto('/personalization-container'); 126 | > 127 | await expect(page.getByText(TEXTS.EXPERIMENT_A).locator('visible=true')).toBeVisible(); | ^ 128 | await expect(page.getByText(TEXTS.NON_PERSONALIZED).locator('visible=true')).toBeVisible(); 129 | await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_B })).toBeHidden(); 130 | await expect(page.locator(SELECTOR, { hasText: TEXTS.DEFAULT_CONTENT })).toBeHidden(); at /home/runner/work/builder/builder/packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts:127:82

Check failure on line 127 in packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts

View workflow job for this annotation

GitHub Actions / Gen 2 SDKs (nextjs-sdk-next-app)

[nextjs-sdk-next-app] › personalization-container.spec.ts:104:7 › Personalization Container › entire page › #1/2: Render variant A w/ SSR

2) [nextjs-sdk-next-app] › personalization-container.spec.ts:104:7 › Personalization Container › entire page › #1/2: Render variant A w/ SSR Error: Timed out 5000ms waiting for expect(locator).toBeVisible() Locator: getByText('Experiment A').locator('visible=true') Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 5000ms - waiting for getByText('Experiment A').locator('visible=true') 125 | await page.goto('/personalization-container'); 126 | > 127 | await expect(page.getByText(TEXTS.EXPERIMENT_A).locator('visible=true')).toBeVisible(); | ^ 128 | await expect(page.getByText(TEXTS.NON_PERSONALIZED).locator('visible=true')).toBeVisible(); 129 | await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_B })).toBeHidden(); 130 | await expect(page.locator(SELECTOR, { hasText: TEXTS.DEFAULT_CONTENT })).toBeHidden(); at /home/runner/work/builder/builder/packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts:127:82

Check failure on line 127 in packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts

View workflow job for this annotation

GitHub Actions / Gen 2 SDKs (nextjs-sdk-next-app)

[nextjs-sdk-next-app] › personalization-container.spec.ts:104:7 › Personalization Container › entire page › #2/2: Render variant A w/ SSR

5) [nextjs-sdk-next-app] › personalization-container.spec.ts:104:7 › Personalization Container › entire page › #2/2: Render variant A w/ SSR Error: Timed out 5000ms waiting for expect(locator).toBeVisible() Locator: getByText('Experiment A').locator('visible=true') Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 5000ms - waiting for getByText('Experiment A').locator('visible=true') 125 | await page.goto('/personalization-container'); 126 | > 127 | await expect(page.getByText(TEXTS.EXPERIMENT_A).locator('visible=true')).toBeVisible(); | ^ 128 | await expect(page.getByText(TEXTS.NON_PERSONALIZED).locator('visible=true')).toBeVisible(); 129 | await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_B })).toBeHidden(); 130 | await expect(page.locator(SELECTOR, { hasText: TEXTS.DEFAULT_CONTENT })).toBeHidden(); at /home/runner/work/builder/builder/packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts:127:82
await expect(page.getByText(TEXTS.NON_PERSONALIZED).locator('visible=true')).toBeVisible();
await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_B })).toBeHidden();

Check failure on line 129 in packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts

View workflow job for this annotation

GitHub Actions / Gen 2 SDKs (svelte)

[svelte] › personalization-container.spec.ts:104:7 › Personalization Container › entire page › #1/2: Render variant A w/ SSR

2) [svelte] › personalization-container.spec.ts:104:7 › Personalization Container › entire page › #1/2: Render variant A w/ SSR Error: Timed out 5000ms waiting for expect(locator).toBeHidden() Locator: locator('div[builder-content-id]').filter({ hasText: 'Experiment B' }) Expected: hidden Received: visible Call log: - expect.toBeHidden with timeout 5000ms - waiting for locator('div[builder-content-id]').filter({ hasText: 'Experiment B' }) - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" 127 | await expect(page.getByText(TEXTS.EXPERIMENT_A).locator('visible=true')).toBeVisible(); 128 | await expect(page.getByText(TEXTS.NON_PERSONALIZED).locator('visible=true')).toBeVisible(); > 129 | await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_B })).toBeHidden(); | ^ 130 | await expect(page.locator(SELECTOR, { hasText: TEXTS.DEFAULT_CONTENT })).toBeHidden(); 131 | }); 132 | at /home/runner/work/builder/builder/packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts:129:79

Check failure on line 129 in packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts

View workflow job for this annotation

GitHub Actions / Gen 2 SDKs (svelte)

[svelte] › personalization-container.spec.ts:104:7 › Personalization Container › entire page › #2/2: Render variant A w/ SSR

5) [svelte] › personalization-container.spec.ts:104:7 › Personalization Container › entire page › #2/2: Render variant A w/ SSR Error: Timed out 5000ms waiting for expect(locator).toBeHidden() Locator: locator('div[builder-content-id]').filter({ hasText: 'Experiment B' }) Expected: hidden Received: visible Call log: - expect.toBeHidden with timeout 5000ms - waiting for locator('div[builder-content-id]').filter({ hasText: 'Experiment B' }) - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" 127 | await expect(page.getByText(TEXTS.EXPERIMENT_A).locator('visible=true')).toBeVisible(); 128 | await expect(page.getByText(TEXTS.NON_PERSONALIZED).locator('visible=true')).toBeVisible(); > 129 | await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_B })).toBeHidden(); | ^ 130 | await expect(page.locator(SELECTOR, { hasText: TEXTS.DEFAULT_CONTENT })).toBeHidden(); 131 | }); 132 | at /home/runner/work/builder/builder/packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts:129:79
await expect(page.locator(SELECTOR, { hasText: TEXTS.DEFAULT_CONTENT })).toBeHidden();
});

Expand All @@ -155,9 +153,9 @@

await page.goto('/personalization-container');

await expect(page.getByText(TEXTS.EXPERIMENT_B).locator('visible=true')).toBeVisible();

Check failure on line 156 in packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts

View workflow job for this annotation

GitHub Actions / Gen 2 SDKs (solid-start)

[solid-start] › personalization-container.spec.ts:133:7 › Personalization Container › entire page › #1/2: Render variant B w/ SSR

2) [solid-start] › personalization-container.spec.ts:133:7 › Personalization Container › entire page › #1/2: Render variant B w/ SSR Error: Timed out 5000ms waiting for expect(locator).toBeVisible() Locator: getByText('Experiment B').locator('visible=true') Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 5000ms - waiting for getByText('Experiment B').locator('visible=true') 154 | await page.goto('/personalization-container'); 155 | > 156 | await expect(page.getByText(TEXTS.EXPERIMENT_B).locator('visible=true')).toBeVisible(); | ^ 157 | await expect(page.getByText(TEXTS.NON_PERSONALIZED).locator('visible=true')).toBeVisible(); 158 | await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_A })).toBeHidden(); 159 | await expect(page.locator(SELECTOR, { hasText: TEXTS.DEFAULT_CONTENT })).toBeHidden(); at /home/runner/work/builder/builder/packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts:156:82

Check failure on line 156 in packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts

View workflow job for this annotation

GitHub Actions / Gen 2 SDKs (solid-start)

[solid-start] › personalization-container.spec.ts:133:7 › Personalization Container › entire page › #2/2: Render variant B w/ SSR

4) [solid-start] › personalization-container.spec.ts:133:7 › Personalization Container › entire page › #2/2: Render variant B w/ SSR Error: Timed out 5000ms waiting for expect(locator).toBeVisible() Locator: getByText('Experiment B').locator('visible=true') Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 5000ms - waiting for getByText('Experiment B').locator('visible=true') 154 | await page.goto('/personalization-container'); 155 | > 156 | await expect(page.getByText(TEXTS.EXPERIMENT_B).locator('visible=true')).toBeVisible(); | ^ 157 | await expect(page.getByText(TEXTS.NON_PERSONALIZED).locator('visible=true')).toBeVisible(); 158 | await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_A })).toBeHidden(); 159 | await expect(page.locator(SELECTOR, { hasText: TEXTS.DEFAULT_CONTENT })).toBeHidden(); at /home/runner/work/builder/builder/packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts:156:82

Check failure on line 156 in packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts

View workflow job for this annotation

GitHub Actions / Gen 2 SDKs (sveltekit)

[sveltekit] › personalization-container.spec.ts:133:7 › Personalization Container › entire page › #1/2: Render variant B w/ SSR

3) [sveltekit] › personalization-container.spec.ts:133:7 › Personalization Container › entire page › #1/2: Render variant B w/ SSR Error: Timed out 5000ms waiting for expect(locator).toBeVisible() Locator: getByText('Experiment B').locator('visible=true') Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 5000ms - waiting for getByText('Experiment B').locator('visible=true') 154 | await page.goto('/personalization-container'); 155 | > 156 | await expect(page.getByText(TEXTS.EXPERIMENT_B).locator('visible=true')).toBeVisible(); | ^ 157 | await expect(page.getByText(TEXTS.NON_PERSONALIZED).locator('visible=true')).toBeVisible(); 158 | await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_A })).toBeHidden(); 159 | await expect(page.locator(SELECTOR, { hasText: TEXTS.DEFAULT_CONTENT })).toBeHidden(); at /home/runner/work/builder/builder/packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts:156:82

Check failure on line 156 in packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts

View workflow job for this annotation

GitHub Actions / Gen 2 SDKs (sveltekit)

[sveltekit] › personalization-container.spec.ts:133:7 › Personalization Container › entire page › #2/2: Render variant B w/ SSR

6) [sveltekit] › personalization-container.spec.ts:133:7 › Personalization Container › entire page › #2/2: Render variant B w/ SSR Error: Timed out 5000ms waiting for expect(locator).toBeVisible() Locator: getByText('Experiment B').locator('visible=true') Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 5000ms - waiting for getByText('Experiment B').locator('visible=true') 154 | await page.goto('/personalization-container'); 155 | > 156 | await expect(page.getByText(TEXTS.EXPERIMENT_B).locator('visible=true')).toBeVisible(); | ^ 157 | await expect(page.getByText(TEXTS.NON_PERSONALIZED).locator('visible=true')).toBeVisible(); 158 | await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_A })).toBeHidden(); 159 | await expect(page.locator(SELECTOR, { hasText: TEXTS.DEFAULT_CONTENT })).toBeHidden(); at /home/runner/work/builder/builder/packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts:156:82

Check failure on line 156 in packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts

View workflow job for this annotation

GitHub Actions / Gen 2 SDKs (vue)

[vue] › personalization-container.spec.ts:133:7 › Personalization Container › entire page › #1/2: Render variant B w/ SSR

2) [vue] › personalization-container.spec.ts:133:7 › Personalization Container › entire page › #1/2: Render variant B w/ SSR Error: Timed out 5000ms waiting for expect(locator).toBeVisible() Locator: getByText('Experiment B').locator('visible=true') Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 5000ms - waiting for getByText('Experiment B').locator('visible=true') 154 | await page.goto('/personalization-container'); 155 | > 156 | await expect(page.getByText(TEXTS.EXPERIMENT_B).locator('visible=true')).toBeVisible(); | ^ 157 | await expect(page.getByText(TEXTS.NON_PERSONALIZED).locator('visible=true')).toBeVisible(); 158 | await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_A })).toBeHidden(); 159 | await expect(page.locator(SELECTOR, { hasText: TEXTS.DEFAULT_CONTENT })).toBeHidden(); at /home/runner/work/builder/builder/packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts:156:82

Check failure on line 156 in packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts

View workflow job for this annotation

GitHub Actions / Gen 2 SDKs (vue)

[vue] › personalization-container.spec.ts:133:7 › Personalization Container › entire page › #2/2: Render variant B w/ SSR

4) [vue] › personalization-container.spec.ts:133:7 › Personalization Container › entire page › #2/2: Render variant B w/ SSR Error: Timed out 5000ms waiting for expect(locator).toBeVisible() Locator: getByText('Experiment B').locator('visible=true') Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 5000ms - waiting for getByText('Experiment B').locator('visible=true') 154 | await page.goto('/personalization-container'); 155 | > 156 | await expect(page.getByText(TEXTS.EXPERIMENT_B).locator('visible=true')).toBeVisible(); | ^ 157 | await expect(page.getByText(TEXTS.NON_PERSONALIZED).locator('visible=true')).toBeVisible(); 158 | await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_A })).toBeHidden(); 159 | await expect(page.locator(SELECTOR, { hasText: TEXTS.DEFAULT_CONTENT })).toBeHidden(); at /home/runner/work/builder/builder/packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts:156:82

Check failure on line 156 in packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts

View workflow job for this annotation

GitHub Actions / Gen 2 SDKs (angular)

[angular] › personalization-container.spec.ts:133:7 › Personalization Container › entire page › #1/2: Render variant B w/ SSR

2) [angular] › personalization-container.spec.ts:133:7 › Personalization Container › entire page › #1/2: Render variant B w/ SSR Error: Timed out 5000ms waiting for expect(locator).toBeVisible() Locator: getByText('Experiment B').locator('visible=true') Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 5000ms - waiting for getByText('Experiment B').locator('visible=true') 154 | await page.goto('/personalization-container'); 155 | > 156 | await expect(page.getByText(TEXTS.EXPERIMENT_B).locator('visible=true')).toBeVisible(); | ^ 157 | await expect(page.getByText(TEXTS.NON_PERSONALIZED).locator('visible=true')).toBeVisible(); 158 | await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_A })).toBeHidden(); 159 | await expect(page.locator(SELECTOR, { hasText: TEXTS.DEFAULT_CONTENT })).toBeHidden(); at /home/runner/work/builder/builder/packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts:156:82

Check failure on line 156 in packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts

View workflow job for this annotation

GitHub Actions / Gen 2 SDKs (angular)

[angular] › personalization-container.spec.ts:133:7 › Personalization Container › entire page › #2/2: Render variant B w/ SSR

4) [angular] › personalization-container.spec.ts:133:7 › Personalization Container › entire page › #2/2: Render variant B w/ SSR Error: Timed out 5000ms waiting for expect(locator).toBeVisible() Locator: getByText('Experiment B').locator('visible=true') Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 5000ms - waiting for getByText('Experiment B').locator('visible=true') 154 | await page.goto('/personalization-container'); 155 | > 156 | await expect(page.getByText(TEXTS.EXPERIMENT_B).locator('visible=true')).toBeVisible(); | ^ 157 | await expect(page.getByText(TEXTS.NON_PERSONALIZED).locator('visible=true')).toBeVisible(); 158 | await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_A })).toBeHidden(); 159 | await expect(page.locator(SELECTOR, { hasText: TEXTS.DEFAULT_CONTENT })).toBeHidden(); at /home/runner/work/builder/builder/packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts:156:82

Check failure on line 156 in packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts

View workflow job for this annotation

GitHub Actions / Gen 2 SDKs (react-native)

[react-native] › personalization-container.spec.ts:133:7 › Personalization Container › entire page › #1/2: Render variant B w/ SSR

3) [react-native] › personalization-container.spec.ts:133:7 › Personalization Container › entire page › #1/2: Render variant B w/ SSR Error: Timed out 5000ms waiting for expect(locator).toBeVisible() Locator: getByText('Experiment B').locator('visible=true') Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 5000ms - waiting for getByText('Experiment B').locator('visible=true') 154 | await page.goto('/personalization-container'); 155 | > 156 | await expect(page.getByText(TEXTS.EXPERIMENT_B).locator('visible=true')).toBeVisible(); | ^ 157 | await expect(page.getByText(TEXTS.NON_PERSONALIZED).locator('visible=true')).toBeVisible(); 158 | await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_A })).toBeHidden(); 159 | await expect(page.locator(SELECTOR, { hasText: TEXTS.DEFAULT_CONTENT })).toBeHidden(); at /home/runner/work/builder/builder/packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts:156:82

Check failure on line 156 in packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts

View workflow job for this annotation

GitHub Actions / Gen 2 SDKs (react-native)

[react-native] › personalization-container.spec.ts:133:7 › Personalization Container › entire page › #2/2: Render variant B w/ SSR

6) [react-native] › personalization-container.spec.ts:133:7 › Personalization Container › entire page › #2/2: Render variant B w/ SSR Error: Timed out 5000ms waiting for expect(locator).toBeVisible() Locator: getByText('Experiment B').locator('visible=true') Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 5000ms - waiting for getByText('Experiment B').locator('visible=true') 154 | await page.goto('/personalization-container'); 155 | > 156 | await expect(page.getByText(TEXTS.EXPERIMENT_B).locator('visible=true')).toBeVisible(); | ^ 157 | await expect(page.getByText(TEXTS.NON_PERSONALIZED).locator('visible=true')).toBeVisible(); 158 | await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_A })).toBeHidden(); 159 | await expect(page.locator(SELECTOR, { hasText: TEXTS.DEFAULT_CONTENT })).toBeHidden(); at /home/runner/work/builder/builder/packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts:156:82

Check failure on line 156 in packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts

View workflow job for this annotation

GitHub Actions / Gen 2 SDKs (nuxt)

[nuxt] › personalization-container.spec.ts:133:7 › Personalization Container › entire page › #1/2: Render variant B w/ SSR

2) [nuxt] › personalization-container.spec.ts:133:7 › Personalization Container › entire page › #1/2: Render variant B w/ SSR Error: Timed out 5000ms waiting for expect(locator).toBeVisible() Locator: getByText('Experiment B').locator('visible=true') Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 5000ms - waiting for getByText('Experiment B').locator('visible=true') 154 | await page.goto('/personalization-container'); 155 | > 156 | await expect(page.getByText(TEXTS.EXPERIMENT_B).locator('visible=true')).toBeVisible(); | ^ 157 | await expect(page.getByText(TEXTS.NON_PERSONALIZED).locator('visible=true')).toBeVisible(); 158 | await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_A })).toBeHidden(); 159 | await expect(page.locator(SELECTOR, { hasText: TEXTS.DEFAULT_CONTENT })).toBeHidden(); at /home/runner/work/builder/builder/packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts:156:82

Check failure on line 156 in packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts

View workflow job for this annotation

GitHub Actions / Gen 2 SDKs (nuxt)

[nuxt] › personalization-container.spec.ts:133:7 › Personalization Container › entire page › #2/2: Render variant B w/ SSR

4) [nuxt] › personalization-container.spec.ts:133:7 › Personalization Container › entire page › #2/2: Render variant B w/ SSR Error: Timed out 5000ms waiting for expect(locator).toBeVisible() Locator: getByText('Experiment B').locator('visible=true') Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 5000ms - waiting for getByText('Experiment B').locator('visible=true') 154 | await page.goto('/personalization-container'); 155 | > 156 | await expect(page.getByText(TEXTS.EXPERIMENT_B).locator('visible=true')).toBeVisible(); | ^ 157 | await expect(page.getByText(TEXTS.NON_PERSONALIZED).locator('visible=true')).toBeVisible(); 158 | await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_A })).toBeHidden(); 159 | await expect(page.locator(SELECTOR, { hasText: TEXTS.DEFAULT_CONTENT })).toBeHidden(); at /home/runner/work/builder/builder/packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts:156:82

Check failure on line 156 in packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts

View workflow job for this annotation

GitHub Actions / Gen 2 SDKs (qwik-city)

[qwik-city] › personalization-container.spec.ts:133:7 › Personalization Container › entire page › #1/2: Render variant B w/ SSR

2) [qwik-city] › personalization-container.spec.ts:133:7 › Personalization Container › entire page › #1/2: Render variant B w/ SSR Error: Timed out 5000ms waiting for expect(locator).toBeVisible() Locator: getByText('Experiment B').locator('visible=true') Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 5000ms - waiting for getByText('Experiment B').locator('visible=true') 154 | await page.goto('/personalization-container'); 155 | > 156 | await expect(page.getByText(TEXTS.EXPERIMENT_B).locator('visible=true')).toBeVisible(); | ^ 157 | await expect(page.getByText(TEXTS.NON_PERSONALIZED).locator('visible=true')).toBeVisible(); 158 | await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_A })).toBeHidden(); 159 | await expect(page.locator(SELECTOR, { hasText: TEXTS.DEFAULT_CONTENT })).toBeHidden(); at /home/runner/work/builder/builder/packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts:156:82

Check failure on line 156 in packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts

View workflow job for this annotation

GitHub Actions / Gen 2 SDKs (qwik-city)

[qwik-city] › personalization-container.spec.ts:133:7 › Personalization Container › entire page › #2/2: Render variant B w/ SSR

4) [qwik-city] › personalization-container.spec.ts:133:7 › Personalization Container › entire page › #2/2: Render variant B w/ SSR Error: Timed out 5000ms waiting for expect(locator).toBeVisible() Locator: getByText('Experiment B').locator('visible=true') Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 5000ms - waiting for getByText('Experiment B').locator('visible=true') 154 | await page.goto('/personalization-container'); 155 | > 156 | await expect(page.getByText(TEXTS.EXPERIMENT_B).locator('visible=true')).toBeVisible(); | ^ 157 | await expect(page.getByText(TEXTS.NON_PERSONALIZED).locator('visible=true')).toBeVisible(); 158 | await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_A })).toBeHidden(); 159 | await expect(page.locator(SELECTOR, { hasText: TEXTS.DEFAULT_CONTENT })).toBeHidden(); at /home/runner/work/builder/builder/packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts:156:82

Check failure on line 156 in packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts

View workflow job for this annotation

GitHub Actions / Gen 2 SDKs (nextjs-sdk-next-app)

[nextjs-sdk-next-app] › personalization-container.spec.ts:133:7 › Personalization Container › entire page › #1/2: Render variant B w/ SSR

3) [nextjs-sdk-next-app] › personalization-container.spec.ts:133:7 › Personalization Container › entire page › #1/2: Render variant B w/ SSR Error: Timed out 5000ms waiting for expect(locator).toBeVisible() Locator: getByText('Experiment B').locator('visible=true') Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 5000ms - waiting for getByText('Experiment B').locator('visible=true') 154 | await page.goto('/personalization-container'); 155 | > 156 | await expect(page.getByText(TEXTS.EXPERIMENT_B).locator('visible=true')).toBeVisible(); | ^ 157 | await expect(page.getByText(TEXTS.NON_PERSONALIZED).locator('visible=true')).toBeVisible(); 158 | await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_A })).toBeHidden(); 159 | await expect(page.locator(SELECTOR, { hasText: TEXTS.DEFAULT_CONTENT })).toBeHidden(); at /home/runner/work/builder/builder/packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts:156:82

Check failure on line 156 in packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts

View workflow job for this annotation

GitHub Actions / Gen 2 SDKs (nextjs-sdk-next-app)

[nextjs-sdk-next-app] › personalization-container.spec.ts:133:7 › Personalization Container › entire page › #2/2: Render variant B w/ SSR

6) [nextjs-sdk-next-app] › personalization-container.spec.ts:133:7 › Personalization Container › entire page › #2/2: Render variant B w/ SSR Error: Timed out 5000ms waiting for expect(locator).toBeVisible() Locator: getByText('Experiment B').locator('visible=true') Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 5000ms - waiting for getByText('Experiment B').locator('visible=true') 154 | await page.goto('/personalization-container'); 155 | > 156 | await expect(page.getByText(TEXTS.EXPERIMENT_B).locator('visible=true')).toBeVisible(); | ^ 157 | await expect(page.getByText(TEXTS.NON_PERSONALIZED).locator('visible=true')).toBeVisible(); 158 | await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_A })).toBeHidden(); 159 | await expect(page.locator(SELECTOR, { hasText: TEXTS.DEFAULT_CONTENT })).toBeHidden(); at /home/runner/work/builder/builder/packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts:156:82
await expect(page.getByText(TEXTS.NON_PERSONALIZED).locator('visible=true')).toBeVisible();
await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_A })).toBeHidden();

Check failure on line 158 in packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts

View workflow job for this annotation

GitHub Actions / Gen 2 SDKs (svelte)

[svelte] › personalization-container.spec.ts:133:7 › Personalization Container › entire page › #1/2: Render variant B w/ SSR

3) [svelte] › personalization-container.spec.ts:133:7 › Personalization Container › entire page › #1/2: Render variant B w/ SSR Error: Timed out 5000ms waiting for expect(locator).toBeHidden() Locator: locator('div[builder-content-id]').filter({ hasText: 'Experiment A' }) Expected: hidden Received: visible Call log: - expect.toBeHidden with timeout 5000ms - waiting for locator('div[builder-content-id]').filter({ hasText: 'Experiment A' }) - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" 156 | await expect(page.getByText(TEXTS.EXPERIMENT_B).locator('visible=true')).toBeVisible(); 157 | await expect(page.getByText(TEXTS.NON_PERSONALIZED).locator('visible=true')).toBeVisible(); > 158 | await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_A })).toBeHidden(); | ^ 159 | await expect(page.locator(SELECTOR, { hasText: TEXTS.DEFAULT_CONTENT })).toBeHidden(); 160 | }); 161 | } at /home/runner/work/builder/builder/packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts:158:79

Check failure on line 158 in packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts

View workflow job for this annotation

GitHub Actions / Gen 2 SDKs (svelte)

[svelte] › personalization-container.spec.ts:133:7 › Personalization Container › entire page › #2/2: Render variant B w/ SSR

6) [svelte] › personalization-container.spec.ts:133:7 › Personalization Container › entire page › #2/2: Render variant B w/ SSR Error: Timed out 5000ms waiting for expect(locator).toBeHidden() Locator: locator('div[builder-content-id]').filter({ hasText: 'Experiment A' }) Expected: hidden Received: visible Call log: - expect.toBeHidden with timeout 5000ms - waiting for locator('div[builder-content-id]').filter({ hasText: 'Experiment A' }) - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" - locator resolved to <div builder-model="page" classname="variant-unique-id" builder-content-id="unique-id">…</div> - unexpected value "visible" 156 | await expect(page.getByText(TEXTS.EXPERIMENT_B).locator('visible=true')).toBeVisible(); 157 | await expect(page.getByText(TEXTS.NON_PERSONALIZED).locator('visible=true')).toBeVisible(); > 158 | await expect(page.locator(SELECTOR, { hasText: TEXTS.EXPERIMENT_A })).toBeHidden(); | ^ 159 | await expect(page.locator(SELECTOR, { hasText: TEXTS.DEFAULT_CONTENT })).toBeHidden(); 160 | }); 161 | } at /home/runner/work/builder/builder/packages/sdks-tests/src/e2e-tests/personalization-container.spec.ts:158:79
await expect(page.locator(SELECTOR, { hasText: TEXTS.DEFAULT_CONTENT })).toBeHidden();
});
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import type { ComponentInfo } from '../../types/components.js';

export const componentInfo: ComponentInfo = {
name: 'PersonalizationContainer',
shouldReceiveBuilderProps: {
builderBlock: true,
builderContext: true,
},
noWrap: true,
image:
'https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F37229ed30d8c41dfb10b8cca1992053a',
canHaveChildren: true,
inputs: [
{
name: 'variants',
defaultValue: [],
behavior: 'personalizationVariantList',
type: 'list',
subFields: [
{
name: 'name',
type: 'text',
},
{
name: 'query',
friendlyName: 'Targeting rules',
type: 'BuilderQuery',
defaultValue: [],
},
{
name: 'startDate',
type: 'date',
},
{
name: 'endDate',
type: 'date',
},
{
name: 'blocks',
type: 'uiBlocks',
hideFromUI: true,
defaultValue: [],
},
],
},
],
};
100 changes: 100 additions & 0 deletions packages/sdks/src/blocks/personalization-container/helpers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
import { TARGET } from '../../constants/target.js';
import { filterWithCustomTargetingScript } from '../../functions/filter-with-custom-targeting.js';
import { isBrowser } from '../../functions/is-browser.js';
import { USER_ATTRIBUTES_COOKIE_NAME } from '../../helpers/user-attributes.js';
import type { PersonalizationContainerProps } from './personalization-container.types.js';

export function checkShouldRenderVariants(
variants: PersonalizationContainerProps['variants'],
canTrack: boolean
) {
const hasVariants = variants && variants.length > 0;

if (TARGET === 'reactNative') return false;

if (!hasVariants) return false;
if (!canTrack) return false;

if (TARGET === 'vue' || TARGET === 'svelte') return true;

if (isBrowser()) return false;

return true;
}

export function getPersonalizationScript(
variants: PersonalizationContainerProps['variants'],
blockId: string,
locale?: string
) {
return `
(function() {
if (!navigator.cookieEnabled) {
return;
}
function getCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
}
return null;
}
function removeVariants() {
variants.forEach(function (template, index) {
console.log("removing variant", "${blockId}-" + index);
document.querySelector('template[data-variant-id="' + "${blockId}-" + index + '"]').remove();
});
console.log("removing variants script");
document.querySelector('script[data-id="variants-script-${blockId}"]').remove();
document.querySelector('style[data-id="variants-styles-${blockId}"]').remove();
}
var attributes = JSON.parse(getCookie("${USER_ATTRIBUTES_COOKIE_NAME}") || "{}");
${locale ? `attributes.locale = "${locale}";` : ''}
var variants = ${JSON.stringify(
variants?.map((v) => ({
query: v.query,
startDate: v.startDate,
endDate: v.endDate,
}))
)};
var winningVariantIndex = variants.findIndex(function(variant) {
return filterWithCustomTargeting(
attributes,
variant.query,
variant.startDate,
variant.endDate
);
});
var isDebug = location.href.includes('builder.debug=true');
if (isDebug) {
console.debug('PersonalizationContainer', {
attributes: attributes,
variants: variants,
winningVariantIndex: winningVariantIndex,
});
}
if (winningVariantIndex !== -1) {
var winningVariant = document.querySelector('template[data-variant-id="' + "${blockId}-" + winningVariantIndex + '"]');
console.log("winningVariant", winningVariant);
if (winningVariant) {
var parentNode = winningVariant.parentNode;
var newParent = parentNode.cloneNode(false);
newParent.appendChild(winningVariant.content.firstChild);
newParent.appendChild(winningVariant.content.lastChild);
parentNode.parentNode.replaceChild(newParent, parentNode);
if (isDebug) {
console.debug('PersonalizationContainer', 'Winning variant Replaced:', winningVariant);
}
}
} else if (variants.length > 0) {
removeVariants();
}
${filterWithCustomTargetingScript}
})();
`.replace(/\s+/g, ' ');
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './personalization-container.lite.jsx';
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
import {
For,
Fragment,
onMount,
Show,
useMetadata,
useStore,
} from '@builder.io/mitosis';
import Blocks from '../../components/blocks/blocks.lite.jsx';
import InlinedScript from '../../components/inlined-script.lite.jsx';
import InlinedStyles from '../../components/inlined-styles.lite.jsx';
import { filterWithCustomTargeting } from '../../functions/filter-with-custom-targeting.js';
import { isEditing } from '../../functions/is-editing.js';
import { getDefaultCanTrack } from '../../helpers/canTrack.js';
import { userAttributesSubscriber } from '../../helpers/user-attributes.js';
import {
checkShouldRenderVariants,
getPersonalizationScript,
} from './helpers.js';
import type { PersonalizationContainerProps } from './personalization-container.types.js';

useMetadata({
rsc: {
componentType: 'client',
},
});

export default function PersonalizationContainer(
props: PersonalizationContainerProps
) {
const state = useStore({
scriptStr: getPersonalizationScript(
props.variants,
props.builderBlock?.id || 'none',
props.builderContext.value?.rootState?.locale as string | undefined
),
shouldRenderVariants: checkShouldRenderVariants(
props.variants,
getDefaultCanTrack(props.builderContext.value?.canTrack)
),
isHydrated: false,
get filteredVariants() {
return (props.variants || []).filter((variant) => {
return filterWithCustomTargeting(
{
...(props.builderContext.value?.rootState?.locale
? { locale: props.builderContext.value?.rootState?.locale }
: {}),
...(userAttributesSubscriber.getUserAttributes() as any),
},
variant.query,
variant.startDate,
variant.endDate
);
});
},
get winningVariant() {
return state.filteredVariants[0];
},
get hideVariantsStyleString() {
return (props.variants || [])
.map(
(_, index) =>
`[data-variant-id="${props.builderBlock?.id}-${index}"] { display: none; } `
)
.join('');
},
});

onMount(() => {
state.isHydrated = true;
});

return (
<Fragment>
<div
{...props.attributes}
class={`builder-personalization-container ${props.attributes?.class || ''}`}
>
<Show when={state.shouldRenderVariants}>
<For each={props.variants}>
{(variant, index) => (
<template
key={index}
data-variant-id={`${props.builderBlock?.id}-${index}`}
>
<Blocks
blocks={variant.blocks}
parent={props.builderBlock?.id}
path={`component.options.variants.${index}.blocks`}
/>
</template>
)}
</For>
<InlinedStyles
nonce={props.builderContext.value?.nonce || ''}
styles={state.hideVariantsStyleString}
id={`variants-styles-${props.builderBlock?.id}`}
/>
<InlinedScript
nonce={props.builderContext.value?.nonce || ''}
scriptStr={state.scriptStr}
id={`variants-script-${props.builderBlock?.id}`}
/>
</Show>
<Show
when={
state.isHydrated &&
isEditing() &&
typeof props.previewingIndex === 'number' &&
props.previewingIndex < (props.variants?.length || 0) &&
!state.filteredVariants.length
}
else={
<Show
when={state.winningVariant}
else={
<Blocks
blocks={props.builderBlock?.children}
parent={props.builderBlock?.id}
/>
}
>
<Blocks
blocks={state.winningVariant?.blocks}
parent={props.builderBlock?.id}
path={`component.options.variants.${props.variants?.indexOf(
state.winningVariant
)}.blocks`}
/>
</Show>
}
>
<Blocks
blocks={props.variants?.[Number(props.previewingIndex)]?.blocks}
parent={props.builderBlock?.id}
path={`component.options.variants.${props.previewingIndex}.blocks`}
/>
</Show>
</div>
</Fragment>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import type { Query } from '../../functions/filter-with-custom-targeting.js';
import type { BuilderBlock } from '../../types/builder-block.js';
import type { BuilderDataProps } from '../../types/builder-props.js';

export type PersonalizationContainerProps = {
children?: any;
attributes?: any;
previewingIndex?: number | null;
variants?: Array<{
blocks: BuilderBlock[];
query: Query[];
startDate?: string;
endDate?: string;
}>;
} & BuilderDataProps;
6 changes: 6 additions & 0 deletions packages/sdks/src/constants/builder-registered-components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import { componentInfo as fragmentComponentInfo } from '../blocks/fragment/compo
import { default as Fragment } from '../blocks/fragment/index.js';
import { componentInfo as imageComponentInfo } from '../blocks/image/component-info.js';
import { default as Image } from '../blocks/image/index.js';
import { componentInfo as personalizationContainerComponentInfo } from '../blocks/personalization-container/component-info.js';
import { default as PersonalizationContainer } from '../blocks/personalization-container/index.js';
import { componentInfo as sectionComponentInfo } from '../blocks/section/component-info.js';
import { default as Section } from '../blocks/section/index.js';
import { componentInfo as slotComponentInfo } from '../blocks/slot/component-info.js';
Expand Down Expand Up @@ -36,6 +38,10 @@ export const getDefaultRegisteredComponents: () => RegisteredComponent[] =
{ component: Slot, ...slotComponentInfo },
{ component: Symbol, ...symbolComponentInfo },
{ component: Text, ...textComponentInfo },
{
component: PersonalizationContainer,
...personalizationContainerComponentInfo,
},
...(TARGET === 'rsc'
? []
: [
Expand Down
Loading
Loading