🎥 Make videos programmatically with React
Internal: Remove recurrently flaky tests
Jonny Burger0675445ac96e
diff --git a/packages/example/e2e/studio.test.mts b/packages/example/e2e/studio.test.mtsindex bfa245e3bd..310471206c 100644--- a/packages/example/e2e/studio.test.mts+++ b/packages/example/e2e/studio.test.mts@@ -1078,94 +1078,6 @@ test.describe('visual mode', () => {}});- test('should keep selected editing handles above overlapping outlines', async ({- page,- }) => {- await page.goto(`${STUDIO_URL}/outline-selection-cases`);- await page.waitForFunction(- () => !document.body.innerText.includes('Loading...'),- {timeout: 30_000},- );- await page.keyboard.press('g');- const currentFrameInput = page.locator('input:focus');- await expect(currentFrameInput).toBeVisible();- await currentFrameInput.fill('2160');- await currentFrameInput.press('Enter');-- const target = page.locator(- '[data-timeline-marquee-item="true"][title="Editable transform target"]',- );- await expect(target).toBeVisible();- await target.click();-- const rightScaleEdge = page.locator(- '[data-remotion-studio-scale-edge="right"][data-remotion-studio-scale-edge-contains-selection="true"]',- );- await expect(rightScaleEdge).toBeVisible();- const scaleEdgePoint = 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');- }-- const first = new DOMPoint(- element.x1.baseVal.value,- element.y1.baseVal.value,- ).matrixTransform(matrix);- const second = new DOMPoint(- element.x2.baseVal.value,- element.y2.baseVal.value,- ).matrixTransform(matrix);- const [top, bottom] =- first.y < second.y ? [first, second] : [second, first];-- return {- x: top.x + (bottom.x - top.x) * 0.2,- y: top.y + (bottom.y - top.y) * 0.2,- };- });- expect(- await page.evaluate(- ({x, y}) =>- document- .elementFromPoint(x, y)- ?.getAttribute('data-remotion-studio-scale-edge') ?? null,- scaleEdgePoint,- ),- ).toBe('right');-- const topRightRotationCorner = page.locator(- '[data-remotion-studio-rotation-corner="top-right"][data-remotion-studio-rotation-corner-contains-selection="true"]',- );- await expect(topRightRotationCorner).toBeVisible();- const rotationCornerBox = await topRightRotationCorner.boundingBox();- if (rotationCornerBox === null) {- throw new Error('Rotation corner should have a visible layout');- }-- expect(- await page.evaluate(- ({x, y}) =>- document- .elementFromPoint(x, y)- ?.getAttribute('data-remotion-studio-rotation-corner') ?? null,- {- x: rotationCornerBox.x + rotationCornerBox.width / 2,- y: rotationCornerBox.y + rotationCornerBox.height / 2,- },- ),- ).toBe('top-right');-- await topRightRotationCorner.click({button: 'right'});- await expect(- page.getByRole('button', {name: 'Duplicate', exact: true}),- ).toBeVisible();- });-test('should compensate DOM measurements with useCurrentScale() on direct load', async ({page,}) => {diff --git a/packages/studio-server/src/test/open-in-coding-agent.test.ts b/packages/studio-server/src/test/open-in-coding-agent.test.tsindex 40aaa2ea37..76d6992726 100644--- a/packages/studio-server/src/test/open-in-coding-agent.test.ts+++ b/packages/studio-server/src/test/open-in-coding-agent.test.ts@@ -280,64 +280,6 @@ test('prefills editable macOS coding agents without submitting to Copilot', () =]);});-test.skipIf(process.platform === 'win32')(- 'launches the project through the coding agent executable',- async () => {- const directory = mkdtempSync(- path.join(tmpdir(), 'remotion-coding-agent-launch-'),- );- const applicationPath = path.join(directory, 'ChatGPT.app');- const executable = path.join(- applicationPath,- 'Contents',- 'Resources',- 'codex',- );- const output = path.join(path.dirname(executable), 'received.txt');- mkdirSync(path.dirname(executable), {recursive: true});- writeFileSync(- executable,- '#!/bin/sh\nprintf "%s\\n" "$@" > "$(dirname "$0")/received.txt"\n',- );- chmodSync(executable, 0o755);-- try {- const success = await launchCodingAgent({- codingAgent: {- applicationPath,- id: 'codex',- launchMode: 'direct',- name: 'Codex',- nameWithType: 'Codex',- platform: 'darwin',- terminal: null,- },- logLevel: 'error',- projectPath: '/Users/test/My Project',- prompt: null,- });- expect(success).toBe(true);-- const expectedOutput = 'app\n/Users/test/My Project\n';- let receivedOutput = '';- for (let attempt = 0; attempt < 100; attempt++) {- if (existsSync(output)) {- receivedOutput = readFileSync(output, 'utf8');- if (receivedOutput === expectedOutput) {- break;- }- }-- await Bun.sleep(10);- }-- expect(receivedOutput).toBe(expectedOutput);- } finally {- rmSync(directory, {force: true, recursive: true});- }- },-);-test.skipIf(process.platform === 'win32')('launches a terminal coding agent in the project directory',async () => {