digyrunner-playwright-js
How to use?
npm install @digy4/digyrunner-playwright- Create a config file
digy-runner-config-web.jsfor DigyRunner
const digyRunnerConfig = {
env: {
PROJECT_NAME: "Playwright-js-starter",
TEAM_NAME: "TeamPlaywright",
SUITE_NAME: "WEB Regression",
APP_VERSION: "2.0",
ENVIRONMENT: "test",
FRAMEWORK: "playwright",
MODULE_NAME: "SomeModuleName",
TESTER: "Joe Bloggs",
BA: "Joe Bloggs",
DEVELOPER: "Joe Bloggs",
TEST_TYPE: "WEB",
LOB: "<Line of business name>",
APPLICATION: "<Application name>",
RELEASE: "<release version>",
RESULTS_SUMMARY_URL: `https://rcr0bssa51.execute-api.us-west-2.amazonaws.com/digykube-dev/v3/resultsSummary`,
RESULTS_URL: `https://rcr0bssa51.execute-api.us-west-2.amazonaws.com/digykube-dev/v3/results`,
PROJECT_PLAN_URL: `https://z85m9oisq5.execute-api.us-east-1.amazonaws.com/test/users/project-plan-details`,
CLIENT_ID: "<key>",
CLIENT_SECRET: "<secret>",
DIGY4_LOG_LEVEL: "ERROR|INFO|DEBUG"
},
};
module.exports = digyRunnerConfig;
-
Include the config file in the playwright config
const digyRunnerConfig = require('./digy-runner-config-web'); -
Add digyrunner as a reporter in the playwright config
['@digy4/digyrunner-playwright/DigyReporter', digyRunnerConfig] -
Optionally import digyrunner "test" instead of playwright "test" directly
const test = require("@digy4/digyrunner-playwright/DigyWebTest");
Test case level fields
Set these per test with Playwright annotations. Annotation types are case-insensitive; if a type appears more than once (e.g. on a describe block and on the test), the last one wins.
| Annotation type | Result field | Notes |
|---|---|---|
TestClassification | testClassification | |
TestDefinition | testDefinition | |
Priority | priority | |
ExecutionMode | executionMode | Defaults to Active_Execution |
Feature | requirementIds | Overrides the suite level REQUIREMENT_ID / FEATURE for this test case |
test('Verify Book Store Login', {
tag: '@Smoke',
annotation: [
{ type: 'TestClassification', description: 'Positive' },
{ type: 'TestDefinition', description: 'Functional' },
{ type: 'Priority', description: 'High' },
{ type: 'Feature', description: 'FEAT-101' },
],
}, async ({ page }) => { ... });
Annotations can also be added while the test runs:
test.info().annotations.push({ type: 'ExecutionMode', description: 'Active_Execution' });