I do know that there is commands.js where functions can be added that we often use but isnt it gets way to messy if we just have bunch of functions in that js file?
Lets say i have a login form and create account form, for both of them i create page objects to have all the functions there and both of those have email input field and password input field, then i obviously do not want to have two functions in both classes :
class CreateAccPage {
private enterEmail = (email: string) => {
return this;
};
private enterPassword = (password: string) => {
return this;
};
}
class LoginPage {
private enterEmail = (email: string) => {
return this;
};
private enterPassword = (password: string) => {
return this;
};
}
So my concern is having lots of functions in a single commands class which isnt nice in my opinion so what could i do ? creating parent Form class and having those functions there then inherit them or there is a better way. Thank you
Via Active questions tagged javascript - Stack Overflow https://ift.tt/sDfgRLU
Comments
Post a Comment