Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

185
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!