🎥 Make videos programmatically with React
Internal: Remove recurrently flaky Studio E2E tests
Jonny Burger535c6038ce81
diff --git a/packages/example/e2e/inspector-section-collapse.test.mts b/packages/example/e2e/inspector-section-collapse.test.mtsdeleted file mode 100644index 56026ce035..0000000000--- a/packages/example/e2e/inspector-section-collapse.test.mts+++ /dev/null@@ -1,867 +0,0 @@-import fs from 'fs';-import {expect, type Page, test} from '@playwright/test';-import {- EXPANDED_SIDEBAR_STATE,- STUDIO_URL,- visualMode3DFile,-} from './constants.mts';-import {startStudio, stopStudio} from './studio-server.mts';--test.use({storageState: EXPANDED_SIDEBAR_STATE});--let visualMode3DSourceBefore: string;--const read2DTransformRotation = () => {- const source = fs.readFileSync(visualMode3DFile, 'utf-8');- const sequenceStart = source.indexOf('name="2D transform"');- const sequenceEnd = source.indexOf('name="3D transform"');- const sequenceSource = source.slice(sequenceStart, sequenceEnd);- return /rotate: '([^']+)'/.exec(sequenceSource)?.[1] ?? null;-};--const read2DTransformScale = () => {- const source = fs.readFileSync(visualMode3DFile, 'utf-8');- const sequenceStart = source.indexOf('name="2D transform"');- const sequenceEnd = source.indexOf('name="3D transform"');- const sequenceSource = source.slice(sequenceStart, sequenceEnd);- return /scale: ([^,}\n]+)/.exec(sequenceSource)?.[1] ?? null;-};--const read2DTransformTranslate = () => {- const source = fs.readFileSync(visualMode3DFile, 'utf-8');- const sequenceStart = source.indexOf('name="2D transform"');- const sequenceEnd = source.indexOf('name="3D transform"');- const sequenceSource = source.slice(sequenceStart, sequenceEnd);- return /translate: '([^']+)'/.exec(sequenceSource)?.[1] ?? null;-};--const read2DTransformOrigin = () => {- const source = fs.readFileSync(visualMode3DFile, 'utf-8');- const sequenceStart = source.indexOf('name="2D transform"');- const sequenceEnd = source.indexOf('name="3D transform"');- const sequenceSource = source.slice(sequenceStart, sequenceEnd);- return /transformOrigin: '([^']+)'/.exec(sequenceSource)?.[1] ?? null;-};--const read3DTransformRotation = () => {- const source = fs.readFileSync(visualMode3DFile, 'utf-8');- const sequenceStart = source.indexOf('name="3D transform"');- const sequenceSource = source.slice(sequenceStart);- return /rotate: '([^']+)'/.exec(sequenceSource)?.[1] ?? null;-};--const select2DTransformAndWaitForInspector = async (page: Page) => {- const transform = page.getByText('2D transform', {exact: true}).first();- const show3DTransformControls = page.getByRole('button', {- name: 'Show 3D transform controls',- });-- await expect(async () => {- await transform.click();- await expect(show3DTransformControls).toBeVisible({timeout: 1_000});- }).toPass({timeout: 30_000});-};--test.describe('inspector section collapse', () => {- test.beforeEach(async () => {- visualMode3DSourceBefore = fs.readFileSync(visualMode3DFile, 'utf-8');- await startStudio();- });-- test.afterEach(async () => {- await stopStudio();- fs.writeFileSync(visualMode3DFile, visualMode3DSourceBefore);- });-- test('edits visual-mode-3d transforms and collapses inactive inspector sections', async ({- page,- }) => {- test.setTimeout(180_000);- await page.goto(`${STUDIO_URL}/visual-mode-3d`);- await expect(page).toHaveURL(/visual-mode-3d/, {timeout: 15_000});- await page.waitForFunction(- () => !document.body.innerText.includes('Loading...'),- {timeout: 30_000},- );-- const selectedOutline = page.locator(- 'polygon[data-remotion-directly-selected-outline="true"]',- );- const canvasRotationSurface = page.locator(- '[data-remotion-studio-canvas-rotation]',- );-- await select2DTransformAndWaitForInspector(page);- await expect(- page.getByRole('button', {name: 'Show 3D transform controls'}),- ).toBeVisible();- await expect(selectedOutline).toBeVisible();- await selectedOutline.click({button: 'right'});- await page.getByRole('button', {name: 'Rotate', exact: true}).click();- await expect(canvasRotationSurface).toBeVisible();-- await page.keyboard.press('Escape');- await expect(canvasRotationSurface).not.toBeVisible();- await expect(selectedOutline).toBeVisible();-- await page.keyboard.press('Escape');- await expect(- page.getByRole('button', {name: 'Show 3D transform controls'}),- ).not.toBeVisible();-- await page.reload();- await page.waitForFunction(- () => !document.body.innerText.includes('Loading...'),- {timeout: 30_000},- );- await select2DTransformAndWaitForInspector(page);- await expect(- page.getByRole('button', {name: 'Show 3D transform controls'}),- ).toBeVisible();- await expect(selectedOutline).toBeVisible();- await selectedOutline.click({button: 'right'});- await page.getByRole('button', {name: 'Crop', exact: true}).click();- await expect(- page.locator('[data-remotion-studio-crop-preview]'),- ).toBeVisible();-- await page.keyboard.press('Escape');- await expect(- page.locator('[data-remotion-studio-crop-preview]'),- ).not.toBeVisible();- await expect(selectedOutline).toBeVisible();-- const tinyScaleEdges = page.locator(- '[data-remotion-studio-scale-edge-contains-selection="true"]',- );- const tinySelectedOutline = page.locator(- 'polygon[data-remotion-directly-selected-outline="true"]',- );- const tinyTransform = page- .getByText('Tiny transform', {exact: true})- .first();- await expect(async () => {- await tinyTransform.click();- await expect(tinySelectedOutline).toHaveCount(1, {timeout: 1_000});- const dimensions = await tinySelectedOutline.evaluate((outline) => {- const rect = outline.getBoundingClientRect();- return {height: rect.height, width: rect.width};- });- expect(dimensions.width).toBeGreaterThan(0);- expect(dimensions.width).toBeLessThan(16);- expect(dimensions.height).toBeGreaterThan(0);- expect(dimensions.height).toBeLessThan(16);- await expect(tinyScaleEdges).toHaveCount(0, {timeout: 1_000});- }).toPass({timeout: 30_000});- await expect(- page.locator(- '[data-remotion-studio-rotation-corner-contains-selection="true"]',- ),- ).toHaveCount(0);-- await select2DTransformAndWaitForInspector(page);- await expect(- page.getByRole('button', {name: 'Show 3D transform controls'}),- ).toBeVisible();- await expect(selectedOutline).toHaveCount(1);- await selectedOutline.dispatchEvent('contextmenu');- await page.getByRole('button', {name: 'Rotate', exact: true}).click();- await expect(- page.getByRole('button', {name: 'Rotation X', exact: true}).first(),- ).toBeVisible();- await expect(- page.getByRole('button', {- name: 'Hide 3D transform controls',- exact: true,- }),- ).toBeVisible();-- const rightScaleEdge = page- .locator(- '[data-remotion-studio-scale-edge="right"][data-remotion-studio-scale-edge-contains-selection="true"]',- )- .first();- await expect(rightScaleEdge).toHaveCount(1);- const edgeCenter = await rightScaleEdge.evaluate((element) => {- if (!(element instanceof SVGLineElement)) {- throw new Error('Scale edge should be an SVG line');- }-- const matrix = element.getScreenCTM();- if (matrix === null) {- throw new Error('Scale edge should have a screen transform');- }-- return new DOMPoint(- (element.x1.baseVal.value + element.x2.baseVal.value) / 2,- (element.y1.baseVal.value + element.y2.baseVal.value) / 2,- ).matrixTransform(matrix);- });- expect(- await page.evaluate(- ({x, y}) =>- document- .elementFromPoint(x, y)- ?.getAttribute('data-remotion-studio-scale-edge') ?? null,- {x: edgeCenter.x, y: edgeCenter.y},- ),- ).toBe('right');-- const scaleBefore = read2DTransformScale();- await rightScaleEdge.dispatchEvent('pointerdown', {- button: 0,- buttons: 1,- clientX: edgeCenter.x,- clientY: edgeCenter.y,- pointerId: 1,- });- await page.evaluate(- ({x, y}) => {- window.dispatchEvent(- new PointerEvent('pointermove', {- buttons: 1,- clientX: x + 60,- clientY: y,- pointerId: 1,- }),- );- window.dispatchEvent(- new PointerEvent('pointerup', {- button: 0,- buttons: 0,- clientX: x + 60,- clientY: y,- pointerId: 1,- }),- );- },- {x: edgeCenter.x, y: edgeCenter.y},- );- await expect.poll(read2DTransformScale).not.toBe(scaleBefore);- await expect(canvasRotationSurface).toBeVisible();-- const transformOriginHandle = page- .locator('[data-remotion-studio-transform-origin-handle]')- .first();- await expect(transformOriginHandle).toBeVisible();- const dragTransformOrigin = async ({- deltaX,- deltaY,- pointerId,- }: {- readonly deltaX: number;- readonly deltaY: number;- readonly pointerId: number;- }) => {- const transformOriginCenter = await transformOriginHandle.evaluate(- (element) => {- const circle = element.querySelector('circle');- if (!(circle instanceof SVGCircleElement)) {- throw new Error('Transform origin handle should contain a circle');- }-- const matrix = circle.getScreenCTM();- if (matrix === null) {- throw new Error(- 'Transform origin handle should have a screen transform',- );- }-- return new DOMPoint(- circle.cx.baseVal.value,- circle.cy.baseVal.value,- ).matrixTransform(matrix);- },- );- await transformOriginHandle.dispatchEvent('pointerdown', {- button: 0,- buttons: 1,- clientX: transformOriginCenter.x,- clientY: transformOriginCenter.y,- pointerId,- });- await page.evaluate(- ({x, y, moveX, moveY, id}) => {- window.dispatchEvent(- new PointerEvent('pointermove', {- buttons: 1,- clientX: x + moveX,- clientY: y + moveY,- pointerId: id,- }),- );- window.dispatchEvent(- new PointerEvent('pointerup', {- button: 0,- buttons: 0,- clientX: x + moveX,- clientY: y + moveY,- pointerId: id,- }),- );- },- {- x: transformOriginCenter.x,- y: transformOriginCenter.y,- moveX: deltaX,- moveY: deltaY,- id: pointerId,- },- );- };- const transformOriginBefore = read2DTransformOrigin();- await dragTransformOrigin({deltaX: 30, deltaY: 20, pointerId: 2});- await expect.poll(read2DTransformOrigin).not.toBe(transformOriginBefore);- await expect(canvasRotationSurface).toBeVisible();-- const compositionContainer = page.locator(- '.remotion-studio-composition-container',- );- const compositionBox = await compositionContainer.boundingBox();- const rotationSurfaceBox = await canvasRotationSurface.boundingBox();- if (compositionBox === null || rotationSurfaceBox === null) {- throw new Error('Rotation surface should have a visible layout');- }-- expect(rotationSurfaceBox.width).toBeLessThan(compositionBox.width);- expect(rotationSurfaceBox.height).toBeLessThan(compositionBox.height);- const outsidePoint = {- x: compositionBox.x + compositionBox.width - 4,- y: compositionBox.y + compositionBox.height - 4,- };- expect(- await page.evaluate(- ({x, y}) =>- document- .elementFromPoint(x, y)- ?.closest('[data-remotion-studio-canvas-rotation]') ?? null,- outsidePoint,- ),- ).toBeNull();- const rotationBefore = read2DTransformRotation();- const getInteractiveRotationPoint = () =>- canvasRotationSurface.evaluate((surface) => {- const box = surface.getBoundingClientRect();- for (let yIndex = 1; yIndex < 10; yIndex++) {- for (let xIndex = 1; xIndex < 10; xIndex++) {- const point = {- x: box.x + (box.width * xIndex) / 10,- y: box.y + (box.height * yIndex) / 10,- };- if (- document- .elementFromPoint(point.x, point.y)- ?.closest('[data-remotion-studio-canvas-rotation]') === surface- ) {- return point;- }- }- }-- throw new Error('Rotation surface should have an interactive point');- });- const insidePoint = await getInteractiveRotationPoint();- await page.mouse.move(insidePoint.x, insidePoint.y);- await page.mouse.down();- await page.mouse.move(insidePoint.x + 40, insidePoint.y + 30, {steps: 5});- await page.mouse.up();- await expect.poll(read2DTransformRotation).not.toBe(rotationBefore);- const transformOriginAfter3DRotation = read2DTransformOrigin();- await dragTransformOrigin({deltaX: -20, deltaY: 25, pointerId: 3});- await expect- .poll(read2DTransformOrigin)- .not.toBe(transformOriginAfter3DRotation);-- const continuedInsidePoint = await getInteractiveRotationPoint();- const rotationXControl = page- .getByRole('button', {name: 'Rotation X', exact: true})- .first();- const rotationYControl = page- .getByRole('button', {name: 'Rotation Y', exact: true})- .first();- const readRotationControls = async () =>- `${await rotationXControl.textContent()}|${await rotationYControl.textContent()}`;- const rotationBeforeLeavingSurface = await readRotationControls();- const sourceRotationBeforeLeavingSurface = read2DTransformRotation();- await page.mouse.move(continuedInsidePoint.x, continuedInsidePoint.y);- await page.mouse.down();- await page.mouse.move(outsidePoint.x, outsidePoint.y, {steps: 5});- await expect- .poll(readRotationControls)- .not.toBe(rotationBeforeLeavingSurface);- const rotationAfterLeavingSurface = await readRotationControls();- await page.mouse.move(outsidePoint.x - 60, outsidePoint.y, {steps: 3});- await expect- .poll(readRotationControls)- .not.toBe(rotationAfterLeavingSurface);- await page.mouse.up();- await expect- .poll(read2DTransformRotation)- .not.toBe(sourceRotationBeforeLeavingSurface);-- const rotationAfterInsideDrag = read2DTransformRotation();- await page.mouse.move(outsidePoint.x, outsidePoint.y);- await page.mouse.down();- await page.mouse.move(outsidePoint.x + 20, outsidePoint.y + 20);- await page.mouse.up();- await page.waitForTimeout(200);- expect(read2DTransformRotation()).toBe(rotationAfterInsideDrag);-- fs.writeFileSync(visualMode3DFile, visualMode3DSourceBefore);- await page.goto(`${STUDIO_URL}/issue-8216`);- await expect(page).toHaveURL(/issue-8216/, {timeout: 15_000});- await page.waitForFunction(- () => !document.body.innerText.includes('Loading...'),- {timeout: 30_000},- );-- const foreground = page.locator('[title="Foreground"]').first();- const expandBackground = page.getByRole('button', {- name: 'Expand Background',- exact: true,- });- await expect(async () => {- await foreground.click();- await expect(expandBackground).toBeVisible({timeout: 1_000});- }).toPass({timeout: 15_000});- await expect(- page.getByRole('button', {name: 'Expand Border', exact: true}),- ).toBeVisible();- await expect(- page.getByRole('button', {name: 'Expand Border radius', exact: true}),- ).toBeVisible();- await expect(- page.getByTitle('Use individual corner radii', {exact: true}),- ).toHaveCount(0);- await expect(- page.getByRole('button', {name: 'Expand Crop', exact: true}),- ).toBeVisible();- await expect(- page.getByRole('button', {name: 'Collapse Transform', exact: true}),- ).toBeVisible();- await page- .getByRole('button', {name: 'Collapse Transform', exact: true})- .click();- await expect(- page.getByRole('button', {name: 'Expand Transform', exact: true}),- ).toBeVisible();- await expect(- page.getByRole('button', {name: 'Show 3D transform controls'}),- ).toHaveCount(0);- await page- .getByRole('button', {name: 'Expand Transform', exact: true})- .click();- await expect(- page.getByRole('button', {name: 'Show 3D transform controls'}),- ).toBeVisible();- await expect(- page.getByRole('button', {name: 'Collapse Effects', exact: true}),- ).toHaveCount(0);- await expect(- page.getByRole('button', {name: 'Expand Effects', exact: true}),- ).toHaveCount(0);- await expect(page.getByTitle('Add effect', {exact: true})).toBeVisible();-- await page- .getByRole('button', {name: 'Expand Border radius', exact: true})- .click();- await expect(- page.getByTitle('Use individual corner radii', {exact: true}),- ).toBeVisible();- const expandedBorderRadiusButton = page.getByRole('button', {- name: 'Collapse Border radius',- exact: true,- });- await expect(expandedBorderRadiusButton).toBeFocused();- expect(- await expandedBorderRadiusButton.evaluate((element) => {- const style = getComputedStyle(element);- return {boxShadow: style.boxShadow, outlineStyle: style.outlineStyle};- }),- ).toEqual({boxShadow: 'none', outlineStyle: 'none'});-- await page.keyboard.press('Tab');- await page.keyboard.press('Shift+Tab');- await expect(expandedBorderRadiusButton).toBeFocused();- expect(- await expandedBorderRadiusButton.evaluate(- (element) => getComputedStyle(element).boxShadow,- ),- ).not.toBe('none');-- await page.getByRole('button', {name: 'Expand Crop', exact: true}).click();- await expect(- page.getByRole('button', {name: 'Collapse Crop', exact: true}),- ).toBeVisible();- await expect(page.getByText('Crop left', {exact: true})).toBeVisible();-- await page- .locator('[title="Default absolute-fill layout"]')- .first()- .click();- await expect(- page.getByRole('button', {name: 'Expand Layout', exact: true}),- ).toBeVisible();- await page- .getByRole('button', {name: 'Expand Layout', exact: true})- .click();- await expect(page.getByText('Premount For', {exact: true})).toBeVisible();-- await page.locator('[title="Default none layout"]').first().click();- await expect(- page.getByRole('button', {name: 'Expand Layout', exact: true}),- ).toBeVisible();-- await page.locator('[title="Default premount"]').first().click();- await expect(- page.getByRole('button', {name: 'Expand Layout', exact: true}),- ).toBeVisible();- await expect(- page.getByRole('button', {name: 'Collapse Source', exact: true}),- ).toBeVisible();- await page- .getByRole('button', {name: 'Collapse Source', exact: true})- .click();- await expect(- page.getByRole('button', {name: 'Expand Source', exact: true}),- ).toBeVisible();-- await page.goto(`${STUDIO_URL}/visual-mode-3d`);- await expect(page).toHaveURL(/visual-mode-3d/, {timeout: 15_000});- await page.waitForFunction(- () => !document.body.innerText.includes('Loading...'),- {timeout: 30_000},- );-- await page.locator('[title="2D transform"]').first().click();- const show3DControls = page.getByRole('button', {- name: 'Show 3D transform controls',- exact: true,- });- await expect(show3DControls).toBeVisible();- await expect(- page.getByRole('button', {name: 'Scale Z', exact: true}),- ).toHaveCount(0);- await expect(- page.getByRole('button', {name: 'Offset Z', exact: true}),- ).toHaveCount(0);- await expect(- page.getByRole('button', {name: 'Rotation Z', exact: true}),- ).toBeVisible();- await expect(- page.getByRole('button', {name: 'Rotation X', exact: true}),- ).toHaveCount(0);- await page.getByTitle('Rotation', {exact: true}).click();- const laterCompositionContainer = page.locator(- '.remotion-studio-composition-container',- );- const laterCompositionBox = await laterCompositionContainer.boundingBox();- if (laterCompositionBox === null) {- throw new Error('Composition should have a visible layout');- }-- await page.mouse.move(- laterCompositionBox.x + laterCompositionBox.width / 2,- laterCompositionBox.y + laterCompositionBox.height / 2,- );- await expect(canvasRotationSurface).toBeVisible();- expect(- await canvasRotationSurface.evaluate((surface) =>- decodeURIComponent(surface.getAttribute('cursor') ?? ''),- ),- ).toContain('<svg width="24" height="24"');- await expect(- page.locator('[data-remotion-studio-transform-origin-handle]').first(),- ).toBeVisible();- const laterRotationSurfaceBox = await canvasRotationSurface.boundingBox();- if (laterRotationSurfaceBox === null) {- throw new Error('Canvas rotation surface should have a visible layout');- }-- const startX =- laterRotationSurfaceBox.x + laterRotationSurfaceBox.width * 0.25;- const startY =- laterRotationSurfaceBox.y + laterRotationSurfaceBox.height * 0.25;- await page.mouse.move(startX, startY);- await page.mouse.down();- await page.mouse.move(startX + 60, startY + 80, {steps: 5});- await page.mouse.up();- await expect.poll(read2DTransformRotation).toMatch(/^-?\d+(?:\.\d+)?deg$/);-- await show3DControls.click();- await expect(- page.getByRole('button', {name: 'Scale Z', exact: true}),- ).toBeVisible();- await expect(- page.getByRole('button', {name: 'Offset Z', exact: true}),- ).toBeVisible();- await page.getByTitle('Rotation', {exact: true}).click();- await page.mouse.move(- laterCompositionBox.x + laterCompositionBox.width / 2,- laterCompositionBox.y + laterCompositionBox.height / 2,- );- await expect(canvasRotationSurface).toBeVisible();- expect(- await canvasRotationSurface.evaluate((surface) =>- decodeURIComponent(surface.getAttribute('cursor') ?? ''),- ),- ).toContain('<svg width="29" height="30"');- const threeDRotationSurfaceBox = await canvasRotationSurface.boundingBox();- if (threeDRotationSurfaceBox === null) {- throw new Error(- '3D canvas rotation surface should have a visible layout',- );- }-- const threeDStartX =- threeDRotationSurfaceBox.x + threeDRotationSurfaceBox.width * 0.25;- const threeDStartY =- threeDRotationSurfaceBox.y + threeDRotationSurfaceBox.height * 0.25;- await page.mouse.move(threeDStartX, threeDStartY);- await page.mouse.down();- expect(- await canvasRotationSurface.evaluate((surface) =>- surface.ownerSVGElement === null- ? null- : getComputedStyle(surface.ownerSVGElement).cursor,- ),- ).toContain('data:image/svg+xml');- await page.mouse.move(threeDStartX + 80, threeDStartY + 60, {steps: 5});- await page.mouse.up();- expect(- await canvasRotationSurface.evaluate((surface) =>- surface.ownerSVGElement === null- ? null- : getComputedStyle(surface.ownerSVGElement).cursor,- ),- ).not.toContain('data:image/svg+xml');- await expect- .poll(() => read2DTransformRotation()?.split(' ').length)- .toBe(4);- const scaleLabelBox = await page- .getByTitle('Scale', {exact: true})- .first()- .boundingBox();- const scaleXBox = await page- .getByRole('button', {name: 'Scale X', exact: true})- .first()- .boundingBox();- const scaleZBox = await page- .getByRole('button', {name: 'Scale Z', exact: true})- .first()- .boundingBox();- if (scaleLabelBox === null || scaleXBox === null || scaleZBox === null) {- throw new Error('Scale controls should have a visible layout');- }- const offsetLabelBox = await page- .getByTitle('Offset', {exact: true})- .first()- .boundingBox();- const offsetX = page- .getByRole('button', {name: 'Offset X', exact: true})- .first();- const offsetXBox = await offsetX.boundingBox();- const offsetZ = page- .getByRole('button', {name: 'Offset Z', exact: true})- .first();- const offsetZBox = await offsetZ.boundingBox();- if (offsetLabelBox === null || offsetXBox === null || offsetZBox === null) {- throw new Error('Offset controls should have a visible layout');- }-- expect(- scaleZBox.y - (scaleLabelBox.y + scaleLabelBox.height),- ).toBeGreaterThanOrEqual(-1);- expect(- scaleZBox.y - (scaleLabelBox.y + scaleLabelBox.height),- ).toBeLessThanOrEqual(1);- expect(- offsetZBox.y - (offsetLabelBox.y + offsetLabelBox.height),- ).toBeGreaterThanOrEqual(-1);- expect(- offsetZBox.y - (offsetLabelBox.y + offsetLabelBox.height),- ).toBeLessThanOrEqual(1);- await expect(- page.getByRole('button', {name: 'Rotation X', exact: true}).first(),- ).toBeVisible();- await expect(- page.getByRole('button', {name: 'Rotation Y', exact: true}).first(),- ).toBeVisible();- await expect(- page.getByRole('button', {name: 'Rotation Z', exact: true}).first(),- ).toBeVisible();- const rotationLabelBox = await page- .getByTitle('Rotation', {exact: true})- .first()- .boundingBox();- const rotationXBox = await page- .getByRole('button', {name: 'Rotation X', exact: true})- .first()- .boundingBox();- if (rotationLabelBox === null || rotationXBox === null) {- throw new Error('Rotation controls should have a visible layout');- }-- expect(- rotationXBox.y - (rotationLabelBox.y + rotationLabelBox.height),- ).toBeGreaterThanOrEqual(-1);- expect(- rotationXBox.y - (rotationLabelBox.y + rotationLabelBox.height),- ).toBeLessThanOrEqual(1);- expect(Math.abs(scaleXBox.x - rotationXBox.x)).toBeLessThanOrEqual(1);- expect(Math.abs(scaleXBox.x - offsetXBox.x)).toBeLessThanOrEqual(1);- await expect(- page- .getByRole('button', {name: 'Transform origin Z', exact: true})- .first(),- ).toBeVisible();- await offsetZ.click();- const offsetZInput = page.getByRole('textbox', {- name: 'Offset Z',- exact: true,- });- await offsetZInput.fill('25');- await offsetZInput.press('Enter');- await expect.poll(read2DTransformTranslate).toBe('0px 0px 25px');- await expect(- page.getByRole('button', {- name: '3D controls are required by the current transform values',- exact: true,- }),- ).toBeDisabled();-- const threeDTransformElement = page- .locator('[title="3D transform"]')- .first();- await threeDTransformElement.click();- await expect(- page- .getByRole('button', {- name: '3D controls are required by the current transform values',- exact: true,- })- .first(),- ).toBeDisabled();- await expect(- page.getByRole('button', {name: 'Scale Z', exact: true}).first(),- ).toBeVisible();- await expect(- page.getByRole('button', {name: 'Rotation X', exact: true}).first(),- ).not.toContainText('X ');- await page.getByTitle('Rotation', {exact: true}).click();- const rotationX = page- .getByRole('button', {name: 'Rotation X', exact: true})- .first();- const rotationY = page- .getByRole('button', {name: 'Rotation Y', exact: true})- .first();- const rotationZ = page- .getByRole('button', {name: 'Rotation Z', exact: true})- .first();- const rotationXBefore = await rotationX.textContent();- const rotationYBefore = await rotationY.textContent();- const rotationZBefore = await rotationZ.textContent();- const sourceRotationBefore = read3DTransformRotation();- await page.locator('[title="3D transform"]').last().hover();- const getRotationCornerCenter = async (- corner: 'top-left' | 'top-right' | 'bottom-right' | 'bottom-left',- ) => {- const box = await page- .locator(- `[data-remotion-studio-rotation-corner="${corner}"][data-remotion-studio-rotation-corner-contains-selection="true"]`,- )- .first()- .boundingBox();- if (box === null) {- throw new Error(`The ${corner} rotation corner should be visible`);- }-- return {x: box.x + box.width / 2, y: box.y + box.height / 2};- };- const [topLeft, topRight, bottomRight, bottomLeft] = await Promise.all([- getRotationCornerCenter('top-left'),- getRotationCornerCenter('top-right'),- getRotationCornerCenter('bottom-right'),- getRotationCornerCenter('bottom-left'),- ]);- const topEdgeLength = Math.hypot(- topRight.x - topLeft.x,- topRight.y - topLeft.y,- );- const bottomEdgeLength = Math.hypot(- bottomRight.x - bottomLeft.x,- bottomRight.y - bottomLeft.y,- );- expect(Math.abs(topEdgeLength - bottomEdgeLength)).toBeGreaterThan(1);- const selectedRotationCorner = page- .locator(- '[data-remotion-studio-rotation-corner="top-right"][data-remotion-studio-rotation-corner-contains-selection="true"]',- )- .first();- await expect(selectedRotationCorner).toBeVisible();- const selectedRotationCornerBox =- await selectedRotationCorner.boundingBox();- if (selectedRotationCornerBox === null) {- throw new Error('Selected rotation corner should have a visible layout');- }-- const cornerX =- selectedRotationCornerBox.x + selectedRotationCornerBox.width / 2;- const cornerY =- selectedRotationCornerBox.y + selectedRotationCornerBox.height / 2;- expect(- await page.evaluate(- ({x, y}) =>- document- .elementFromPoint(x, y)- ?.getAttribute('data-remotion-studio-rotation-corner') ?? null,- {x: cornerX, y: cornerY},- ),- ).toBe('top-right');- await selectedRotationCorner.dispatchEvent('pointerdown', {- button: 0,- buttons: 1,- clientX: cornerX,- clientY: cornerY,- pointerId: 1,- });- await page.evaluate(- ({x, y}) => {- window.dispatchEvent(- new PointerEvent('pointermove', {- buttons: 1,- clientX: x + 60,- clientY: y + 40,- pointerId: 1,- }),- );- window.dispatchEvent(- new PointerEvent('pointerup', {- button: 0,- buttons: 0,- clientX: x + 60,- clientY: y + 40,- pointerId: 1,- }),- );- },- {x: cornerX, y: cornerY},- );- await expect.poll(read3DTransformRotation).not.toBe(sourceRotationBefore);- await expect- .poll(() => read3DTransformRotation()?.split(' ').length)- .toBe(4);- await expect(rotationX).toHaveText(rotationXBefore ?? '');- await expect(rotationY).toHaveText(rotationYBefore ?? '');- await expect(rotationZ).not.toHaveText(rotationZBefore ?? '');- await expect- .poll(async () => {- const [nextTopLeft, nextTopRight] = await Promise.all([- getRotationCornerCenter('top-left'),- getRotationCornerCenter('top-right'),- ]);- return Math.abs(nextTopLeft.y - nextTopRight.y);- })- .toBeGreaterThan(1);- });-});diff --git a/packages/example/e2e/studio.test.mts b/packages/example/e2e/studio.test.mtsindex 81239c0653..11a9b26798 100644--- a/packages/example/e2e/studio.test.mts+++ b/packages/example/e2e/studio.test.mts@@ -1132,97 +1132,6 @@ test.describe('visual mode', () => {}});- test('should only open the editor from non-interactive inspector content', async ({- page,- }) => {- await page.addInitScript(() => {- window.localStorage.setItem(- 'remotion.sidebarRightCollapsing',- 'expanded',- );- Object.defineProperty(window, 'remotion_editorName', {- configurable: true,- get: () => 'Test editor',- set: () => undefined,- });- });- await page.route('**/api/default-editor-info', async (route) => {- await route.fulfill({- json: {- success: true,- data: {- defaultEditor: 'vscode',- installedEditors: [- {- id: 'vscode',- name: 'Test editor',- nameWithType: 'Test editor',- },- ],- },- },- });- });- const openInEditorRequests: unknown[] = [];- await page.route('**/api/open-in-editor', async (route) => {- openInEditorRequests.push(route.request().postDataJSON());- await route.fulfill({- json: {success: true, data: {success: true}},- });- });-- await page.goto(`${STUDIO_URL}/AnimatedBarChart`);- const eyebrow = page.getByText('Eyebrow', {exact: true}).first();- await expect(eyebrow).toBeVisible({timeout: 15_000});- const textField = page.getByRole('textbox');- await expect(async () => {- await eyebrow.click();- await expect(textField).toHaveValue('Performance overview', {- timeout: 1_000,- });- }).toPass({timeout: 30_000});-- await page.getByTitle('Text', {exact: true}).dblclick();- await expect.poll(() => openInEditorRequests.length).toBe(1);- openInEditorRequests.length = 0;-- await textField.dblclick({position: {x: 20, y: 20}});- await expect- .poll(() =>- textField.evaluate((element) =>- element.value.slice(element.selectionStart, element.selectionEnd),- ),- )- .toBe('overview');- // Headless Chromium does not consistently emit dblclick after selecting text.- await textField.dispatchEvent('dblclick');- const numberDragger = page- .locator('button.__remotion_input_dragger')- .first();- await expect(numberDragger).toBeVisible();- await numberDragger.dispatchEvent('dblclick');- const colorPicker = page.getByTitle('#8E9AB8', {exact: true});- await expect(colorPicker).toBeVisible();- await colorPicker.dispatchEvent('dblclick');-- await page.goto(`${STUDIO_URL}/effect-keyframe-e2e`);- await page.waitForFunction(- () => !document.body.innerText.includes('Loading...'),- {timeout: 30_000},- );- const scaleEffectRow = page.getByText('scale()', {exact: true});- await expect(async () => {- await page.getByTitle('Scale precision', {exact: true}).first().click();- await expect(scaleEffectRow).toBeVisible({timeout: 1_000});- }).toPass({timeout: 15_000});- await scaleEffectRow.click();- const horizontalCheckbox = page.locator('input[name="horizontal"]');- await expect(horizontalCheckbox).toBeVisible();- await horizontalCheckbox.dispatchEvent('dblclick');- await page.waitForTimeout(100);- expect(openInEditorRequests).toEqual([]);- });-test('should preserve property selection while dragging its outline', async ({page,}) => {@@ -1601,257 +1510,6 @@ test.describe('visual mode', () => {await expect(page).toHaveURL(/timeline-virtualization-testbed/);});- test('should visually reorder and nest compositions and folders', async ({- page,- }) => {- test.setTimeout(60_000);- const initialContents = fs.readFileSync(rootFile, 'utf8');- await page.goto(STUDIO_URL);- await expect(- page.getByTitle('AnimatedBarChart', {exact: true}),- ).toBeVisible({- timeout: 15_000,- });- const firstItemTitle = await page- .locator('.__remotion-composition-selector-item')- .first()- .getAttribute('title');- expect(firstItemTitle).not.toBeNull();- const beforeNoOpDrags = fs.readFileSync(rootFile, 'utf8');- expect(- await dragCompositionSelectorItem({- page,- sourceTitle: firstItemTitle!,- targetTitle: firstItemTitle!,- position: 'before',- dropAtPosition: null,- drop: true,- }),- ).toBe(false);- expect(- await dragCompositionSelectorItem({- page,- sourceTitle: firstItemTitle!,- targetTitle: firstItemTitle!,- position: 'after',- dropAtPosition: null,- drop: true,- }),- ).toBe(false);- await expect(page.locator('[data-composition-reorder-line]')).toHaveCount(- 0,- );- await page.waitForTimeout(250);- expect(fs.readFileSync(rootFile, 'utf8')).toBe(beforeNoOpDrags);- const schemaFolder = page.getByTitle('Schema', {exact: true});- const schemaComposition = page.getByTitle('schema-test', {exact: true});- if ((await schemaFolder.getAttribute('aria-expanded')) === 'true') {- await schemaFolder.click();- }-- await expect(schemaFolder).toHaveAttribute('aria-expanded', 'false');- await expect(schemaComposition).not.toBeVisible();- expect(- await dragCompositionSelectorItem({- page,- sourceTitle: 'AnimatedBarChart',- targetTitle: 'Schema',- position: 'inside',- dropAtPosition: null,- drop: false,- }),- ).toBe(true);- await page.waitForTimeout(500);- await expect(schemaFolder).toHaveAttribute('aria-expanded', 'false');- await expect(schemaComposition).toBeVisible({timeout: 500});- await expect(schemaFolder).toHaveAttribute('aria-expanded', 'true');-- expect(- await dragCompositionSelectorItem({- page,- sourceTitle: 'AnimatedBarChart',- targetTitle: 'Schema',- position: 'before',- dropAtPosition: null,- drop: false,- }),- ).toBe(true);- const reorderLine = page.locator('[data-composition-reorder-line]');- await expect(reorderLine).toBeVisible();- await expect(reorderLine).toHaveCSS('height', '2px');- await expect(reorderLine).toHaveCSS(- 'background-color',- 'rgb(11, 132, 255)',- );- const lineBox = await reorderLine.boundingBox();- const targetBox = await page- .getByTitle('Schema', {exact: true})- .boundingBox();- expect(lineBox).not.toBeNull();- expect(targetBox).not.toBeNull();- expect(Math.abs(lineBox!.y - targetBox!.y)).toBeLessThanOrEqual(2);- expect(lineBox!.width).toBeGreaterThan(targetBox!.width);-- await dragCompositionSelectorItem({- page,- sourceTitle: 'AnimatedBarChart',- targetTitle: 'Schema',- position: 'before',- dropAtPosition: 'inside',- drop: true,- });- await expect- .poll(() => {- const contents = fs.readFileSync(rootFile, 'utf8');- return (- contents.indexOf('id="AnimatedBarChart"') <- contents.indexOf('<Folder name="Schema">')- );- })- .toBe(true);- const afterCompositionReorder = fs.readFileSync(rootFile, 'utf8');- await expect- .poll(async () => {- const compositionBox = await page- .getByTitle('AnimatedBarChart', {exact: true})- .boundingBox();- const folderBox = await page- .getByTitle('Schema', {exact: true})- .boundingBox();- return (- compositionBox !== null &&- folderBox !== null &&- compositionBox.y < folderBox.y- );- })- .toBe(true);- expect(- await dragCompositionSelectorItem({- page,- sourceTitle: 'AnimatedBarChart',- targetTitle: 'Schema',- position: 'before',- dropAtPosition: null,- drop: true,- }),- ).toBe(false);- await page.waitForTimeout(250);- expect(fs.readFileSync(rootFile, 'utf8')).toBe(afterCompositionReorder);-- await dragCompositionSelectorItem({- page,- sourceTitle: 'Schema',- targetTitle: 'use-current-scale-on-load',- position: 'before',- dropAtPosition: null,- drop: true,- });- await expect- .poll(() => {- const contents = fs.readFileSync(rootFile, 'utf8');- return (- contents.indexOf('<Folder name="Schema">') <- contents.indexOf('id="use-current-scale-on-load"')- );- })- .toBe(true);- const afterFolderReorder = fs.readFileSync(rootFile, 'utf8');-- await dragCompositionSelectorItem({- page,- sourceTitle: 'AnimatedBarChart',- targetTitle: 'Schema',- position: 'inside',- dropAtPosition: null,- drop: true,- });- await expect- .poll(() => {- const contents = fs.readFileSync(rootFile, 'utf8');- const folderStart = contents.indexOf('<Folder name="Schema">');- const folderEnd = contents.indexOf('</Folder>', folderStart);- const composition = contents.indexOf('id="AnimatedBarChart"');- return composition > folderStart && composition < folderEnd;- })- .toBe(true);- const afterCompositionNested = fs.readFileSync(rootFile, 'utf8');- await expect- .poll(async () => {- const nestedCompositionBox = await page- .getByTitle('AnimatedBarChart', {exact: true})- .boundingBox();- const schemaCompositionBox = await schemaComposition.boundingBox();- return (- nestedCompositionBox !== null &&- schemaCompositionBox !== null &&- nestedCompositionBox.y > schemaCompositionBox.y- );- })- .toBe(true);-- expect(- await dragCompositionSelectorItemToRoot({- page,- sourceTitle: 'AnimatedBarChart',- drop: false,- }),- ).toBe(true);- const rootReorderLine = page.locator(- '[data-composition-root-reorder-line]',- );- await expect(rootReorderLine).toBeVisible();- await expect(rootReorderLine).toHaveCSS('height', '2px');- await expect(rootReorderLine).toHaveCSS(- 'background-color',- 'rgb(11, 132, 255)',- );- const rootLineBox = await rootReorderLine.boundingBox();- const lastItemBox = await page- .locator('.__remotion-composition-selector-item')- .last()- .boundingBox();- expect(rootLineBox).not.toBeNull();- expect(lastItemBox).not.toBeNull();- expect(rootLineBox!.y).toBeGreaterThanOrEqual(- lastItemBox!.y + lastItemBox!.height - 2,- );-- expect(- await dragCompositionSelectorItemToRoot({- page,- sourceTitle: 'AnimatedBarChart',- drop: true,- }),- ).toBe(true);- await expect- .poll(() => {- const contents = fs.readFileSync(rootFile, 'utf8');- const folderStart = contents.indexOf('<Folder name="Schema">');- const folderEnd = contents.indexOf('</Folder>', folderStart);- const composition = contents.indexOf('id="AnimatedBarChart"');- return composition > folderEnd;- })- .toBe(true);-- const undoButton = page.getByRole('button', {name: /^Undo/});- await undoButton.click();- await expect- .poll(() => fs.readFileSync(rootFile, 'utf8'))- .toBe(afterCompositionNested);- await undoButton.click();- await expect- .poll(() => fs.readFileSync(rootFile, 'utf8'))- .toBe(afterFolderReorder);- await undoButton.click();- await expect- .poll(() => fs.readFileSync(rootFile, 'utf8'))- .toBe(afterCompositionReorder);- await undoButton.click();- await expect- .poll(() => fs.readFileSync(rootFile, 'utf8'))- .toBe(initialContents);- });-test('should play when a composition in the sidebar is focused', async ({page,}) => {@@ -1933,423 +1591,6 @@ test.describe('visual mode', () => {}});- test('settings reuse reactive runtime config and license toggle', async ({- page,- }) => {- test.setTimeout(120_000);- const configFile = path.join(exampleDir, 'remotion.config.ts');- const configBeforeTest = fs.readFileSync(configFile, 'utf8');- let editorInfoRequests = 0;- let codingAgentInfoRequests = 0;- let updateConfigRequests = 0;- page.on('request', (request) => {- if (new URL(request.url()).pathname === '/api/update-config') {- updateConfigRequests++;- }- });- await page.route('**/api/default-editor-info', async (route) => {- editorInfoRequests++;- await route.fulfill({- json: {- success: true,- data: {- defaultEditor: null,- installedEditors: [- {id: 'vscode', name: 'Code', nameWithType: 'Code'},- {- id: 'cursor',- name: 'Cursor',- nameWithType: 'Cursor Editor',- },- ],- },- },- });- });- await page.route('**/api/default-coding-agent-info', async (route) => {- codingAgentInfoRequests++;- await route.fulfill({- json: {- success: true,- data: {- defaultCodingAgent: null,- installedCodingAgents: [- {- id: 'codex',- name: 'Codex',- nameWithType: 'Codex',- },- ],- installedTerminals: [{id: 'ghostty', name: 'Ghostty'}],- },- },- });- });- await page.route('**/api/remotion-skills-info', async (route) => {- await route.fulfill({- json: {- success: true,- data: {- remotionUpgradeSkillAvailable: false,- remotionInteractivitySkillAvailable: false,- skills: [- {- name: 'remotion-best-practices',- installedInProject: true,- installedGlobally: false,- },- {- name: 'remotion-captions',- installedInProject: false,- installedGlobally: false,- },- {- name: 'remotion-create',- installedInProject: false,- installedGlobally: false,- },- {- name: 'remotion-docs',- installedInProject: false,- installedGlobally: true,- },- {- name: 'remotion-interactivity',- installedInProject: false,- installedGlobally: false,- },- {- name: 'remotion-maps',- installedInProject: false,- installedGlobally: false,- },- {- name: 'remotion-markup',- installedInProject: false,- installedGlobally: false,- },- {- name: 'remotion-multimedia',- installedInProject: false,- installedGlobally: false,- },- {- name: 'remotion-render',- installedInProject: false,- installedGlobally: false,- },- {- name: 'remotion-saas',- installedInProject: false,- installedGlobally: false,- },- {- name: 'remotion-studio',- installedInProject: false,- installedGlobally: false,- },- {- name: 'remotion-upgrade',- installedInProject: false,- installedGlobally: false,- },- ],- },- },- });- });- try {- await page.goto(`${STUDIO_URL}/schema-test`);- await page.locator('[data-sidebar-toggle="right"]').click();- await expect(- page.getByRole('group', {name: 'Inspector source location'}).first(),- ).toBeVisible({timeout: 15_000});- await expect- .poll(() => ({codingAgentInfoRequests, editorInfoRequests}))- .toEqual({codingAgentInfoRequests: 1, editorInfoRequests: 1});-- fs.writeFileSync(- configFile,- `${configBeforeTest}\nConfig.setDefaultEditor('cursor');\nConfig.setDefaultCodingAgent('codex');\nConfig.setPublicLicenseKey('free-license');\n`,- );- await expect- .poll(() => fs.readFileSync(configFile, 'utf8'))- .toContain("Config.setDefaultEditor('cursor');");-- await page.getByRole('button', {name: /Search\.\.\./}).click();- const quickSwitcher = page.getByRole('dialog');- await quickSwitcher.getByRole('textbox').fill('> Settings');- await quickSwitcher.getByText('Settings...', {exact: true}).click();- const dialog = page.getByRole('dialog');- await dialog.getByRole('button', {name: 'Defaults', exact: true}).click();- await expect(- dialog.getByText('Default codec', {exact: true}),- ).toBeVisible();- await expect(- dialog.getByText('Output location', {exact: true}),- ).toHaveCount(0);- await expect(- dialog.getByText('Audio bitrate', {exact: true}),- ).toHaveCount(0);- const stillImageFormat = dialog.getByTitle('Still image format', {- exact: true,- });- await expect(stillImageFormat).toHaveText('Default (PNG)');- await stillImageFormat.click();- await page.getByRole('button', {name: 'JPEG', exact: true}).click();- await expect- .poll(() => fs.readFileSync(configFile, 'utf8'))- .toContain("Config.setStillImageFormat('jpeg');");- await expect(stillImageFormat).toHaveText('JPEG');- await stillImageFormat.click();- await page- .getByRole('button', {- name: 'Default (PNG)',- exact: true,- })- .last()- .click();- await expect- .poll(() => fs.readFileSync(configFile, 'utf8'))- .not.toContain('Config.setStillImageFormat');- await expect(stillImageFormat).toHaveText('Default (PNG)');- const audioCodec = dialog.getByTitle('Audio codec', {exact: true});- await expect(audioCodec).toHaveText('Default (Automatic)');- await audioCodec.click();- const automaticAudioCodec = page- .getByRole('button', {- name: 'Default (Automatic)',- exact: true,- })- .last();- const aacAudioCodec = page- .getByRole('button', {- name: 'AAC',- exact: true,- })- .last();- await expect(automaticAudioCodec.getByRole('img')).toHaveCount(1);- await expect(aacAudioCodec.getByRole('img')).toHaveCount(0);- await aacAudioCodec.click();- await expect- .poll(() => fs.readFileSync(configFile, 'utf8'))- .toContain("Config.setAudioCodec('aac');");- await expect(audioCodec).toHaveText('AAC');- await audioCodec.click();- await expect(automaticAudioCodec.getByRole('img')).toHaveCount(0);- await expect(aacAudioCodec.getByRole('img')).toHaveCount(1);- await automaticAudioCodec.click();- await expect- .poll(() => fs.readFileSync(configFile, 'utf8'))- .not.toContain('Config.setAudioCodec');- await expect(audioCodec).toHaveText('Default (Automatic)');- await dialog.getByText('Studio', {exact: true}).click();- for (const setting of [- 'Ask AI enabled',- 'Interactivity enabled',- 'Audio latency hint',- 'Number of shared audio tags',- 'Beep on finish',- 'Bundler',- 'Cross-site isolation',- 'Log level',- ]) {- await expect(dialog.getByText(setting, {exact: true})).toBeVisible();- }- await expect(- dialog.getByRole('button', {name: 'Number of shared audio tags'}),- ).toBeVisible();- await dialog- .getByRole('button', {name: 'Shortcuts', exact: true})- .click();- await expect(- dialog.getByText('Keyboard shortcuts', {exact: true}),- ).toBeVisible();- const keyboardShortcutsEnabled = dialog.getByRole('checkbox', {- name: 'Keyboard shortcuts',- });- await expect(keyboardShortcutsEnabled).toBeChecked();- await keyboardShortcutsEnabled.uncheck();- await expect(- dialog.getByRole('list', {name: 'Playback', exact: true}),- ).toHaveCount(0);- await expect- .poll(() => fs.readFileSync(configFile, 'utf8'))- .toContain('Config.setKeyboardShortcutsEnabled(false);');- await keyboardShortcutsEnabled.check();- await expect- .poll(() => fs.readFileSync(configFile, 'utf8'))- .not.toContain('Config.setKeyboardShortcutsEnabled');- await expect(- dialog.getByRole('list', {name: 'Playback', exact: true}),- ).toBeVisible();- const fixedShortcutRow = dialog- .getByRole('listitem')- .filter({hasText: '1 second back'});- await expect(fixedShortcutRow.getByRole('button')).toHaveCount(0);- const playPauseShortcut = dialog.getByRole('button', {- name: 'Change shortcut for Play / Pause',- });- const playPauseActions = dialog.getByRole('button', {- name: 'Actions for Play / Pause',- });- await expect(playPauseActions).toBeVisible();- await playPauseActions.click();- await page.getByText('Remap shortcut', {exact: true}).click();- await expect(playPauseShortcut).toContainText('Press shortcut');- await expect(playPauseShortcut).toBeFocused();- await page.keyboard.press('q');- await expect- .poll(() => fs.readFileSync(configFile, 'utf8'))- .toContain('Config.setKeyboardShortcuts({');- await expect(playPauseShortcut).toContainText('Q');- await playPauseActions.click();- await expect(- page.getByText('Reset to default', {exact: true}),- ).toBeVisible();- await page.getByText('Remap shortcut', {exact: true}).click();- await expect(playPauseShortcut).toContainText('Press shortcut');- await expect(playPauseShortcut).toBeFocused();- await page.keyboard.press('Space');- await expect- .poll(() => fs.readFileSync(configFile, 'utf8'))- .not.toContain("'playPause'");- await expect(playPauseShortcut).toContainText('Space');- await dialog.getByRole('button', {name: 'Studio', exact: true}).click();-- const askAIEnabled = dialog.getByRole('checkbox', {- name: 'Ask AI enabled',- });- await expect(askAIEnabled).toBeChecked();- await askAIEnabled.uncheck();- await expect- .poll(() => fs.readFileSync(configFile, 'utf8'))- .toContain('Config.setAskAIEnabled(false);');- await askAIEnabled.check();- await expect- .poll(() => fs.readFileSync(configFile, 'utf8'))- .not.toContain('Config.setAskAIEnabled');-- const numberOfSharedAudioTags = dialog.getByRole('button', {- name: 'Number of shared audio tags',- });- await numberOfSharedAudioTags.scrollIntoViewIfNeeded();- const numberOfSharedAudioTagsBounds =- await numberOfSharedAudioTags.boundingBox();- expect(numberOfSharedAudioTagsBounds).not.toBeNull();- const requestsBeforeDrag = updateConfigRequests;- await page.mouse.move(- numberOfSharedAudioTagsBounds!.x +- numberOfSharedAudioTagsBounds!.width / 2,- numberOfSharedAudioTagsBounds!.y +- numberOfSharedAudioTagsBounds!.height / 2,- );- await page.mouse.down();- for (let step = 1; step <= 6; step++) {- await page.mouse.move(- numberOfSharedAudioTagsBounds!.x +- numberOfSharedAudioTagsBounds!.width / 2 +- step * 3,- numberOfSharedAudioTagsBounds!.y +- numberOfSharedAudioTagsBounds!.height / 2,- );- await page.waitForTimeout(80);- }- expect(updateConfigRequests).toBe(requestsBeforeDrag);- await page.mouse.up();- await expect- .poll(() => updateConfigRequests)- .toBe(requestsBeforeDrag + 1);- await page.waitForTimeout(500);- expect(updateConfigRequests).toBe(requestsBeforeDrag + 1);- await expect- .poll(() => fs.readFileSync(configFile, 'utf8'))- .toContain('Config.setNumberOfSharedAudioTags(');- await dialog.getByTitle('Use default (0)', {exact: true}).click();- await expect- .poll(() => fs.readFileSync(configFile, 'utf8'))- .not.toContain('Config.setNumberOfSharedAudioTags');- await expect(numberOfSharedAudioTags).toHaveText('Default (0)');-- await dialog.getByText('Skills', {exact: true}).click();- await expect(- dialog.getByText(- 'Not all skills are installed. Run this command in the project directory, then reload Studio and restart your coding agent.',- {exact: true},- ),- ).toBeVisible();- await expect(- dialog.getByText('/remotion-best-practices', {exact: true}),- ).toBeVisible();- await expect(- dialog.getByText('/remotion-docs', {exact: true}),- ).toBeVisible();- await expect(- dialog.getByText('/remotion-studio', {exact: true}),- ).toBeVisible();- await expect(dialog.getByText('Project', {exact: true})).toBeVisible();- await expect(dialog.getByText('Global', {exact: true})).toBeVisible();- await expect(- dialog.getByText('Not installed', {exact: true}).first(),- ).toBeVisible();- await expect(- dialog.getByText('npx remotion skills add', {exact: true}),- ).toBeVisible();- await expect(- dialog.getByRole('button', {name: 'Copy install command'}),- ).toBeVisible();- const skillsList = dialog.getByRole('list', {- name: 'Remotion Agent Skills',- });- const skillsScrollContainer = skillsList.locator('..').locator('..');- await skillsScrollContainer.evaluate((element) => {- element.scrollTop = element.scrollHeight;- });- const skillsScrollContainerBounds =- await skillsScrollContainer.boundingBox();- const lastSkillBounds = await skillsList- .getByRole('listitem')- .last()- .boundingBox();- expect(- skillsScrollContainerBounds!.y +- skillsScrollContainerBounds!.height -- (lastSkillBounds!.y + lastSkillBounds!.height),- ).toBeGreaterThanOrEqual(16);- await expect(- dialog.getByText('Changes save to', {exact: false}),- ).toBeVisible();-- await dialog.getByText('Apps', {exact: true}).click();- await expect(- dialog.getByTitle('Default editor', {exact: true}),- ).toHaveText('Cursor');- await expect(- dialog.getByTitle('Default coding agent', {exact: true}),- ).toContainText('Codex');- await dialog.getByText('License', {exact: true}).click();- const freeLicenseToggle = dialog.getByRole('radio', {- name: 'I am eligible for the Free License',- });- await expect(freeLicenseToggle).toBeChecked();- expect({codingAgentInfoRequests, editorInfoRequests}).toEqual({- codingAgentInfoRequests: 1,- editorInfoRequests: 1,- });- await freeLicenseToggle.click();- await expect- .poll(() => fs.readFileSync(configFile, 'utf8'))- .not.toContain('Config.setPublicLicenseKey');- await page.mouse.move(10, 100);- await page.mouse.down();- await page.mouse.move(13, 101);- await page.mouse.up();- await expect(dialog).toBeHidden();- } finally {- fs.writeFileSync(configFile, configBeforeTest);- }- });-test('should collapse programmatically duplicated timeline rows', async ({page,}) => {@@ -2492,113 +1733,6 @@ export const SequenceShiftRepro = () => {}});- test('should apply timeline context menu actions to multiple selected sequences', async ({- page,- }) => {- const sourceBefore = fs.readFileSync(sequenceShiftFile, 'utf-8');-- try {- await page.goto(`${STUDIO_URL}/sequence-shift-repro`);- await page.waitForFunction(- () => !document.body.innerText.includes('Loading...'),- {timeout: 30_000},- );- await page.keyboard.press('g');- const currentFrameInput = page.locator('input:focus');- await currentFrameInput.fill('22');- await currentFrameInput.press('Enter');- const outer = page.getByText('Outer frame descendant', {exact: true});- const local = page.getByText('Local frame descendant', {exact: true});- const localBar = page.locator(- '[data-timeline-marquee-item][title="Local frame descendant"]',- );- await expect(outer).toBeVisible({timeout: 15_000});- await expect(local).toBeVisible();-- await outer.click();- await local.click({modifiers: ['Meta']});- await localBar.click({button: 'right'});- await expect(outer.locator('../../..')).toHaveCSS(- 'background-color',- 'rgb(59, 63, 66)',- );- await expect(- page- .locator('[data-remotion-menu-tree-id]')- .last()- .getByRole('button', {- name: 'Duplicate selected',- exact: true,- }),- ).toBeVisible();- await page.keyboard.press('Escape');- await local.click({button: 'right'});- await expect(outer.locator('../../..')).toHaveCSS(- 'background-color',- 'rgb(59, 63, 66)',- );-- const contextMenu = page.locator('[data-remotion-menu-tree-id]').last();- await expect(- contextMenu.getByRole('button', {- name: 'Duplicate selected',- exact: true,- }),- ).toBeVisible();- await contextMenu- .getByRole('button', {name: 'Delete selected', exact: true})- .click();-- await expect- .poll(() => {- const source = fs.readFileSync(sequenceShiftFile, 'utf-8');- return [- source.includes('name="Outer frame descendant"'),- source.includes('name="Local frame descendant"'),- ];- })- .toEqual([false, false]);-- await expect(outer).toBeHidden();- await expect(local).toBeHidden();- fs.writeFileSync(sequenceShiftFile, sourceBefore);- await expect(outer).toBeVisible({timeout: 15_000});- const nestedParent = page.getByText('Nested timing parent', {- exact: true,- });- await expect(nestedParent).toBeVisible();-- await outer.click();- await nestedParent.click({modifiers: ['Meta']});- await nestedParent.click({button: 'right'});- await page- .locator('[data-remotion-menu-tree-id]')- .last()- .getByRole('button', {name: 'Duplicate selected', exact: true})- .click();-- await expect- .poll(() => {- const source = fs.readFileSync(sequenceShiftFile, 'utf-8');- return [- source.match(/name="Outer frame descendant-copy"/g)?.length ?? 0,- source.match(/name="Nested timing parent-copy"/g)?.length ?? 0,- source.match(/name="Outer frame descendant-copy-copy"/g)?.length ??- 0,- source.match(/<LocalFrameDescendant \/>/g)?.length ?? 0,- ];- })- .toEqual([1, 1, 0, 1]);-- await page.keyboard.press('ControlOrMeta+z');- await expect- .poll(() => fs.readFileSync(sequenceShiftFile, 'utf-8'))- .toBe(sourceBefore);- } finally {- fs.writeFileSync(sequenceShiftFile, sourceBefore);- }- });-test('should keep selected canvas outlines visible outside the canvas', async ({page,}) => {