Skip to content

Commit d236183

Browse files
committed
feat: add support for specifying expected result and data for steps
- Implemented the ability to define expected results and associated data for each step. - Enhanced flexibility and precision in defining step behavior and validation.
1 parent bb5bb2e commit d236183

File tree

22 files changed

+120
-32
lines changed

22 files changed

+120
-32
lines changed

package-lock.json

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

qase-cucumberjs/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cucumberjs-qase-reporter",
3-
"version": "2.0.5",
3+
"version": "2.0.6",
44
"description": "Qase TMS CucumberJS Reporter",
55
"homepage": "https://github.com/qase-tms/qase-javascript",
66
"main": "./dist/index.js",
@@ -40,7 +40,7 @@
4040
"license": "Apache-2.0",
4141
"dependencies": {
4242
"@cucumber/messages": "^22.0.0",
43-
"qase-javascript-commons": "^2.2.0"
43+
"qase-javascript-commons": "^2.2.14"
4444
},
4545
"peerDependencies": {
4646
"@cucumber/cucumber": ">=7.0.0"

qase-cypress/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cypress-qase-reporter",
3-
"version": "2.2.8",
3+
"version": "2.2.9",
44
"description": "Qase Cypress Reporter",
55
"homepage": "https://github.com/qase-tms/qase-javascript",
66
"sideEffects": false,
@@ -51,7 +51,7 @@
5151
"author": "Qase Team <[email protected]>",
5252
"license": "Apache-2.0",
5353
"dependencies": {
54-
"qase-javascript-commons": "~2.2.3",
54+
"qase-javascript-commons": "~2.2.14",
5555
"uuid": "^9.0.1"
5656
},
5757
"peerDependencies": {

qase-cypress/src/reporter.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@ export class CypressQaseReporter extends reporters.Base {
362362
step.data = {
363363
action: message.name,
364364
expected_result: null,
365+
data: null,
365366
};
366367

367368
if (lastIndex === messages.indexOf(message) && testStatus !== 'passed') {
@@ -388,6 +389,7 @@ export class CypressQaseReporter extends reporters.Base {
388389
newStep.data = {
389390
action: step.name,
390391
expected_result: null,
392+
data: null,
391393
};
392394

393395
if (attachments[step.id]) {

qase-javascript-commons/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "qase-javascript-commons",
3-
"version": "2.2.13",
3+
"version": "2.2.14",
44
"description": "Qase JS Reporters",
55
"main": "./dist/index.js",
66
"types": "./dist/index.d.ts",

qase-javascript-commons/src/models/step-data.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
export interface StepTextData {
22
action: string;
33
expected_result: string | null;
4+
data: string | null;
45
}
56

67
export interface StepGherkinData {

qase-javascript-commons/src/models/test-step.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export class TestStepType {
2929
this.data = {
3030
action: '',
3131
expected_result: null,
32+
data: null,
3233
};
3334
} else {
3435
this.data = {

qase-javascript-commons/src/reporters/testops-reporter.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,14 @@ export class TestOpsReporter extends AbstractReporter {
625625
resultStep.data.action = step.data.action;
626626
}
627627
}
628+
629+
if ('expected_result' in step.data && resultStep.data != undefined && step.data.expected_result != null) {
630+
resultStep.data.expected_result = step.data.expected_result;
631+
}
632+
633+
if ('data' in step.data && resultStep.data != undefined && step.data.data != null) {
634+
resultStep.data.input_data = step.data.data;
635+
}
628636
}
629637

630638
if (step.step_type === StepType.GHERKIN) {

qase-javascript-commons/src/steps/step.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ export class QaseStep {
7070
step.data = {
7171
action: this.name,
7272
expected_result: null,
73+
data: null,
7374
};
7475

7576
try {

qase-jest/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jest-qase-reporter",
3-
"version": "2.0.4",
3+
"version": "2.0.5",
44
"description": "Qase TMS Jest Reporter",
55
"main": "./dist/index.js",
66
"types": "./dist/index.d.ts",
@@ -45,7 +45,7 @@
4545
"dependencies": {
4646
"lodash.get": "^4.4.2",
4747
"lodash.has": "^4.5.2",
48-
"qase-javascript-commons": "~2.2.1",
48+
"qase-javascript-commons": "~2.2.14",
4949
"uuid": "^9.0.0"
5050
},
5151
"devDependencies": {

0 commit comments

Comments
 (0)