Загрузка...

Solve Phrasle Using Cypress

In this video, I test the Phrasle.com game using Cypress test runner. I pull the answer to the daily Phrasle from the Remix context object, then enter the letters into the game, and then check that it was solved.

cy.visit('/')
.its('__remixContext.routeData.routes/index.answer')
.then(function (answer) {
const letters = answer
.split('')
.filter(function (c) { return c.match(/[a-z]/) })
letters.forEach(function (letter) {
cy.contains('.Key', letter).click()
})
})
cy.contains('.stat-todaysGame-info', 'PERFECT').should(
'be.visible',
)

Find the source code in https://github.com/bahmutov/cypress-react-app-actions/pull/1 For more, see my other videos about solving the Wordle game using Cypress and check out repo https://github.com/bahmutov/cypress-wordle

Видео Solve Phrasle Using Cypress канала gleb bahmutov
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять