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

176
Vistas
How to pass custom url in cypress

My application requires passing custom url to cy.visit for every page. For eg:

"env": {
"testenv" : "sbx",
"sbx":{
    "my":"https://abcabcabx#/",
    "foo": "https://defdefx#/"
  }

In base class, its read as :

cy.visit(Cypress.env()[Cypress.env()['testenv']][brand]);

Our application is in lower env and there is no connectivity between pages so we test each page by hitting url for that page. Example : https://abcabcabx#/about-your-detail for about your finance, url will be : https://abcabcabx#/about-your-finance

that is how i am calling url in test class :

For about your detail page - url will be :

let brands = ['my', 'foo']
aboutYourDetailPage.openUrl(brand)

How can i customise this url for each class.

Thanks in advance !!

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

you can define the base url for your tests in the 'cypress.json' configuration file { "baseUrl": "http://localhost:3000/#/" } and after in each your class use only path to specific page 'cy.visit('my')' here the example: https://docs.cypress.io/api/commands/visit#Prefixes OR get the base url from env.variables from your CLI command for tests 'const fullUrl = config.env.urlConfig' in the /plugins/index.ts and using base url for opening specific page in the files 'cy.visit(Cypress.env('my'));'

about 4 years ago · Juan Pablo Isaza Denunciar
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