I am following page page object model in cypress. So get the value from getName() created object on class MHome and call the function getName() but it returns undefined
Object class
Class MHome{
const loc = locator-A
const loc1 = locator-B
getName(){
cy.getTeam2Home(loc, loc1).then((value)=>{
// cy.log(value.toString())
cy.wrap (value.toString());
})
}
}
Calling the getName () function in cypress test case:
const Sh = new MHome();
And ("verify title of elements, function (){
cy.log (Sh.get.Name())
})
cy.log (Sh.get.Name()) returns undefined . Kindly help me in