From f37d3105ce936532e696a2f178dc3166c5b9e1bc Mon Sep 17 00:00:00 2001 From: Dileep B Date: Tue, 14 Feb 2023 21:09:52 +0530 Subject: [PATCH] add pending and unknown test status --- README.md | 10 +++---- package.json | 4 +-- src/constants.js | 2 +- src/reportTemplate/bundle.js | 2 +- src/reporter.js | 21 ++++++++++----- src/web/components/Canvas.js | 10 +++---- src/web/components/OverallExecutionSummary.js | 7 ++++- test/unit/repoter.spec.js | 27 ------------------- 8 files changed, 34 insertions(+), 49 deletions(-) diff --git a/README.md b/README.md index cf678a2..966261c 100644 --- a/README.md +++ b/README.md @@ -35,11 +35,11 @@ Sample implementation can be found in `test/demo/demo.spec.js` and `test/demo/b #### setTestInfo For mapping test information to data collected, server binding `POST: /session/:sessionId/setTestInfo` is exposed. This binding accepts JSON payload with keys as mentioned below -| key | Description | Type | Accepted Values | -| ----------- | ----------- | ---- | --------------- | -| testName | Name of the test | Mandatory | any string | -| testStatus | Test execution status | Mandatory | PASSED, FAILED | -| error | Reason for test Failure | Optinal | any string | +| key | Description | Type | Accepted Values | +| ----------- | ----------- | ---- | --------------- | +| testName | Name of the test | Mandatory | any string | +| testStatus | Test execution status | Mandatory | PASSED, FAILED, PENDING, All other string considered as unknown | +| error | Reason for test Failure | Optinal | any string | ex: ``` diff --git a/package.json b/package.json index c831301..a785d9b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "appium-reporter-plugin", - "version": "1.0.0-beta.12", + "version": "1.0.0-beta.13", "description": "Appium 2.0 plugin for generating html report with screenshots server side.", "main": "./lib/index.js", "scripts": { @@ -32,7 +32,6 @@ }, "homepage": "https://github.com/AppiumTestDistribution/appium-reporter-plugin#readme", "dependencies": { - "babel-cli": "^6.26.0", "edit-json-file": "^1.7.0", "fs-extra": "^11.1.0", "jpeg-js": "^0.4.4", @@ -52,6 +51,7 @@ "mainClass": "ReportPlugin" }, "devDependencies": { + "babel-cli": "^6.26.0", "@babel/core": "^7.18.6", "@babel/node": "^7.18.6", "@typescript-eslint/parser": "^5.38.1", diff --git a/src/constants.js b/src/constants.js index 78bebd9..e16545a 100644 --- a/src/constants.js +++ b/src/constants.js @@ -13,4 +13,4 @@ export const cmdExclusionList = [ 'closeapp', 'background', ]; -export const testStatusValues = ['PASSED', 'FAILED']; +export const testStatusValues = ['PASSED', 'FAILED', 'PENDING']; diff --git a/src/reportTemplate/bundle.js b/src/reportTemplate/bundle.js index 0207845..51191f4 100644 --- a/src/reportTemplate/bundle.js +++ b/src/reportTemplate/bundle.js @@ -1,2 +1,2 @@ /*! For license information please see bundle.js.LICENSE.txt */ -!function(){"use strict";var t={617:function(t,e,n){var i=n(537),r=n.n(i),a=n(645),o=n.n(a),s=n(667),l=n.n(s),c=new URL(n(214),n.b),u=o()(r()),d=l()(c);u.push([t.id,".App {\n text-align: center;\n margin: 0;\n font-family: var(--bs-font-sans-serif);\n font-size: 1rem;\n font-weight: 400;\n line-height: 1.5;\n color: #212529;\n background-color: #fff;\n -webkit-text-size-adjust: 100%;\n -webkit-tap-highlight-color: transparent;\n}\n\n.App-header {\n background-color: darkslategrey;\n display: flex;\n flex-direction: row;\n color: white;\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n box-shadow: 0 .5rem 1rem rgba(0,0,0,.15)!important;\n position: -webkit-sticky;\n position: sticky;\n top: 0;\n z-index: 1020;\n}\n\n.heading-text {\n padding-top: 0.3125rem;\n padding-bottom: 0.3125rem;\n font-size: 1.25rem;\n font-weight: 450;\n text-decoration: none;\n white-space: nowrap;\n padding-right: 1rem!important;\n padding-left: 1rem!important;\n margin-right: 0!important;\n}\n\n.App-header-dark .heading-text {\n color: #fff;\n}\n\n.container-row {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: stretch;\n}\n\n.sidebar {\n background-color: #f8f9fa!important;\n /* height: 100vh; */\n min-width: 30vh;\n max-width: 30vh;\n display: block;\n border-right: 1px solid #dee2e6!important;\n position: sticky;\n}\n\n@media (min-width: 768px){\n .block-display {\n display: block!important;\n }\n .col-md-2 {\n flex: 0 0 auto;\n width: 16.66666667%;\n }\n }\n\n .sidebar-heading{\n margin-top: 1.5rem!important;\n color: #6c757d!important;\n font-size: 1rem;\n margin-bottom: 0.5rem;\n font-weight: 500;\n line-height: 1.5;\n padding-left: 0.5em;\n padding-right: 0.5em;\n }\n\n .centered {\n display: flex;\n align-items: center!important;\n }\n\n .space-around {\n display: flex;\n justify-content: space-between!important;\n }\n\n .sidebar-links {\n display: flex;\n flex-wrap: wrap;\n padding-left: 0;\n margin-bottom: 0;\n list-style: none;\n flex-direction: column!important;\n align-items: stretch;\n }\n\n .link-text {\n display: flex;\n justify-self: flex-start;\n align-self: flex-start;\n text-align: left;\n padding: 0.5rem 1rem;\n color: #0d6efd;\n text-decoration: none;\n transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out;\n border: none;\n background-color: transparent;\n font-family: var(--bs-font-sans-serif);\n font-size: 1rem;\n font-weight: 400;\n line-height: 1.5;\n -webkit-text-size-adjust: 100%;\n -webkit-tap-highlight-color: transparent;\n }\n\n .active {\n background-color: rgb(193, 192, 192);\n }\n\n .form-select-sm {\n padding-top: 0.25rem;\n padding-bottom: 0.25rem;\n padding-left: 0.5rem;\n font-size: .875rem;\n }\n\n .form-select {\n display: block;\n padding: 0.375rem 2.25rem 0.375rem 0.75rem;\n font-weight: 400;\n line-height: 1.0;\n color: #212529;\n background-color: #fff;\n background-image: url("+d+");\n background-repeat: no-repeat;\n background-position: right 0.75rem center;\n background-size: 16px 12px;\n border: 1px solid #ced4da;\n border-radius: 0.25rem;\n transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;\n appearance: none;\n }\n\n .select {\n word-wrap: normal;\n }\n\n .button, select {\n text-transform: none;\n }\n\n a[href], input[type='submit'], input[type='image'], label[for], select, button, .pointer {\n cursor: pointer;\n }\n\n .lowered {\n padding-top: 2%;\n }\n\n .test-summary-page{\n display: flex;\n flex-direction: column;\n padding-right: 3rem!important;\n padding-left: 3rem!important;\n min-height: 100vh!important;\n }\n\n .test-summary-header {\n flex-wrap: nowrap!important;\n padding-bottom: 0.5rem!important;\n padding-top: 1rem!important;\n margin-bottom: 1rem!important;\n align-items: center!important;\n justify-content: space-between!important;\n flex-wrap: wrap!important;\n border-bottom: 1px solid #dee2e6!important;\n display: flex!important;\n }\n\n .summary-text-heading {\n padding-top: 20px;\n padding-bottom: 20px;\n text-align: left;\n margin: 0%;\n font-size: 1.25rem;\n font-weight: 700;\n line-height: 1.2;\n }\n\n .summary-text {\n background-color:#f8f9fa!important;\n text-align: left;\n margin: 0%;\n font-size: calc(1.275rem + .3vw);\n font-weight: 400;\n line-height: 1.2;\n }\n\n .screenshot {\n border-color: #6c757d!important;\n border: 1px solid #dee2e6!important;\n flex: 0 0 auto;\n max-width: 50%;\n max-height: 70%;\n }\n\n .test-info {\n flex: 0 0 auto;\n width: 50%;\n overflow-x: auto;\n padding-left: 1%;\n }\n\n .table {\n --bs-table-bg: transparent;\n --bs-table-accent-bg: transparent;\n --bs-table-striped-color: #212529;\n --bs-table-striped-bg: rgba(0, 0, 0, 0.05);\n --bs-table-active-color: #212529;\n --bs-table-active-bg: rgba(0, 0, 0, 0.1);\n --bs-table-hover-color: #212529;\n --bs-table-hover-bg: rgba(0, 0, 0, 0.075);\n /* width: 100%; */\n margin-bottom: 1rem;\n color: #212529;\n vertical-align: top;\n border-bottom: 1px solid #dee2e6!important;\n border-collapse: collapse;\n text-align: left;\n }\n\n .table-header{\n border-bottom: 1px solid black;\n border-collapse: collapse;\n vertical-align: bottom;\n }\n\n .table-row{\n border-bottom: 1px solid #dee2e6!important;\n border-collapse: collapse;\n }\n\n .table-cell{\n padding-right: 10px;\n }\n\n .json-text{\n overflow: auto;\n background-color: #f8f9fa!important;\n font-size: .875em;\n font-weight: 400;\n }\n\n .overall-execution-summary-data{\n padding-left: 3rem!important;\n padding-right: 3rem!important;\n width: 50%;\n }\n\n .chart-box{\n display: block; \n box-sizing: border-box; \n width: 50%;\n }\n \n","",{version:3,sources:["webpack://./App.css"],names:[],mappings:"AAAA;EACE,kBAAkB;EAClB,SAAS;EACT,sCAAsC;EACtC,eAAe;EACf,gBAAgB;EAChB,gBAAgB;EAChB,cAAc;EACd,sBAAsB;EACtB,8BAA8B;EAC9B,wCAAwC;AAC1C;;AAEA;EACE,+BAA+B;EAC/B,aAAa;EACb,mBAAmB;EACnB,YAAY;EACZ,mBAAmB;EACnB,sBAAsB;EACtB,kDAAkD;EAClD,wBAAwB;EACxB,gBAAgB;EAChB,MAAM;EACN,aAAa;AACf;;AAEA;EACE,sBAAsB;EACtB,yBAAyB;EACzB,kBAAkB;EAClB,gBAAgB;EAChB,qBAAqB;EACrB,mBAAmB;EACnB,6BAA6B;EAC7B,4BAA4B;EAC5B,yBAAyB;AAC3B;;AAEA;EACE,WAAW;AACb;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,2BAA2B;EAC3B,oBAAoB;AACtB;;AAEA;EACE,mCAAmC;EACnC,mBAAmB;EACnB,eAAe;EACf,eAAe;EACf,cAAc;EACd,yCAAyC;EACzC,gBAAgB;AAClB;;AAEA;EACE;MACI,wBAAwB;EAC5B;EACA;IACE,cAAc;IACd,mBAAmB;EACrB;EACA;;EAEA;IACE,4BAA4B;IAC5B,wBAAwB;IACxB,eAAe;IACf,qBAAqB;IACrB,gBAAgB;IAChB,gBAAgB;IAChB,mBAAmB;IACnB,oBAAoB;EACtB;;EAEA;IACE,aAAa;IACb,6BAA6B;EAC/B;;EAEA;IACE,aAAa;IACb,wCAAwC;EAC1C;;EAEA;IACE,aAAa;IACb,eAAe;IACf,eAAe;IACf,gBAAgB;IAChB,gBAAgB;IAChB,gCAAgC;IAChC,oBAAoB;EACtB;;EAEA;IACE,aAAa;IACb,wBAAwB;IACxB,sBAAsB;IACtB,gBAAgB;IAChB,oBAAoB;IACpB,cAAc;IACd,qBAAqB;IACrB,kGAAkG;IAClG,YAAY;IACZ,6BAA6B;IAC7B,sCAAsC;IACtC,eAAe;IACf,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A0C;IAC1C,yBAAyB;IACzB,gBAAgB;EAClB;;EAEA;IACE,8BAA8B;IAC9B,yBAAyB;IACzB,sBAAsB;EACxB;;EAEA;IACE,0CAA0C;IAC1C,yBAAyB;EAC3B;;EAEA;IACE,mBAAmB;EACrB;;EAEA;IACE,cAAc;IACd,mCAAmC;IACnC,iBAAiB;IACjB,gBAAgB;EAClB;;EAEA;IACE,4BAA4B;IAC5B,6BAA6B;IAC7B,UAAU;EACZ;;EAEA;IACE,cAAc;IACd,sBAAsB;IACtB,UAAU;EACZ",sourcesContent:[".App {\n text-align: center;\n margin: 0;\n font-family: var(--bs-font-sans-serif);\n font-size: 1rem;\n font-weight: 400;\n line-height: 1.5;\n color: #212529;\n background-color: #fff;\n -webkit-text-size-adjust: 100%;\n -webkit-tap-highlight-color: transparent;\n}\n\n.App-header {\n background-color: darkslategrey;\n display: flex;\n flex-direction: row;\n color: white;\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n box-shadow: 0 .5rem 1rem rgba(0,0,0,.15)!important;\n position: -webkit-sticky;\n position: sticky;\n top: 0;\n z-index: 1020;\n}\n\n.heading-text {\n padding-top: 0.3125rem;\n padding-bottom: 0.3125rem;\n font-size: 1.25rem;\n font-weight: 450;\n text-decoration: none;\n white-space: nowrap;\n padding-right: 1rem!important;\n padding-left: 1rem!important;\n margin-right: 0!important;\n}\n\n.App-header-dark .heading-text {\n color: #fff;\n}\n\n.container-row {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: stretch;\n}\n\n.sidebar {\n background-color: #f8f9fa!important;\n /* height: 100vh; */\n min-width: 30vh;\n max-width: 30vh;\n display: block;\n border-right: 1px solid #dee2e6!important;\n position: sticky;\n}\n\n@media (min-width: 768px){\n .block-display {\n display: block!important;\n }\n .col-md-2 {\n flex: 0 0 auto;\n width: 16.66666667%;\n }\n }\n\n .sidebar-heading{\n margin-top: 1.5rem!important;\n color: #6c757d!important;\n font-size: 1rem;\n margin-bottom: 0.5rem;\n font-weight: 500;\n line-height: 1.5;\n padding-left: 0.5em;\n padding-right: 0.5em;\n }\n\n .centered {\n display: flex;\n align-items: center!important;\n }\n\n .space-around {\n display: flex;\n justify-content: space-between!important;\n }\n\n .sidebar-links {\n display: flex;\n flex-wrap: wrap;\n padding-left: 0;\n margin-bottom: 0;\n list-style: none;\n flex-direction: column!important;\n align-items: stretch;\n }\n\n .link-text {\n display: flex;\n justify-self: flex-start;\n align-self: flex-start;\n text-align: left;\n padding: 0.5rem 1rem;\n color: #0d6efd;\n text-decoration: none;\n transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out;\n border: none;\n background-color: transparent;\n font-family: var(--bs-font-sans-serif);\n font-size: 1rem;\n font-weight: 400;\n line-height: 1.5;\n -webkit-text-size-adjust: 100%;\n -webkit-tap-highlight-color: transparent;\n }\n\n .active {\n background-color: rgb(193, 192, 192);\n }\n\n .form-select-sm {\n padding-top: 0.25rem;\n padding-bottom: 0.25rem;\n padding-left: 0.5rem;\n font-size: .875rem;\n }\n\n .form-select {\n display: block;\n padding: 0.375rem 2.25rem 0.375rem 0.75rem;\n font-weight: 400;\n line-height: 1.0;\n color: #212529;\n background-color: #fff;\n background-image: url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e\");\n background-repeat: no-repeat;\n background-position: right 0.75rem center;\n background-size: 16px 12px;\n border: 1px solid #ced4da;\n border-radius: 0.25rem;\n transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;\n appearance: none;\n }\n\n .select {\n word-wrap: normal;\n }\n\n .button, select {\n text-transform: none;\n }\n\n a[href], input[type='submit'], input[type='image'], label[for], select, button, .pointer {\n cursor: pointer;\n }\n\n .lowered {\n padding-top: 2%;\n }\n\n .test-summary-page{\n display: flex;\n flex-direction: column;\n padding-right: 3rem!important;\n padding-left: 3rem!important;\n min-height: 100vh!important;\n }\n\n .test-summary-header {\n flex-wrap: nowrap!important;\n padding-bottom: 0.5rem!important;\n padding-top: 1rem!important;\n margin-bottom: 1rem!important;\n align-items: center!important;\n justify-content: space-between!important;\n flex-wrap: wrap!important;\n border-bottom: 1px solid #dee2e6!important;\n display: flex!important;\n }\n\n .summary-text-heading {\n padding-top: 20px;\n padding-bottom: 20px;\n text-align: left;\n margin: 0%;\n font-size: 1.25rem;\n font-weight: 700;\n line-height: 1.2;\n }\n\n .summary-text {\n background-color:#f8f9fa!important;\n text-align: left;\n margin: 0%;\n font-size: calc(1.275rem + .3vw);\n font-weight: 400;\n line-height: 1.2;\n }\n\n .screenshot {\n border-color: #6c757d!important;\n border: 1px solid #dee2e6!important;\n flex: 0 0 auto;\n max-width: 50%;\n max-height: 70%;\n }\n\n .test-info {\n flex: 0 0 auto;\n width: 50%;\n overflow-x: auto;\n padding-left: 1%;\n }\n\n .table {\n --bs-table-bg: transparent;\n --bs-table-accent-bg: transparent;\n --bs-table-striped-color: #212529;\n --bs-table-striped-bg: rgba(0, 0, 0, 0.05);\n --bs-table-active-color: #212529;\n --bs-table-active-bg: rgba(0, 0, 0, 0.1);\n --bs-table-hover-color: #212529;\n --bs-table-hover-bg: rgba(0, 0, 0, 0.075);\n /* width: 100%; */\n margin-bottom: 1rem;\n color: #212529;\n vertical-align: top;\n border-bottom: 1px solid #dee2e6!important;\n border-collapse: collapse;\n text-align: left;\n }\n\n .table-header{\n border-bottom: 1px solid black;\n border-collapse: collapse;\n vertical-align: bottom;\n }\n\n .table-row{\n border-bottom: 1px solid #dee2e6!important;\n border-collapse: collapse;\n }\n\n .table-cell{\n padding-right: 10px;\n }\n\n .json-text{\n overflow: auto;\n background-color: #f8f9fa!important;\n font-size: .875em;\n font-weight: 400;\n }\n\n .overall-execution-summary-data{\n padding-left: 3rem!important;\n padding-right: 3rem!important;\n width: 50%;\n }\n\n .chart-box{\n display: block; \n box-sizing: border-box; \n width: 50%;\n }\n \n"],sourceRoot:""}]),e.Z=u},645:function(t){t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",i=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),i&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),i&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,i,r,a){"string"==typeof t&&(t=[[null,t,void 0]]);var o={};if(i)for(var s=0;s0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=a),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),r&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=r):u[4]="".concat(r)),e.push(u))}},e}},667:function(t){t.exports=function(t,e){return e||(e={}),t?(t=String(t.__esModule?t.default:t),/^['"].*['"]$/.test(t)&&(t=t.slice(1,-1)),e.hash&&(t+=e.hash),/["'() \t\n]|(%20)/.test(t)||e.needQuotes?'"'.concat(t.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):t):t}},537:function(t){t.exports=function(t){var e=t[1],n=t[3];if(!n)return e;if("function"==typeof btoa){var i=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),r="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(i),a="/*# ".concat(r," */"),o=n.sources.map((function(t){return"/*# sourceURL=".concat(n.sourceRoot||"").concat(t," */")}));return[e].concat(o).concat([a]).join("\n")}return[e].join("\n")}},448:function(t,e,n){var i=n(294),r=n(840);function a(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n