Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to fetch value of json variable updated on run time. #7891

Closed
visjag opened this issue Jul 6, 2020 · 1 comment
Closed

Not able to fetch value of json variable updated on run time. #7891

visjag opened this issue Jul 6, 2020 · 1 comment
Labels
type: duplicate This issue or pull request already exists

Comments

@visjag
Copy link

visjag commented Jul 6, 2020

Updating json file with fixture on Runtime.

cy.fixture('file').then((data) => {
var test = obj.text()
data.variableInFile = test
cy.writeFile("cypress/fixtures/file.json", data)
}

Fetching variable value in another function in same test,

cy.fixture('file').then((data) => {
cy.get("id").type(data.variableInFile)
}

I'm getting last updated value from JSON not currently updated when I fetch.

When I fetch with cy.readFile it work as expected.

@jennifer-shehane
Copy link
Member

Duplicate of #4716

@jennifer-shehane jennifer-shehane marked this as a duplicate of #4716 Jul 7, 2020
@jennifer-shehane jennifer-shehane added the type: duplicate This issue or pull request already exists label Jul 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants