https://cypress.io logo
Can not read Json file in github Actions
# i-need-help
g
I'm trying to run the same script from local on the github Actions, however when the job is running it can not find the json file.
Copy code
/// <reference types="cypress" />
import {homePageGeant} from '../../../support/Pages/SuperMarkets'
const datatest = '../fixtures/datatest.json'
describe('Get the page information',()=>{

    it('Store the page information', ()=>{
        homePageGeant.visitHomepage();
        homePageGeant.typeSearchInput('Cafe');
        homePageGeant.clickSeeAllProducts();
        homePageGeant.storeEachPMarca();
        homePageGeant.storeEachH2();
        homePageGeant.storeEachPPrice();
        homePageGeant.pushIntoCoffeeListArray();
        homePageGeant.writefile();
     })
     it('check json', ()=>{
        cy.readFile(datatest).then((str)=>{
            cy.wrap(str).pause()
            cy.wrap(str[0]).pause()
            cy.wrap(str[0][1]).pause()
            cy.wrap(str[1]).pause()

            cy.wrap(str[0].ProductBrand).pause()
        })
     })
})
Result from the pipeline:
Copy code
1) check json


  1 passing (31s)
  1 failing

  1) Get the page information
       check json:
     AssertionError: Timed out retrying after 4000ms: `cy.readFile("../fixtures/datatest.json")` failed because the file does not exist at the following path:

`/home/runner/work/Scapping/fixtures/datatest.json`
Any ideas?
g
what is your folder structure? Are your tests and fixtures inside
cypress
folder?