inluxc / playwright-xray

XRAY reporter for Playwright
MIT License
27 stars 11 forks source link

Expose reporter options type #86

Closed csvtuda closed 2 days ago

csvtuda commented 1 week ago

Is your feature request related to a problem? Please describe. The reporter does not export its TypeScript type for the reporter configuration. This leads to potential typos not being detected and prevents IntelliSense from providing useful suggestions.

Describe the solution you'd like I would like the reporter to export its options. For example, in index.ts:

  export default XrayReporter;
+ export type { XrayOptions };

This would then enhance the configuration when used with as XrayOptions or satisfies XrayOptions:

// playwright.config.ts

import type { XrayOptions } from 'playwright-xray';

const config: PlaywrightTestConfig = {
  reporter: [
    [
      'playwright-xray',
      {
        jira: {
          url: 'https://your-jira-url',
          type: 'cloud',
          apiVersion: '1.0',
        },
        cloud: {
          client_id: '',
          client_secret: '',
        },
        projectKey: 'JIRA_CODE',
        testPlan: 'JIRA_CODEXXXXX',
        debug: false,
      } satisfies XrayOptions,
    ],
  ],
};

Describe alternatives you've considered

Thank you for considering this improvement!

Niklas-Back commented 4 days ago

Thanks, I will add it in next release

inluxc commented 2 days ago

Release in: 0.6.7