when new user trying u login it redirect to sign up page existing user login mean its navugate to home page
export class signuppage {
//var namefield:locator;
constructor(page) {
this.page=page;
this.namefield="//input[@placeholder='Full Name']"
this.signupfreame="//div[@class='modal-login modal-body']"
this.terms="//label[contains(text(),'I hereby state that I am older than 18 years of ag')]"
//this.jotdhomepopup=".modal-content.contentClassName.undefined"
this.profileicon="//a[@id='dropdown-user']//img"
}
`async signupdetails() {
const nameFieldExists = await this.page.$(this.namefield);
const profileIconExists = await this.page.$(this.profileicon);
if (nameFieldExists) {
// If the name field exists, proceed with signup process
await this.page.waitForSelector(this.signupfreame);
await this.page.fill(this.namefield, data.personname);
const terms = await this.page.locator("label[for='tnc']");
await terms.click();
await this.page.waitForTimeout(5000);
console.log("Sign up page");
} else if (profileIconExists) {
// If the profile icon exists, consider the user as an existing user
console.log("Existing user");
} else {
// If neither name field nor profile icon exists, log "Failed"
console.log("Failed");
}
}`
New contributor
Vignesh E is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.