Created
September 13, 2024 13:05
-
-
Save MarcosSantosDev/6cc506f09e5f0818263ec5400ecee6e2 to your computer and use it in GitHub Desktop.
cypress-good-practice
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe("Open", () => { | |
/** Resumo dos seletores | |
* *= Contém a string em qualquer parte d o valor | |
* $= O valor termina com a string especificada | |
* ^= O valor começa com a string especificada | |
* |= O valor é exatamente igual á string ou começa com ela seguida de um hífen. | |
* ~= O valor contém a string como uma palavra separada por espaços | |
*/ | |
it("Dicas input por name", () => { | |
// <input type="email" id="username" name="username-login" required="" placeholder="informe-seu-email" autocomplete="off" value="" /> | |
cy.get('[name*="name"') // contains | |
cy.get('[name$="ame"') // termina com | |
cy.get('[name*="user"') // contains | |
cy.get('[name^="user"') // começa com | |
cy.get('[name|="username"') // começa com a string | |
cy.get('[name~="username"') // user username | |
}); | |
it("Dicas input por placeholder", () => { | |
// <input type="email" id="username" name="username-login" required="" placeholder="informe-seu-email" autocomplete="off" value="" /> | |
cy.get('[placeholder*="mail"') // contains | |
cy.get('[placeholder$="ail"') // termina com | |
cy.get('[placeholder*="e-"') // contains | |
cy.get('[placeholder^="inf"') // começa com | |
cy.get('[placeholder|="informe"') // começa com a string | |
cy.get('[placeholder~="e-mail"') // user username | |
}); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment