E2e tests verification while running tests

I was following this page e2e tests
and when i am trying to run my tests using this command in ui folder
npx playwright test tests/e2e/indexui.spec.js
i’m getting the error token is required I have created a user.json file this is how it looks like

{
  "MESHERY_SERVER_URL": "http://localhost:9081",
  "REMOTE_PROVIDER_URL": "https://cloud.layer5.io",
  "REMOTE_PROVIDER_USER_EMAIL": "an",
  "REMOTE_PROVIDER_USER_PASSWORD": "",
  "PROVIDER_TOKEN": ""
}

i have created this file in this folder
tests/e2e/playwright/.auth/user.json

i tried this as well Discussion but wasn’t able to fix the issue…

I have already generated my token and verified my email
Your help will be appreciated .
Thanks

Hi @Anuj, Thanks for reaching out! Here’s what you can do:

  1. Create a .env file in the ui folder and add the following environment variables with your credentials:
MESHERY_SERVER_URL=http://localhost:9081  
REMOTE_PROVIDER_URL=https://cloud.layer5.io  
REMOTE_PROVIDER_USER_EMAIL=<your-email>  
REMOTE_PROVIDER_USER_PASSWORD=<your-password>  
PROVIDER_TOKEN=<your-token>  
  1. Once the .env file is set up, you can run your tests, and they should work as expected.

For more guidance, feel free to check the docs section for more details. Let me know if you have any further questions! :blush:

1 Like

Thanks Yash ! This worked :grin::smiley:

1 Like