QAFlow Report is a comprehensive reporting module for your test automation efforts. It seamlessly integrates with Playwright, Jest, and other test frameworks.
npm install @qaflow/report
# or
yarn add @qaflow/report
# or
pnpm add @qaflow/reportTo use QAFlow Report, you need to create a configuration file that contains your API key. You can generate this file using the following command:
npx @qaflow/report initThis command will interactively prompt you for your API key and generate a reporter.config.js or reporter.config.ts file.
Alternatively, you can specify your API key directly:
npx @qaflow/report init --key=<apiKey>The generated configuration file will look like this:
module.exports = {
apiKey: 'YOUR_API_KEY_HERE',
}export default {
apiKey: 'YOUR_API_KEY_HERE'
};To use the reporter in your test files:
// Import the reporter
import reporter from "@qaflow/report";
// Create a test
reporter.createTest(
"Login Test", // Test name
"Testing the login functionality of our application", // Description
{ author: "QA Tester", email: "tester@example.com" }, // Tester info
{ name: "Chrome", version: "118.0.0", os: "macOS", browser: "Chrome" } // Environment
);
// Add test steps
await reporter.step("Navigate to the login page", () => {
return true; // Step successful
});
await reporter.step("Enter username", () => {
return true;
});
// End the test and retrieve results
const results = await reporter.end();
console.log(`Total steps: ${results.summary.total}`);
console.log(`Passed steps: ${results.summary.passed}`);
console.log(`Failed steps: ${results.summary.failed}`);
console.log(`Skipped steps: ${results.summary.skipped}`);If you are not using a configuration file, you can initialize the reporter programmatically:
reporter.initialize("your-api-key-here");Creates a new test and registers it as the active test:
reporter.createTest(
"Search Test",
"Tests the search functionality on the homepage",
{ author: "QA Tester", email: "tester@example.com" },
{ name: "Firefox", version: "115.0", os: "Windows" }
);Adds a step to the active test and executes it:
// Successful step
await reporter.step("Navigate to homepage", () => {
return true;
});
// Failed step
await reporter.step("Perform login", () => {
throw new Error("Login failed");
});
// Skipped step
await reporter.step("View profile", () => {}, { skipped: true });
// Step with screenshot
await reporter.step("Verify search results", () => {
return true;
}, { screenshot: "base64-screenshot-data" });Ends the active test and sends results to the API:
const results = await reporter.end();
console.log("Test result:", results);For detailed documentation, visit QAFlow Docs.
Learn more about QAFlow at QAFlow Website.
This project is licensed under the MIT License.
- GitHub: @QA-Flow
- Author Github: @dorukozgen
- LinkedIn: Doruk