mardi 20 juillet 2021

Conditional Testing in Cypress

enter image description hereI have a very interesting task that I wrote some codes but I am in the middle of nowhere. Please see the attachment. [This is about possible optionsand this is DOM

My code is as below:

cy.get('[data-auction-type-text=Regular]').should('be.visible')
            .each(($el,index) => {
                if(index===0){
                    cy.wrap($el).click({force: true})
                }
            

            })
            cy.get ('[data-auction-type-text=Regular]'). then ($Regular) => {
               if($Regular.text().includes('Place bid')&&($Regular.text()
               .includes('Place max bid')){
            cy.contains(('Place bid')&&('Place max bid')
                     .click({force: true})
                 }
enter code here

Aucun commentaire:

Enregistrer un commentaire