-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: last symbol was sliced at console message
- Loading branch information
1 parent
cc1be26
commit 56c8228
Showing
5 changed files
with
454 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
113 changes: 113 additions & 0 deletions
113
tests/reporter/assets/azure-reporter/pointsResponseMapper.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
export default function pointsResponseMapper(body) { | ||
/** | ||
* body sample request: | ||
* { | ||
* "pointsFilter": { | ||
* "testcaseIds": [ | ||
* 1, | ||
* 2, | ||
* 3 | ||
* ], | ||
* } | ||
*/ | ||
|
||
const { pointsFilter } = body; | ||
const { testcaseIds } = pointsFilter; | ||
const testPointsArray = Array.from({ length: testcaseIds.length }, (_, i) => { | ||
return { | ||
id: 1 + i, | ||
url: 'http://localhost:3000/SampleSample/_apis/test/Plans/4/Suites/6/Points/' + (i + 1 * 3), | ||
assignedTo: { | ||
displayName: 'Alex', | ||
id: '230e55b4-9e71-6a10-a0fa-777777777', | ||
}, | ||
automated: false, | ||
configuration: { | ||
id: '1', | ||
name: 'Windows 10', | ||
}, | ||
lastTestRun: { | ||
id: '238', | ||
}, | ||
lastResult: { | ||
id: (100000 + i).toString(), | ||
}, | ||
outcome: 'Passed', | ||
state: 'Completed', | ||
lastResultState: 'Completed', | ||
suite: { | ||
id: '6', | ||
}, | ||
testCase: { | ||
id: testcaseIds[i], | ||
}, | ||
testPlan: { | ||
id: '4', | ||
}, | ||
workItemProperties: [ | ||
{ | ||
workItem: { | ||
key: 'Microsoft.VSTS.TCM.AutomationStatus', | ||
value: 'Not Automated', | ||
}, | ||
}, | ||
], | ||
}; | ||
}); | ||
|
||
return { | ||
points: testPointsArray, | ||
pointsFilter, | ||
}; | ||
} | ||
|
||
/** | ||
* response sample: | ||
* { | ||
"points": [ | ||
{ | ||
"id": 1, | ||
"url": "http://localhost:3000/SampleSample/_apis/test/Plans/4/Suites/6/Points/1", | ||
"assignedTo": { | ||
"displayName": "Alex", | ||
"id": "230e55b4-9e71-6a10-a0fa-777777777" | ||
}, | ||
"automated": false, | ||
"configuration": { | ||
"id": "1", | ||
"name": "Windows 10" | ||
}, | ||
"lastTestRun": { | ||
"id": "238" | ||
}, | ||
"lastResult": { | ||
"id": "100000" | ||
}, | ||
"outcome": "Passed", | ||
"state": "Completed", | ||
"lastResultState": "Completed", | ||
"suite": { | ||
"id": "6" | ||
}, | ||
"testCase": { | ||
"id": "3" | ||
}, | ||
"testPlan": { | ||
"id": "4" | ||
}, | ||
"workItemProperties": [ | ||
{ | ||
"workItem": { | ||
"key": "Microsoft.VSTS.TCM.AutomationStatus", | ||
"value": "Not Automated" | ||
} | ||
} | ||
] | ||
} | ||
], | ||
"pointsFilter": { | ||
"testcaseIds": [3] | ||
} | ||
} | ||
*/ |
147 changes: 147 additions & 0 deletions
147
tests/reporter/assets/azure-reporter/testResultsByQueryResponseMapping.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
export default function testResultsByQueryResponseMapping(body) { | ||
return { | ||
fields: [''], | ||
results: body.results.map((_, i) => { | ||
return { | ||
id: (100000 + i).toString(), | ||
configuration: { | ||
id: '1', | ||
}, | ||
project: { | ||
id: '40067afb-7d94-4832-8565-a31e3427ecd3', | ||
}, | ||
durationInMs: 7787, | ||
outcome: 'Failed', | ||
revision: 1, | ||
state: 'Completed', | ||
testCase: { | ||
id: '3', | ||
name: 'Should page opened', | ||
}, | ||
testPoint: { | ||
id: (1 + i).toString(), | ||
}, | ||
testRun: { | ||
id: '627', | ||
name: '', | ||
}, | ||
lastUpdatedDate: '2023-04-07T08:59:13.010Z', | ||
priority: 2, | ||
errorMessage: | ||
'[3,8] Awaiting for user input: expect(received).toHaveTitle(expected)\n\nExpected pattern: /Getting started/\nReceived string: "Installation | Playwright"\nCall log:\n - expect.toHaveTitle with timeout 5000ms\n - waiting for locator(':root')\n - locator resolved to <html lang="en" dir="ltr" data-theme="light" data-rh="…>…</html>\n - unexpected value "Installation | Playwright"\n - waiting for locator(':root')\n - locator resolved to <html lang="en" dir="ltr" data-theme="light" data-rh="…>…</html>\n - unexpected value "Installation | Playwright"\n - locator resolved to <html lang="en" dir="ltr" data-theme="light" data-rh="…>…</html>\n - unexpected value "Installation | Playwright"\n - locator resolved to <html lang="en" dir="ltr" data-theme="light" data-rh="…>…</html>\n - unexpected value "Installation | Playwright"\n - locator resolved to <html lang="en" dir="ltr" data-theme="light" data-rh="…>…</html>\n - unexpected value "Installation | Playwright"\n - locator resolved to <html lang="en" dir="ltr" data-theme="light" data-rh="…>…</html>\n - unexpected value "Installation | Playwright"\n - locator resolved to <html lang="en" dir="ltr" data-theme="light" data-rh="…>…</html>\n - unexpected value "Installation | Playwright"\n - locator resolved to <html lang="en" dir="ltr" data-theme="light" data-rh="…>…</html>\n - unexpected value "Installation | Playwright"\n - locator resolved to <html lang="en" dir="ltr" data-theme="light" data-rh="…>…</html>\n - unexpected value "Installation | Playwright"\n', | ||
createdDate: '2023-04-07T08:59:13.010Z', | ||
failureType: 'None', | ||
testCaseTitle: 'Should page opened', | ||
testCaseRevision: 3, | ||
customFields: [], | ||
testCaseReferenceId: 36418281, | ||
owner: { | ||
displayName: 'Alex Neo', | ||
url: 'https://spsprodweu5.vssps.visualstudio.com/Ad6c695e8-17f3-43da-936c-f9416e2e490d/_apis/Identities/230e55b4-9e71-6a10-a0fa-780a87894418', | ||
_links: { | ||
avatar: { | ||
href: 'https://dev.azure.com/alex-neo/_apis/GraphProfile/MemberAvatars/msa.MjMwZTU1YjQtOWU3MS03YTEwLWEwZmEtNzgwYTg3ODk0NDE4', | ||
}, | ||
}, | ||
id: '230e55b4-9e71-6a10-a0fa-780a87894418', | ||
uniqueName: 'alex.dev.play@gmail.com', | ||
imageUrl: | ||
'https://dev.azure.com/alex-neo/_apis/GraphProfile/MemberAvatars/msa.MjMwZTU1YjQtOWU3MS03YTEwLWEwZmEtNzgwYTg3ODk0NDE4', | ||
descriptor: 'msa.MjMwZTU1YjQtOWU3MS03YTEwLWEwZmEtNzgwYTg3ODk0NDE4', | ||
}, | ||
runBy: { | ||
displayName: 'Alex Neo', | ||
url: 'https://spsprodweu5.vssps.visualstudio.com/Ad6c695e8-17f3-43da-936c-f9416e2e490d/_apis/Identities/230e55b4-9e71-6a10-a0fa-780a87894418', | ||
_links: { | ||
avatar: { | ||
href: 'https://dev.azure.com/alex-neo/_apis/GraphProfile/MemberAvatars/msa.MjMwZTU1YjQtOWU3MS03YTEwLWEwZmEtNzgwYTg3ODk0NDE4', | ||
}, | ||
}, | ||
id: '230e55b4-9e71-6a10-a0fa-780a87894418', | ||
uniqueName: 'alex.dev.play@gmail.com', | ||
imageUrl: | ||
'https://dev.azure.com/alex-neo/_apis/GraphProfile/MemberAvatars/msa.MjMwZTU1YjQtOWU3MS03YTEwLWEwZmEtNzgwYTg3ODk0NDE4', | ||
descriptor: 'msa.MjMwZTU1YjQtOWU3MS03YTEwLWEwZmEtNzgwYTg3ODk0NDE4', | ||
}, | ||
lastUpdatedBy: { | ||
displayName: 'Alex Neo', | ||
url: 'https://spsprodweu5.vssps.visualstudio.com/Ad6c695e8-17f3-43da-936c-f9416e2e490d/_apis/Identities/230e55b4-9e71-6a10-a0fa-780a87894418', | ||
_links: { | ||
avatar: { | ||
href: 'https://dev.azure.com/alex-neo/_apis/GraphProfile/MemberAvatars/msa.MjMwZTU1YjQtOWU3MS03YTEwLWEwZmEtNzgwYTg3ODk0NDE4', | ||
}, | ||
}, | ||
id: '230e55b4-9e71-6a10-a0fa-780a87894418', | ||
uniqueName: 'alex.dev.play@gmail.com', | ||
imageUrl: | ||
'https://dev.azure.com/alex-neo/_apis/GraphProfile/MemberAvatars/msa.MjMwZTU1YjQtOWU3MS03YTEwLWEwZmEtNzgwYTg3ODk0NDE4', | ||
descriptor: 'msa.MjMwZTU1YjQtOWU3MS03YTEwLWEwZmEtNzgwYTg3ODk0NDE4', | ||
}, | ||
}; | ||
}), | ||
}; | ||
} | ||
|
||
/** | ||
* body sample: | ||
* { | ||
"fields": [ | ||
"" | ||
], | ||
"results": [ | ||
{ | ||
"id": "100000", | ||
"testRun": { | ||
"id": "150" | ||
} | ||
}, | ||
{ | ||
"id": "100001", | ||
"testRun": { | ||
"id": "150" | ||
} | ||
}, | ||
{ | ||
"id": "100002", | ||
"testRun": { | ||
"id": "150" | ||
} | ||
}, | ||
{ | ||
"id": "100003", | ||
"testRun": { | ||
"id": "150" | ||
} | ||
}, | ||
{ | ||
"id": "100004", | ||
"testRun": { | ||
"id": "150" | ||
} | ||
} | ||
] | ||
} | ||
*/ | ||
|
||
/** | ||
* response sample: | ||
* { | ||
"count": 1, | ||
"value": [ | ||
{ | ||
"id": 100001, | ||
"project": {}, | ||
"outcome": "Passed", | ||
"testRun": { | ||
"id": "150" | ||
}, | ||
"priority": 0, | ||
"url": "", | ||
"lastUpdatedBy": { | ||
"displayName": null, | ||
"id": null | ||
} | ||
} | ||
] | ||
} | ||
*/ |
65 changes: 65 additions & 0 deletions
65
tests/reporter/assets/azure-reporter/testRunResultsMapper.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
export default function testRunResultsMapper(body) { | ||
return { | ||
count: body.length, | ||
value: body.map((_, i) => { | ||
return { | ||
id: (100000 + i).toString(), | ||
project: {}, | ||
outcome: 'Passed', | ||
testRun: { | ||
id: '150', | ||
}, | ||
priority: 0, | ||
url: '', | ||
lastUpdatedBy: { | ||
displayName: null, | ||
id: null, | ||
}, | ||
}; | ||
}), | ||
}; | ||
} | ||
|
||
/** | ||
* body sample: | ||
* [ | ||
{ | ||
"testPoint": { | ||
"id": "3" | ||
}, | ||
"outcome": "Passed", | ||
"state": "Completed", | ||
"durationInMs": 11 | ||
}, | ||
{ | ||
"testPoint": { | ||
"id": "4" | ||
}, | ||
"outcome": "Passed", | ||
"state": "Completed", | ||
"durationInMs": 2 | ||
}, | ||
*/ | ||
|
||
/** | ||
* response sample: | ||
* { | ||
"count": 1, | ||
"value": [ | ||
{ | ||
"id": 100001, | ||
"project": {}, | ||
"outcome": "Passed", | ||
"testRun": { | ||
"id": "150" | ||
}, | ||
"priority": 0, | ||
"url": "", | ||
"lastUpdatedBy": { | ||
"displayName": null, | ||
"id": null | ||
} | ||
} | ||
] | ||
} | ||
*/ |
Oops, something went wrong.