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

[BUG] Video Recording Chromium compression is too high #4142

Closed
mxschmitt opened this issue Oct 14, 2020 · 1 comment · Fixed by #4146
Closed

[BUG] Video Recording Chromium compression is too high #4142

mxschmitt opened this issue Oct 14, 2020 · 1 comment · Fixed by #4146

Comments

@mxschmitt
Copy link
Member

Context:

  • Playwright Version: 1.5
  • Operating System: Linux
  • Node.js version: 12
  • Browser: Chromium

Example:

// @ts-check
const playwright = require("playwright");

/**
 * Helper function which will compare val1 with val2.
 * If they dont equal itself it will throw an error.
 */
const expect = (val1, val2) => {
  if (val1 !== val2) {
    throw new Error(`${val1} does not match ${val2}`)
  }
}

const TODO_NAME = "Bake a cake";

(async () => {
  const browser = await playwright.chromium.launch({
    slowMo: 100
  });
  const context = await browser.newContext({
    videosPath: 'videos/'
  });
  const page = await context.newPage();

  await page.goto("http://todomvc.com/examples/react/");

  // Helper function to get the amount of todos on the page
  const getCountOfTodos = () => page.$$eval("ul.todo-list > li", el => el.length)

  // Initially there should be 0 entries
  expect(await getCountOfTodos(), 0)

  // Adding a todo entry (click in the input, enter the todo title and press the Enter key)
  await page.click("input.new-todo");
  await page.type("input.new-todo", TODO_NAME);
  await page.press("input.new-todo", "Enter");

  // After adding 1 there should be 1 entry in the list
  expect(await getCountOfTodos(), 1)

  // Here we get the text in the first todo item to see if it's the same which the user has entered
  const textContentOfFirstTodoEntry = await page.$eval("ul.todo-list > li:nth-child(1) label", el => el.textContent)
  expect(textContentOfFirstTodoEntry, TODO_NAME)

  // The todo list should be persistent. Here we reload the page and see if the entry is still there
  await page.reload({
    waitUntil: "networkidle"
  })
  expect(await getCountOfTodos(), 1)

  // Set the entry to completed
  await page.click('input.toggle');

  // Filter for active entries. There should be 0, because we have completed the entry already
  await page.click('"Active"');
  expect(await getCountOfTodos(), 0)

  // If we filter now for completed entries, there should be 1
  await page.click('"Completed"');
  expect(await getCountOfTodos(), 1)

  // Clear the list of completed entries, then it should be again 0
  await page.click('"Clear completed"');
  expect(await getCountOfTodos(), 0)

  await browser.close();
})();

Interactive: https://try.playwright.tech/?e=todo-mvc

Expected: centered small text is readable
Actual: It's blurry and not readable. FF and WK is fine. Only persistent in CR.

Example recordings: wk-cr-recordings.zip

@mxschmitt
Copy link
Member Author

Verified that in 1.5.1 its fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant