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

add visual editing tests for columns in gen1 sdk #3714

Draft
wants to merge 2 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
22 changes: 12 additions & 10 deletions packages/sdks-tests/src/e2e-tests/editing.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import { expect } from '@playwright/test';

Check failure on line 1 in packages/sdks-tests/src/e2e-tests/editing.spec.ts

View workflow job for this annotation

GitHub Actions / Gen 1 React SDK (gen1-react)

[gen1-react] › editing.spec.ts:166:5 › Visual Editing › Column block › correctly updates nested Text block

1) [gen1-react] › editing.spec.ts:166:5 › Visual Editing › Column block › correctly updates nested Text block Test timeout of 30000ms exceeded.
import {
COLUMNS_WITH_NEW_SPACE,
COLUMNS_WITH_NEW_TEXT,
COLUMNS_WITH_NEW_WIDTHS,
} from '../specs/columns.js';
import { COLUMNS, COLUMNS_WITH_NEW_SPACE, COLUMNS_WITH_NEW_WIDTHS } from '../specs/columns.js';
import { NEW_TEXT } from '../specs/helpers.js';
import { HOMEPAGE } from '../specs/homepage.js';
import { checkIsRN, test } from '../helpers/index.js';
Expand Down Expand Up @@ -157,7 +153,7 @@
model: 'symbol',
});

await page.frameLocator('iframe').getByText('something other than the symbol!').waitFor();

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

View workflow job for this annotation

GitHub Actions / Gen 2 SDKs (vue)

[vue] › editing.spec.ts:130:3 › Visual Editing › nested ContentVariants with same model name should not duplicate content

1) [vue] › editing.spec.ts:130:3 › Visual Editing › nested ContentVariants with same model name should not duplicate content Error: locator.waitFor: Test ended. Call log: - waiting for locator('iframe').contentFrame().getByText('something other than the symbol!') to be visible 154 | }); 155 | > 156 | await page.frameLocator('iframe').getByText('something other than the symbol!').waitFor(); | ^ 157 | 158 | const textBlocks = await page 159 | .frameLocator('iframe') at /home/runner/work/builder/builder/packages/sdks-tests/src/e2e-tests/editing.spec.ts:156:85

const textBlocks = await page
.frameLocator('iframe')
Expand All @@ -171,13 +167,19 @@
test.skip(
packageName === 'nextjs-sdk-next-app' ||
packageName === 'gen1-next' ||
packageName === 'gen1-react' ||
packageName === 'gen1-remix'
);

await launchEmbedderAndWaitForSdk({ path: '/columns', basePort, page, sdk });
await sendContentUpdateMessage({ page, newContent: COLUMNS_WITH_NEW_TEXT, model: 'page' });
await launchEmbedderAndWaitForSdk({ path: '/columns-editing', basePort, page, sdk });
await sendPatchOrUpdateMessage({
page,
content: cloneContent(COLUMNS),
model: 'page',
sdk,
path: '/data/blocks/2/children/1/component/options/columns/0/blocks/1/component/options/text',
updateFn: () => NEW_TEXT,
});
await page.frameLocator('iframe').getByText(NEW_TEXT).waitFor();

Check failure on line 182 in packages/sdks-tests/src/e2e-tests/editing.spec.ts

View workflow job for this annotation

GitHub Actions / Gen 1 React SDK (gen1-react)

[gen1-react] › editing.spec.ts:166:5 › Visual Editing › Column block › correctly updates nested Text block

1) [gen1-react] › editing.spec.ts:166:5 › Visual Editing › Column block › correctly updates nested Text block Error: locator.waitFor: Test timeout of 30000ms exceeded. Call log: - waiting for locator('iframe').contentFrame().getByText('completely-new-text') to be visible 180 | updateFn: () => NEW_TEXT, 181 | }); > 182 | await page.frameLocator('iframe').getByText(NEW_TEXT).waitFor(); | ^ 183 | }); 184 | test('correctly updates space prop', async ({ page, basePort, packageName, sdk }) => { 185 | test.skip( at /home/runner/work/builder/builder/packages/sdks-tests/src/e2e-tests/editing.spec.ts:182:61
});
test('correctly updates space prop', async ({ page, basePort, packageName, sdk }) => {
test.skip(
Expand All @@ -190,7 +192,7 @@
const selector = checkIsRN(sdk)
? '[data-builder-block-name=builder-column]'
: '.builder-column';
await launchEmbedderAndWaitForSdk({ path: '/columns', basePort, page, sdk });
await launchEmbedderAndWaitForSdk({ path: '/columns-editing', basePort, page, sdk });
const secondColumn = page.frameLocator('iframe').locator(selector).nth(1);

await expect(secondColumn).toHaveCSS('margin-left', checkIsRN(sdk) ? '0px' : '20px');
Expand All @@ -206,7 +208,7 @@
packageName === 'gen1-remix'
);

await launchEmbedderAndWaitForSdk({ path: '/columns', basePort, page, sdk });
await launchEmbedderAndWaitForSdk({ path: '/columns-editing', basePort, page, sdk });
const secondColumn = page.frameLocator('iframe').locator('.builder-column').nth(1);

const initialWidth = await secondColumn.evaluate(el =>
Expand Down
2 changes: 2 additions & 0 deletions packages/sdks-tests/src/specs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export const PAGES = {
'/can-track-false': HOMEPAGE,
'/css-nesting': cssNesting,
'/columns': COLUMNS,
'/columns-editing': COLUMNS,
'/symbols': symbols,
'/js-code': JS_CODE_CONTENT,
'/symbols-without-content': CONTENT_WITHOUT_SYMBOLS,
Expand Down Expand Up @@ -198,6 +199,7 @@ export const VISUAL_EDITING_PATHNAMES = [
'/no-trusted-hosts',
'/editing-styles-no-trusted-hosts',
'/editing',
'/columns-editing',
] satisfies Path[];

export const getProps = async (args: {
Expand Down
Loading