← Back to Discord Forum

cypress to playwright

cy.get('@password') .focus() .type('{selectAll}' + NEW_PASSWORD) .should('have.value', NEW_PASSWORD) .blur(); any one know how to write in playwright

This thread is trying to answer question "How to write a similar code in Playwright as in Cypress for focusing, typing, and blurring an input field and checking its value?"

1 reply
const passwordInput = page.locator('<selector>')

await passwordInput.focus()
await passwordInput.type('<something>')

await expect(passwordInput).toHaveAttribute('value', '<something>')

await passwordInput.blur()
AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email luc@ray.run.