.grid > languagefield
is the element of UI dropdown list
Depends on the language selected on this languagefield, it'll do something
This is what I have but Cypress doesn't hit if
condition, something not right with if (Lang == 'American English')
const Date = Cypress.moment().add(-3, 'days').format('YYYY-MM-DD');
const DateUS = Cypress.moment(Date).format('MM/DD');
const DateUK = Cypress.moment(Date).format('DD/MM');
const Lang = '.grid > languagefield'
if (Lang == 'American English') {
//should get DateUS format
} else {
//should get DateUK format
}
Thanks a lot!
Result of cy.get('.grid > :nth-child(7)').invoke('text').then((txt) => { cy.log(txt) })