fix cypress command format

This commit is contained in:
Annie committed 2023-11-21 14:20:55 +08:00
1 parent f7907a5999
commit cc03e57c70
1 file changed
+5 -5
+5 -5
View File
@@ -70,18 +70,18 @@ Cypress.Commands.add('CheckTextElement',(id,chText,enText)=>{
cy.get(id).within(($element) => {
if (Cypress.env('isCHVersion')) {
cy.get($element).should('contain', chText).and('be.visible')
}
else{
} else {
cy.get($element).should('contain', enText).and('be.visible')
}
})
})
Cypress.Commands.add('CheckPlaceholder', (id, chText, enText) => {
cy.get(id).invoke('attr', 'placeholder').then(($placeHolder)=>{
cy.get(id)
.invoke('attr', 'placeholder')
.then(($placeHolder) => {
if (Cypress.env('isCHVersion')) {
expect($placeHolder).eq(chText)
}
else{
} else {
expect($placeHolder).eq(enText)
}
})