You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// @ts-checkconstplaywright=require("playwright");/** * Helper function which will compare val1 with val2. * If they dont equal itself it will throw an error. */constexpect=(val1,val2)=>{if(val1!==val2){thrownewError(`${val1} does not match ${val2}`)}}constTODO_NAME="Bake a cake";(async()=>{constbrowser=awaitplaywright.chromium.launch({slowMo: 100});constcontext=awaitbrowser.newContext({videosPath: 'videos/'});constpage=awaitcontext.newPage();awaitpage.goto("http://todomvc.com/examples/react/");// Helper function to get the amount of todos on the pageconstgetCountOfTodos=()=>page.$$eval("ul.todo-list > li",el=>el.length)// Initially there should be 0 entriesexpect(awaitgetCountOfTodos(),0)// Adding a todo entry (click in the input, enter the todo title and press the Enter key)awaitpage.click("input.new-todo");awaitpage.type("input.new-todo",TODO_NAME);awaitpage.press("input.new-todo","Enter");// After adding 1 there should be 1 entry in the listexpect(awaitgetCountOfTodos(),1)// Here we get the text in the first todo item to see if it's the same which the user has enteredconsttextContentOfFirstTodoEntry=awaitpage.$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 thereawaitpage.reload({waitUntil: "networkidle"})expect(awaitgetCountOfTodos(),1)// Set the entry to completedawaitpage.click('input.toggle');// Filter for active entries. There should be 0, because we have completed the entry alreadyawaitpage.click('"Active"');expect(awaitgetCountOfTodos(),0)// If we filter now for completed entries, there should be 1awaitpage.click('"Completed"');expect(awaitgetCountOfTodos(),1)// Clear the list of completed entries, then it should be again 0awaitpage.click('"Clear completed"');expect(awaitgetCountOfTodos(),0)awaitbrowser.close();})();
Context:
Example:
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
The text was updated successfully, but these errors were encountered: