I am fairly new to cypress and practicing its functionalities on Facebook app. I am having an issue on testing these following scenarios:
- When clicked on First Name, this floating dialog should be visible.
- Validating the text in the dialog box to be ‘What’s your name?’.
cy.get('input[name="firstname"]').focused().then(($txt)=>{
cy.get('[data-testid="undefined"]>.uiContextualLayer uiContextualLayerLeft>._5v-0 _53im>#js_18n').should('be.visible').and('contain',"What's your name?");
});
But this is not working
This is the pic that i am testing
>Solution :
You can do something like this:
cy.get('[name="firstname"]').click()
cy.get('[name="lastname"]').click()
cy.get('[name="firstname"]').click() //triggers the error message
cy.contains('What\'s your name?').should('be.visible')