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

191
Visualizações
Json file does not load after selecting from dropdown

I have a fixture file which have both positive and negative amounts.

I have a dropdown which makes me select ALL,positive and negative amount.

when i select negative for example the table does not get refreshed with negative amounts.

enter image description here

This is the dropdown html This is my code test:

cy.intercept('/api/amounts/***/*****', {fixture: 'amount.json'}).as('amount')
        cy.wait('@amount')
     
        cy.get('.dropdown-header-title').eq(3).click()
        cy.get('.dropdown-list-item').contains('Negative').then(option =>{
            option[0].click()
            cy.get('.dropdown-header-title').contains('Negative')
        })

The json file can be as below:

{
  amount: ['-200,000', '40000', '400', '-200']
}

For info i have added just dummy test data but the file is larger thank you

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You can use readfile instead of fixture

cy.readFile("cypress/fixtures/amount.json").then((profile) => {
  cy.intercept('/api/amounts/***/*****', { fixture: 'amount.json' }).as('amount')
  cy.wait('@amount')

  cy.get('.dropdown-header-title').eq(3).click()
  cy.get('.dropdown-list-item').contains('Negative').then(option => {
    option[0].click()
    cy.get('.dropdown-header-title').contains('Negative')
  })
})
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