1"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[29293],{1001:(e,t,r)=>{r.d(t,{A:()=>y});var n=r(7378),s=r(23372),a=r(41129),i=r(82434),o=r(30505),l=r(90703),d=r(8663),c=r(39164),u=r(60534);function h(e){return n.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,n.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad <Tabs> child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the <Tabs> component should be <TabItem>, and every <TabItem> should have a unique "value" prop.`)})?.filter(Boolean)??[]}function p(e){const{values:t,children:r}=e;return(0,n.useMemo)(()=>{const e=t??function(e){return h(e).map(({props:{value:e,label:t,attributes:r,default:n}})=>({value:e,label:t,attributes:r,default:n}))}(r);return function(e){const t=(0,c.XI)(e,(e,t)=>e.value===t.value);if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map(e=>e.value).join(", ")}" found in <Tabs>. Every value needs to be unique.`)}(e),e},[t,r])}function m({value:e,tabValues:t}){return t.some(t=>t.value===e)}function x({queryString:e=!1,groupId:t}){const r=(0,o.W6)(),s=function({queryString:e=!1,groupId:t}){if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!t)throw new Error('Docusaurus error: The <Tabs> component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:e,groupId:t});return[(0,d.aZ)(s),(0,n.useCallback)(e=>{if(!s)return;const t=new URLSearchParams(r.location.search);t.set(s,e),r.replace({...r.location,search:t.toString()})},[s,r])]}function f(e){const{defaultValue:t,queryString:r=!1,groupId:s}=e,a=p(e),[i,o]=(0,n.useState)(()=>function({defaultValue:e,tabValues:t}){if(0===t.length)throw new Error("Docusaurus error: the <Tabs> component requires at least one <TabItem> children component");if(e){if(!m({value:e,tabValues:t}))throw new Error(`Docusaurus error: The <Tabs> has a defaultValue "${e}" but none of its children has the corresponding value. Available values are: ${t.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return e}const r=t.find(e=>e.default)??t[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:t,tabValues:a})),[d,c]=x({queryString:r,groupId:s}),[h,f]=function({groupId:e}){const t=function(e){return e?`docusaurus.tab.${e}`:null}(e),[r,s]=(0,u.Dv)(t);return[r,(0,n.useCallback)(e=>{t&&s.set(e)},[t,s])]}({groupId:s}),g=(()=>{const e=d??h;return m({value:e,tabValues:a})?e:null})();(0,l.A)(()=>{g&&o(g)},[g]);return{selectedValue:i,selectValue:(0,n.useCallback)(e=>{if(!m({value:e,tabValues:a}))throw new Error(`Can't select invalid tab value=${e}`);o(e),c(e),f(e)},[c,f,a]),tabValues:a}}var g=r(17933);const b={tabList:"tabList_PGOh",tabItem:"tabItem_Wr1C"};var j=r(86106);function v({className:e,block:t,selectedValue:r,selectValue:n,tabValues:a}){const o=[],{blockElementScrollPositionUntilNextRender:l}=(0,i.a_)(),d=e=>{const t=e.currentTarget,s=o.indexOf(t),i=a[s].value;i!==r&&(l(t),n(i))},c=e=>{let t=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const r=o.indexOf(e.currentTarget)+1;t=o[r]??o[0];break}case"ArrowLeft":{const r=o.indexOf(e.currentTarget)-1;t=o[r]??o[o.length-1];break}}t?.focus()};return(0,j.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.A)("tabs",{"tabs--block":t},e),children:a.map(({value:e,label:t,attributes:n})=>(0,j.jsx)("li",{role:"tab",tabIndex:r===e?0:-1,"aria-selected":r===e,ref:e=>{o.push(e)},onKeyDown:c,onClick:d,...n,className:(0,s.A)("tabs__item",b.tabItem,n?.className,{"tabs__item--active":r===e}),children:t??e},e))})}function w({lazy:e,children:t,selectedValue:r}){const a=(Array.isArray(t)?t:[t]).filter(Boolean);if(e){const e=a.find(e=>e.props.value===r);return e?(0,n.cloneElement)(e,{className:(0,s.A)("margin-top--md",e.props.className)}):null}return(0,j.jsx)("div",{className:"margin-top--md",children:a.map((e,t)=>(0,n.cloneElement)(e,{key:t,hidden:e.props.value!==r}))})}function k(e){const t=f(e);return(0,j.jsxs)("div",{className:(0,s.A)(a.G.tabs.container,"tabs-container",b.tabList),
1children:[(0,j.jsx)(v,{...t,...e}),(0,j.jsx)(w,{...t,...e})]})}function y(e){const t=(0,g.A)();return(0,j.jsx)(k,{...e,children:h(e.children)},String(t))}},22002:(e,t,r)=>{r.d(t,{R:()=>i,x:()=>o});var n=r(7378);const s={},a=n.createContext(s);function i(e){const t=n.useContext(a);return n.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function o(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:i(e.components),n.createElement(a.Provider,{value:t},e.children)}},45453:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>u,frontMatter:()=>i,metadata:()=>n,toc:()=>d});const n=JSON.parse('{"id":"wdio-light-reporter","title":"Light Reporter Reporter","description":"wdio-light-reporter is a 3rd party package, for more information please see GitHub | npm","source":"@site/docs/_wdio-light-reporter.md","sourceDirName":".","slug":"/wdio-light-reporter","permalink":"/docs/wdio-light-reporter","draft":false,"unlisted":false,"editUrl":"https://github.com/sarfrajadstreaks/wdio-light-reporter/edit/main/README.md","tags":[],"version":"current","frontMatter":{"id":"wdio-light-reporter","title":"Light Reporter Reporter","custom_edit_url":"https://github.com/sarfrajadstreaks/wdio-light-reporter/edit/main/README.md"},"sidebar":"docs","previous":{"title":"Slack Reporter Reporter","permalink":"/docs/wdio-slack-reporter"},"next":{"title":"JSON HTML Reporter Reporter","permalink":"/docs/wdio-json-html-reporter"}}');var s=r(86106),a=r(22002);r(1001),r(87780);const i={id:"wdio-light-reporter",title:"Light Reporter Reporter",custom_edit_url:"https://github.com/sarfrajadstreaks/wdio-light-reporter/edit/main/README.md"},o=void 0,l={},d=[{value:"Inspired by HTML and Mochawesome reporter",id:"inspired-by-html-and-mochawesome-reporter",level:2},{value:"FEATURES",id:"features",level:2},{value:"Releases",id:"releases",level:2},{value:"Installation",id:"installation",level:2},{value:"Configuration",id:"configuration",level:2},{value:"Screenshots",id:"screenshots",level:2},{value:"Result Files",id:"result-files",level:2},{value:"Adding Context",id:"adding-context",level:2},{value:"<code>addLabel()</code> \u2014 Add step-level context",id:"addlabel--add-step-level-context",level:3},{value:"<code>addDetail()</code> \u2014 Add scenario-level context",id:"adddetail--add-scenario-level-context",level:3},{value:"License",id:"license",level:2}];function c(e){const t={a:"a",blockquote:"blockquote",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",...(0,a.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(t.blockquote,{children:["\n",(0,s.jsxs)(t.p,{children:["wdio-light-reporter is a 3rd party package, for more information please see ",(0,s.jsx)(t.a,{href:"https://github.com/sarfrajadstreaks/wdio-light-reporter",children:"GitHub"})," | ",(0,s.jsx)(t.a,{href:"https://www.npmjs.com/package/wdio-light-reporter",children:"npm"})]}),"\n"]}),"\n",(0,s.jsx)(t.h2,{id:"inspired-by-html-and-mochawesome-reporter",children:"Inspired by HTML and Mochawesome reporter"}),"\n",(0,s.jsxs)(t.blockquote,{children:["\n",(0,s.jsxs)(t.p,{children:[(0,s.jsx)(t.strong,{children:"Philosophy:"})," This reporter does not support Cucumber report regeneration and is developed keeping in mind the BDD and Mocha framework.\nHere, ",(0,s.jsx)(t.code,{children:"describe()"})," section is considered as a test scenario and ",(0,s.jsx)(t.code,{children:"it()"})," as a test case inside the test scenarios."]}),"\n"]}),"\n",(0,s.jsx)(t.h2,{id:"features",children:"FEATURES"}),"\n",(0,s.jsxs)(t.ol,{children:["\n",(0,s.jsx)(t.li,{children:"Easy setup"}),"\n",(0,s.jsx)(t.li,{children:"Enhanced UI with Bootstrap 5"}),"\n",(0,s.jsx)(t.li,{children:"Screenshot embedded in HTML report"}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.code,{children:"addLabel()"})," to include step context or name"]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.code,{children:"addDetail()"})," to add context at the scenario level"]}),"\n",(0,s.jsx)(t.li,{children:"Multi-environment run support with environment-based segregation"}),"\n",(0,s.jsx)(t.li,{children:"Expand/collapse all environments with tri-state checkbox"}),"\n",(0,s.jsx)(t.li,{children:"Share / Save as PDF from the navbar"}),"\n"]}),"\n",(0,s.jsx)(t.h2,{id:"releases",children:"Releases"}),"\n",(0,s.jsx)(t.p,{children:"V 0.1.9 - Initial release\nV 0.2.6"}),"\n",(0,s.jsxs)(t.ol,{children:["\n",(0,s.jsx)(t.li,{children:"Include multiple environment runs and segregate based on environment."}),"\n",(0,s.jsx)(t.li,{children:"Fix bugs"}),"\n",(0,s.jsx)(t.li,{children:"Improved performance.\nV 1.0.0 (latest)"}),"\n",(0,s.jsx)(t.li,{children:"Redesigned UI with Bootstrap 5 and custom stat/chart cards."}),"\n",(0,s.jsx)(t.li,{children:"Environment cards with platform/browser icons and inline stats."}),"\n",(0,s.jsx)(t.li,{children:"Expand/collapse all with tri-state checkbox."}),"\n",(0,s.jsx)(t.li,{children:"Share button (Save as PDF)."}),"\n",(0,s.jsx)(t.li,{children:"Responsive accordion headers that shrink before wrapping."}
1),"\n",(0,s.jsx)(t.li,{children:"Code cleanup and dead code removal."}),"\n"]}),"\n",(0,s.jsxs)(t.p,{children:[(0,s.jsx)(t.img,{src:"https://github.com/sarfrajadstreaks/wdio-light-reporter/blob/main/image-1.png",alt:"alt text"}),"\n",(0,s.jsx)(t.img,{src:"https://github.com/sarfrajadstreaks/wdio-light-reporter/blob/main/image.png",alt:"alt text"})]}),"\n",(0,s.jsx)(t.h2,{id:"installation",children:"Installation"}),"\n",(0,s.jsx)(t.p,{children:"NPM"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-sh",children:"npm install wdio-light-reporter --save-dev\n"})}),"\n",(0,s.jsx)(t.h2,{id:"configuration",children:"Configuration"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-js",children:"reporters: ['dot', ['light', {\n outputDir: './Light_Results', // default: './Light_Results'\n outputFile: 'demo', // html report filename (default: 'default')\n addScreenshots: false, // embed screenshots in report (default: false)\n theme: 'dark', // report theme: 'dark' | 'light' (default: 'dark')\n }]\n],\n"})}),"\n",(0,s.jsx)(t.h2,{id:"screenshots",children:"Screenshots"}),"\n",(0,s.jsxs)(t.p,{children:["The reporter does not automatically take screenshots, but if manually configured, it listens to the event and attaches the screenshots in the HTML report.\n",(0,s.jsxs)(t.strong,{children:["To include screenshots in the report, add the below code in the ",(0,s.jsx)(t.code,{children:"afterTest()"})," hook in your wdio conf file:"]})]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-js",children:"afterTest: async function (test, context, { error, result, duration, passed, retries }) {\n if (!passed) { await browser.takeScreenshot() }\n},\n"})}),"\n",(0,s.jsx)(t.h2,{id:"result-files",children:"Result Files"}),"\n",(0,s.jsxs)(t.p,{children:["Each run generates a JSON report for each spec file. To generate a combined JSON and HTML report, add the below code in the ",(0,s.jsx)(t.strong,{children:(0,s.jsx)(t.code,{children:"onComplete()"})})," hook in your wdio conf file:"]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-js",children:'onComplete: function (exitCode, config, capabilities, results) {\n const mergeResults = require("wdio-light-reporter/src/mergeResults");\n mergeResults("./Light_Results");\n},\n'})}),"\n",(0,s.jsxs)(t.blockquote,{children:["\n",(0,s.jsxs)(t.p,{children:["If you run your tests without any ",(0,s.jsx)(t.code,{children:"--suite"})," option, it considers ",(0,s.jsx)(t.code,{children:"default"})," as the suite.\nThe reporter does not work if you provide multiple ",(0,s.jsx)(t.code,{children:"--suite"})," parameters in a single run.\n",(0,s.jsx)(t.code,{children:"wdio run wdio.conf.js --suite firstSuite"})," \u2014 ",(0,s.jsx)(t.strong,{children:"(WORKS FINE)"})," :)\n",(0,s.jsx)(t.code,{children:"wdio run wdio.conf.js --suite firstSuite --suite secondSuite"})," \u2014 ",(0,s.jsx)(t.strong,{children:"(DOES NOT WORK)"})," :("]}),"\n"]}),"\n",(0,s.jsx)(t.h2,{id:"adding-context",children:"Adding Context"}),"\n",(0,s.jsxs)(t.h3,{id:"addlabel--add-step-level-context",children:[(0,s.jsx)(t.code,{children:"addLabel()"})," \u2014 Add step-level context"]}),"\n",(0,s.jsxs)(t.p,{children:["Use ",(0,s.jsx)(t.code,{children:"addLabel()"})," to add context to any test step. It will appear as step info in the report."]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-js",children:'const { addLabel } = require("wdio-light-reporter").default;\n\ndescribe("Show how to use addLabel", () => {\n it("report will add this as steps/context in report", async () => {\n addLabel("Log Example 1 as step 1")\n console.log("Log Example 1")\n addLabel("Log Example 2 as step 2")\n console.log("Log Example 2")\n })\n})\n'})}),"\n",(0,s.jsxs)(t.h3,{id:"adddetail--add-scenario-level-context",children:[(0,s.jsx)(t.code,{children:"addDetail()"})," \u2014 Add scenario-level context"]}),"\n",(0,s.jsxs)(t.p,{children:["Use ",(0,s.jsx)(t.code,{children:"addDetail()"})," to add context at the scenario (describe) level."]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-js",children:'const { addDetail } = require("wdio-light-reporter").default;\n\ndescribe("Show how to use addDetail", () => {\n addDetail("This context will appear at the scenario level")\n it("some test case", async () => {\n // ...\n })\n})\n'})}),"\n",(0,s.jsx)(t.h2,{id:"license",children:"License"}),"\n",(0,s.jsxs)(t.p,{children:["MIT\n",(0,s.jsx)(t.strong,{children:"Free, Hell Yeah!"})]})]})}function u(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(c,{...e})}):c(e)}},87780:(e,t,r)=>{r.d(t,{A:()=>i});r(7378);var n=r(23372);const s={tabItem:"tabItem_l0gC"};var a=r(86106);function i({children:e,hidden:t,className:r}){return(0,a.jsx)("div",{role:"tabpanel",className:(0,n.A)(s.tabItem,r),hidden:t,children:e})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.