ryanrosello-og / playwright-slack-report

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

Custom layout not respected when using CLI + webhook #188

Open mkeereman-sfdc opened 3 weeks ago

mkeereman-sfdc commented 3 weeks ago

Bug description

The customLayout config property is not respected when running the CLI command and sending the message through a webhook

See https://github.com/ryanrosello-og/playwright-slack-report/blob/main/cli.ts#L74C7-L80C10

const webhookResult = await slackWebhookClient.sendMessage({
        customLayout: undefined,
        customLayoutAsync: undefined,
        maxNumberOfFailures: config.maxNumberOfFailures,
        disableUnfurl: config.disableUnfurl,
        summaryResults,
      });

How to reproduce (please include a snippet of your Playwright Slack Reporter configuration)

{ "sendResults": "always", "slackLogLevel": "error", "sendUsingWebhook": { "webhookUrl": "XXX }, "meta": [ { "key": "project", "value": "test" }, { "key": "build", "value": "1.0.0" }, { "key": "branch", "value": "main" }, { "key": "commit", "value": "1234567890" } ], "maxNumberOfFailures": 4, "disableUnfurl": true, "customLayout": { "source": "./playwright/slack/template.ts", "functionName": "generateMessage" } }

Expected behavior

Custom layout is respected in CLI for webhooks as well

Environment & setup

playwright-slack-report version

1.1.86
ryanrosello-og commented 2 weeks ago

This should be addressed in https://github.com/ryanrosello-og/playwright-slack-report/pull/179