Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

96
Vistas
How to structure often used functions

I recognised that in few different pages i am locating elements by the exact same locators, as an example i have created LoginInPage and RegistrationPage and both of them have static function emailInput() there are more elements i am locating by the exact locators and its values through the project, so my question what would be modern approach towards it?

I did research and saw that often used functions are placed in commands.ts but personally i do not like this approach as what if commands will end up having 30+ functions it be super messy, would appreciate any solutions suggested

export class LogInPage {
  static get emailInput(): Cypress.Chainable<JQuery<HTMLInputElement>> {
    return cy.get<HTMLInputElement>('input[placeholder="Email address"]');
  }
}


 export class RegistrationPage {
      static get emailInput(): Cypress.Chainable<JQuery<HTMLInputElement>> {
    return cy.get<HTMLInputElement>('input[placeholder="Email address"]');
  }
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda