ryanrosello-og / playwright-slack-report

Publish your Playwright test results to your favourite Slack channel(s).
MIT License
98 stars 28 forks source link

[FEATURE] Add support for javascript config when running through the CLI #161

Closed willbertSmillbert closed 1 month ago

willbertSmillbert commented 3 months ago

As a user I would like to parse in dynamic values into the config with more power. I am currently not able to do the following (as far as im aware) without doing some sorcery..

Expected: Allow the config to support a javascript module, instead of enforcing it to be json, in my case it would look something like the below config.js

module.exports= {
  "sendResults": "always",
  "slackLogLevel": "error",
  "sendUsingWebhook": {
    "webhookUrl": process.env.slackURL
  },
  "meta": [
    {
      "key": "title",
      "value: `Playwright Test Results ${(new Date()).toLocaleDateString('en-AU')}
    },
    {
      "key": "Environment",
      "value": process.env.rootURL.match(/(?<=\/\/)[^\.]+/)
    }
  ]
}
ryanrosello-og commented 2 months ago

@willbertSmillbert these are all good ideas 👍, I will implement these soonish.

github-actions[bot] commented 1 month ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.