Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

170
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda