process.env.REACT_APP_URL is undefined in a11y.spec.js

Viewed 24

I m working on playwright axe test cases which should run for local and prod. But process.env.REACT_APP_URL is undefined each time I run the tests

test.describe('Playwright web page accessibility test for landing page', () => {
console.log('-------->', process.env.REACT_APP_URL)
  
  test.beforeEach(async () => {
    browser = await chromium.launch()
    page = await browser.newPage()
    await page.goto(process.env.REACT_APP_URL)
    await injectAxe(page)
  })
})


const config = {
  testDir: './a11ytests',
  timeout: 30 * 1000,
  expect: {
    timeout: 5000
  },
  reporter: 'html',
  use: {
  actionTimeout: 0,
    baseURL: process.env.REACT_APP_URL,

}
0 Answers
Related