skip to Main Content

Detecting when Laravel Dusk is running

Often in Laravel I need to detect the environment to avoid triggering certain code while running tests, like logging or sending an email: if (!app()->environment("testing")) { Mail::to($email)->queue(new WelcomeEmail($transaction->id)); } This works fine when the environment is set to testing in…

VIEW QUESTION

Html – Cypress assertions: what is the behavior when `cy.get()` matches multiple elements?

I am having trouble finding documentation that explains how Cypress assertions work when cy.get() matches multiple elements. For example: Markup: <div> <button>one</button> <button class='green'>two</button> <button disabled>three</button> </div> Test: cy.get('button').should('be.disabled'); Does Cypress assert that: the first matched element passes? all matched…

VIEW QUESTION
Back To Top
Search