wazuh-fe-qa / wazuh-cypress

frontend e2e tests using cypress.
3 stars 0 forks source link

Environment variable for the execution of Github Actions #32

Closed mauceballos closed 2 years ago

mauceballos commented 2 years ago

Description

we need to include the URL on the command line of cypress execution for that we can take this value on the docker-compose file on the Github Actions

we should research and implement a fix to solve this.

now our environment variables are defined in Cypress.json, but we should include them in the test execution command line.

These contain the URL where the test has the validations

{
  "odfe": "http://localhost:5601/app/wazuh/",
  "xpack": "https://localhost:5601/app/wazuh/",
  "basic": "http://localhost:5601/app/wazuh/"
}
mauceballos commented 2 years ago

configuration:

cypress.env.json

{
  "host": "localhost",
  "port": 5601,
  "odfe": "http://$host:$port/app/wazuh/",
  "xpack": "http://$host:$port/app/wazuh/",
  "basic": "http://$host:$port/app/wazuh/"
}

command: npx run cypress:run-headless --env host=kibana,port=5601

mauceballos commented 2 years ago

Fix:

modify the cypress.json to include baseUrl and it setting only one env type Also, modify the index.js hook function to it take the parameters. Also, it requires other settings, for example npm run start -- --env type=odfe --config baseUrl=https://localhost:5600

PR