1.0.3 ā€¢ Published 9 months ago

playwright-zephyr v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

Zephyr reporter for Playwright

Publish Playwright test run on Zephyr

Install

npm i -D playwright-zephyr

Usage

Add Server reporter to your playwright.config.ts configuration file

// playwright.config.ts
import { PlaywrightTestConfig } from '@playwright/test';

const config: PlaywrightTestConfig = {
  reporter: [['playwright-zephyr', { 
    host: 'https://jira.your-company-domain.com/',
    authorizationToken: 'SVSdrtwgDSA312342--',
    projectKey: 'JARV'
  }]],
}

If you want to use Cloud reporter, you need to specify cloud option:

// playwright.config.ts
import { PlaywrightTestConfig } from '@playwright/test';

const config: PlaywrightTestConfig = {
  reporter: [
    ['playwright-zephyr/lib/src/cloud', {
      projectKey: 'JARV', // <-- Replace with your project key
      authorizationToken: process.env.ZEPHYR_AUTH_TOKEN, // <-- Replace with your authorization token
    }],
  ],
}

If your test cycle requires custom fields, you can specify them in testCycle option:

// playwright.config.ts
import { PlaywrightTestConfig } from '@playwright/test';

const config: PlaywrightTestConfig = {
    reporter: [
    ['playwright-zephyr/lib/src/cloud', {
      projectKey: 'JARV', // <-- Replace with your project key
      authorizationToken: process.env.ZEPHYR_AUTH_TOKEN, // <-- Replace with your authorization token
      testCycle: {
          name: `Automated Playwright Run - ${new Date().toISOString()}`,
          customFields: {
            Browser: 'Google Chrome',
            Device: 'MacOS',
          },
        },
    }],
  ],
}

Read how to get Zephyr authorization token here.

Also, your playwright tests should include unique ID inside square brackets [J79] of your Zephyr test case:

//      ā†“  Zephyr test case ID inside square brackets
test('[J79] basic test', async ({ page }) => {
  await page.goto('https://playwright.dev/');
  const title = page.locator('.navbar__inner .navbar__title');
  await expect(title).toHaveText('Playwright');
});

Then run your tests with npx playwright test command and you'll see the result in console:

āœ… Test cycle JARV-C2901 has been created
šŸ‘‡ Check out the test result
šŸ”— https://jira.your-company-domain.com/secure/Tests.jspa#/testPlayer/JARV-C2901

And you'll see the result in the Zephyr:

alt text

License

playwright-zephyr is MIT licensed.

Author

Yevhen Laichenkov elaichenkov@gmail.com

1.0.2

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago

1.0.3

9 months ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago