This package is for Kualitee users.
- Integration with Cypress
- Lets Generate report on kualitee for Cypress test execution.
- Integration kualitee with cypress, execute the scenario from kualitee and update the status of status of test case.
- Integration with Playwright
- Run Playwright tests from Kualitee and get reports on one place.
npm install kualitee_bridge
By following the some simple and easiest configuration the kualitee can get all reports on single place.
If you are using Kualitee testing tool then you can generate the execution cycle on Kualitee by following these steps.
"kualiteeConfigs": {
"token": 'userToken',
"projectId": 'projectId',
"reportPath": 'path/to/report'
}
token: string The user token you can get from the Kualitee tool you are using.
projectId: string Project id on Kualitee tool with which the tests are associated.
reportPath: string The path in the cypress project where execution reports will generate like cypress/e2e/reports
.
import
or require
the postReport
method in cypress.config.js
.
const { postReport } = require("kualitee_bridge");
module.exports = defineConfig({
//implement testing logics here
})
Now the package is ready to use in your project. You can use either with e2e
testing or with component testing
.
Under your setupNodeEvents
method, call cypress API on("after: run", () => { })
and call the method with return postResult()
.
const { postReport } = require("kualitee_bridge");
module.exports = defineConfig({
e2e: {
setupNodeEvents(on, config) {
on("after:run", () => {
return postReport();
});
},
},
});
After configuration run the cypress
in terminal (npx cypress run
) or your custom command.
const { postReport } = require("kualitee_bridge");
module.exports = defineConfig({
component: {
setupNodeEvents(on, config) {
on("after:run", () => {
return postReport();
});
},
},
});
After configuration run the cypress
in terminal (npx cypress run --component
) or your custom command.
On cypress execution, you will get the Successfull
or Error
message in terminal.
Lets execute the scenarios from kualitee and get the latest status on kualitee.
Prerequisites
- Install
kualitee_bridge
in your Cypress project. - Cypress must have a Cucumber integeration.
- You need to add a unique tag for both Feature
(test scenario in kualitee)
and Scenario(test case in kualitee)
.
You need to add a unique tag for both feature and scenario with a prefix @kts_ and @ktc_ respectively. For example @kts_login
instead of @login for a feature and for scenario add tag like @ktc_success_login
instead of using only @success_login and these should be the same as in Kualitee.
Setup your cypress project and add unique tags
to run your scenarios from Kualitee by tags.
By adding the following express code snipet in your index.js
file on root directory of your cypress project you can execute Scenarios
from Kualitee
with a single click.
Important
You need to install following packages before adding the code snipet.
npm install kualitee_bridge
npm i express
npm i cors
npm i body-parser
const express = require('express')
var cors = require('cors');
var bodyParser = require('body-parser')
const app = express()
const { cypressTestCaseExecution } = require("kualitee_bridge")
app.use(cors());
app.use(bodyParser.json())
app.use(bodyParser.urlencoded({ extended: true }));
const port = 3000
const hostname = 'localhost';
app.post('/script-run', (req, res) => {
cypressTestCaseExecution(req, res, 'cypress/reports')
});
app.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`)
})
req: It is the request body and it will pass as it is req.
res: It is the response body and it will pass as it is res.
path/to/report: string The path in the cypress project where reports generate like cypress/e2e/reports
.
Now you can execute the Scenario from Kualitee tool.
Tip
On finishing the setup in Cypress only integration part of Kualitee you need to do. Click here for integration part in Kualitee
Setup your playwright project.
Specify reporters programmatically in the configuration file playwright.config.ts
.
By adding the following express code snipet in your index.js
file on root directory of your playwright project you can execute a cycle with a single click.
Important
You need to install following packages before adding the code snipet.
npm install kualitee_bridge
npm i express
npm i cors
npm i body-parser
const express = require('express')
var cors = require('cors');
var bodyParser = require('body-parser')
const app = express()
const {playwrightToKualitee} = require('kualitee_bridge');
app.use(cors());
app.use(bodyParser.json())
app.use(bodyParser.urlencoded({ extended: true }));
const port = 3000
const hostname = 'localhost';
app.post('/script-run', (req, res) => {
playwrightToKualitee(req, res, './json-report/report.json')
});
app.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`)
})
req: It is the request body and it will pass as it is req.
res: It is the response body and it will pass as it is res.
path/to/report: string Path which were specify in reporter in playwright.config.ts
like ./json-report/report.json
.
Now you can execute the playwright cycle from Kualitee.