PageSourceSearch

https://testplane.io/assets/js/ae5ede2c.14524e29.js

js testplane.io collected 2026-10-03 20:18:32 UTC 16,210 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunktestplane_docs=self.webpackChunktestplane_docs||[]).push([["2384"],{77735(e,n,t){t.d(n,{Ay:()=>a,RM:()=>r});var i=t(74848),s=t(28453);let r=[];function l(e){let n={code:"code",em:"em",p:"p",strong:"strong",...(0,s.R)(),...e.components};return(0,i.jsxs)("table",{children:[(0,i.jsx)("thead",{children:(0,i.jsxs)("tr",{children:[(0,i.jsx)("td",{children:(0,i.jsx)(n.strong,{children:"Option"})}),(0,i.jsx)("td",{children:(0,i.jsx)(n.strong,{children:"Type"})}),(0,i.jsx)("td",{children:(0,i.jsx)(n.strong,{children:"Description"})})]})}),(0,i.jsxs)("tbody",{children:[(0,i.jsxs)("tr",{children:[(0,i.jsx)("td",{children:"ignoreElements"}),(0,i.jsx)("td",{children:"Array or String"}),(0,i.jsx)("td",{children:(0,i.jsx)(n.p,{children:"Elements (specified as selectors) that will be ignored when comparing screenshots.\nIgnoring is implemented by painting the listed elements black. In the case of a\nsingle element, the parameter can be specified as a string."})})]}),(0,i.jsxs)("tr",{children:[(0,i.jsx)("td",{children:"tolerance"}),(0,i.jsx)("td",{children:"Number"}),(0,i.jsx)("td",{children:"Sensitivity to color differences."})]}),(0,i.jsxs)("tr",{children:[(0,i.jsx)("td",{children:"antialiasingTolerance"}),(0,i.jsx)("td",{children:"Number"}),(0,i.jsx)("td",{children:"Sensitivity to antialiasing."})]}),(0,i.jsxs)("tr",{children:[(0,i.jsx)("td",{children:"allowViewportOverflow"}),(0,i.jsx)("td",{children:"Boolean"}),(0,i.jsx)("td",{children:(0,i.jsxs)(n.p,{children:["By default, Testplane throws an error if an element is outside the viewport\nboundaries. This parameter disables boundary checking, allowing screenshots of\nelements that do not fit within the viewport. Only the parts of the element that fit\nwithin the viewport will be visible in the screenshot. However, if ",(0,i.jsx)(n.em,{children:"compositeImage"}),"\nis set to ",(0,i.jsx)(n.em,{children:"true"}),", parts of the element that are below the viewport will also be\nvisible in the screenshot. Similarly, if ",(0,i.jsx)(n.em,{children:"captureElementFromTop"})," is set to ",(0,i.jsx)(n.em,{children:"true"}),",\nparts of the element that are above the viewport will also be included in the\nscreenshot."]})})]}),(0,i.jsxs)("tr",{children:[(0,i.jsx)("td",{children:"captureElementFromTop"}),(0,i.jsx)("td",{children:"Boolean"}),(0,i.jsx)("td",{children:(0,i.jsx)(n.p,{children:"Capture a screenshot of the element from the very top. If the element is outside the\nviewport, it will be scrolled into view."})})]}),(0,i.jsxs)("tr",{children:[(0,i.jsx)("td",{children:"compositeImage"}),(0,i.jsx)("td",{children:"Boolean"}),(0,i.jsx)("td",{children:(0,i.jsx)(n.p,{children:"If the element does not fit within the viewport, enabling this option will take\nmultiple screenshots of different parts of the element sequentially, and then stitch\nthem together into one image to display the entire element."})})]}),(0,i.jsxs)("tr",{children:[(0,i.jsx)("td",{children:"screenshotDelay"}),(0,i.jsx)("td",{children:"Number"}),(0,i.jsx)("td",{children:(0,i.jsx)(n.p,{children:"Delay in milliseconds before taking a screenshot. This can be useful when there are\nelements on the page that use animation, or a scrollbar that does not disappear\nimmediately and ends up in the resulting screenshot."})})]}),(0,i.jsxs)("tr",{children:[(0,i.jsx)("td",{children:"selectorToScroll"}),(0,i.jsx)("td",{children:"String"}),(0,i.jsx)("td",{children:(0,i.jsxs)(n.p,{children:["Selector to scroll. This can be useful when you need to take a screenshot of a modal\nwindow that does not fit on the screen. Otherwise, without specifying the selector,\nthe scroll will be applied to the ",(0,i.jsx)(n.em,{children:"window"})," object, and the background will scroll,\nleaving the popup window in place."]})})]}),(0,i.jsxs)("tr",{children:[(0,i.jsx)("td",{children:"disableAnimation"}),(0,i.jsx)("td",{children:"Boolean"}),(0,i.jsx)("td",{children:(0,i.jsxs)(n.p,{children:["Disable animations and transitions when taking a screenshot. Default is ",(0,i.jsx)(n.code,{children:"true"}),"\nstarting from version ",(0,i.jsx)(n.code,{children:"8.0.0"}),"."]})})]}),(0,i.jsxs)("tr",{children:[(0,i.jsx)("td",{children:"ignoreDiffPixelCount"}),(0,i.jsxs)("td",{children:[(0,i.jsx)(n.code,{children:"`${number}%`"})," or Number"]}),(0,i.jsx)("td",{children:(0,i.jsxs)(n.p,{children:["Percentage of pixels to ignore in the diff. Useful for ignoring very small diffs.\nDefault is ",(0,i.jsx)(n.code,{children:"0"}),". Available starting from version ",(0,i.jsx)(n.code,{children:"8.2.0"}),"."]})})]}),(0,i.jsxs)("tr",{children:[(0,i.jsx)("td",{children:"waitForStaticToLoadTimeout"}),(0,i.jsx)("td",{children:"Number"}),(0,i.jsx)("td",{children:(0,i.jsxs)(n.p,{children:["Timeout for ",(0,i.jsx)(n.code,{children:"waitForStaticToLoad"})," command, which is automatically called before\ntaking screenshot. Waiting is disabled, if value is set to ",(0,i.jsx)(n.code,{children:"0"}),". Default is ",(0,i.jsx)(n.code,{children:"5000"}),".\nAvailable starting from version ",(0,i.jsx)(n.code,{children:"8.32.0"}),"."]})})]})]})]})}function a(e={}){let{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(l,{...e})}):l(e)}},82491(e,n,t){t.r(n),t.d(n,{metadata:()=>i,default:()=>x,frontMatter:()=>d,contentTitle:()=>o,toc:()=>h,assets:()=>c});var i=JSON.parse('{"id":"commands/element/assertView","title":"assertView","description":"Overview {/ #overview /}","source":"@site/versioned_docs/version-v8/commands/element/assertView.mdx","sourceDirName":"commands/element","slug":"/commands/element/assertView","permalink":"/docs/v8/commands/element/assertView","draft":false,"unlisted":false,"editUrl":"https://github.com/gemini-testing/testplane-docs/tree/master/versioned_docs/version-v8/commands/element/assertView.mdx","tags":[],"version":"v8","frontMatter":{},"sidebar":"mainSidebar","previous":{"title":"addValue","permalink":"/docs/v8/commands/element/addValue"},"next":{"title":"clearValue","permalink":"/docs/v8/commands/element/clearValue"}}'),s=t(74848),r=t(28453),l=t(77444),a=t(77735);let d={},o="assertView",c={},h=[{value:"Overview",id:"overview",level:2},{value:"Usage",id:"usage",level:2},{value:"Command Parameters",id:"parameters",level:2},{value:"state",id:"state",level:3},{value:"options",id:"options",level:3},...a.RM,{value:"Usage Examples",id:"examples",level:2},{value:"Related Commands",id:"related",level:2}];function m(e){let n={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.header,{children:(0,s.jsx)(n.h1,{id:"assertview",children:"assertView"})}),"\n",(0,s.jsx)(n.h2,{id:"overview",children:"Overview"}),"\n",(0,s.jsxs)(n.p,{children:["Use the ",(0,s.jsx)(n.code,{children:"assertView"})," command to take a screenshot of an element for a specific test state and compare it with a reference."]}),"\n",(0,s.jsx)(l.A,{type:"info",children:(0,s.jsxs)(n.p,{children:["This command is implemented within Testplane and is not available in the ",(0,s.jsx)(n.a,{href:"https://webdriver.io/docs/api",children:"API\nWebDriverIO"}),"."]})}),"\n",(0,s.jsx)(n.h2,{id:"usage",children:"Usage"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-javascript",children:"await browser.$(selector).assertView(state, options);\n"})}),"\n",(0,s.jsx)(l.A,{type:"warning",children:(0,s.jsxs)(n.p,{children:["During execution, the ",(0,s.jsx)(n.em,{children:"assertView"})," command calls ",(0,s.jsx)(n.a,{href:"../waitForExist",children:"waitForExist"})," with\n",(0,s.jsx)(n.a,{href:"../../../reference/config/browsers#wait_timeout",children:"waitTimeout"})," and ",(0,s.jsx)(n.a,{href:"../../../reference/config/browsers#wait_interval",children:"waitInterval"}),"."]})}),"\n",(0,s.jsx)(n.h2,{id:"parameters",children:"Command Parameters"}),"\n",(0,s.jsxs)("table",{children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{children:(0,s.jsx)(n.strong,{children:"Name"})}),(0,s.jsx)("td",{children:(0,s.jsx)(n.strong,{children:"Type"})}),(0,s.jsx)("td",{children:(0,s.jsx)(n.strong,{children:"Description"})})]})}),(0,s.jsxs)("tbody",{children:[(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{children:(0,s.jsx)(n.a,{href:"#state",children:"state"})}),(0,s.jsx)("td",{children:"String"}),(0,s.jsx)("td",{children:"Required parameter. The name of the test state. It must be unique within a single test."})]}),(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{children:(0,s.jsx)(n.a,{href:"#options",children:"options"})}),(0,s.jsx)("td",{children:"Object"}),(0,s.jsxs)("td",{children:["Settings for the ",(0,s.jsx)(n.em,{children:"assertView"})," command."]})]})]})]}),"\n",(0,s.jsx)(n.h3,{id:"state",children:"state"}),"\n",(0,s.jsx)(n.p,{children:"Required parameter. Specifies the name of the test state. The name must be unique within a single test."}),"\n",(0,s.jsx)(n.h3,{id:"options",children:"options"}),"\n",(0,s.jsxs)(n.p,{children:["Specifies the settings for the ",(0,s.jsx)(n.code,{children:"assertView"})," command:"]}),"\n",(0,s.jsx)(a.Ay,{}),"\n",(0,s.jsx)(n.h2,{id:"examples",children:"Usage Examples"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:"example.js"})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-javascript",children:'it("should assert view", async ({ browser }) =>
1 {\n    await browser.url("some/url");\n\n    const elem = await browser.$(".button");\n\n    await elem.assertView("plain");\n    await elem.click();\n    await elem.assertView("clicked");\n});\n'})}),"\n",(0,s.jsx)(n.h2,{id:"related",children:"Related Commands"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"../../browser/assertView",children:"browser.assertView"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"../../browser/saveRecordingScreen",children:"browser.saveRecordingScreen"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"../../browser/saveScreenshot",children:"browser.saveScreenshot"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"../saveScreenshot",children:"element.saveScreenshot"})}),"\n"]})]})}function x(e={}){let{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(m,{...e})}):m(e)}},77444(e,n,t){t.d(n,{A:()=>T});var i=t(74848),s=t(96540),r=t(34164),l=t(30568),a=t(88287);function d({type:e,className:n,children:t,id:s}){return(0,i.jsx)("div",{className:(0,r.A)(a.G.common.admonition,a.G.common.admonitionType(e),"admonition_xJq3",n),id:s,children:t})}function o({icon:e,title:n}){return(0,i.jsxs)("div",{className:"admonitionHeading_Gvgb",children:[(0,i.jsx)("span",{className:"admonitionIcon_Rf37",children:e}),n]})}function c({children:e}){return e?(0,i.jsx)("div",{className:"admonitionContent_BuS1",children:e}):null}function h(e){let{type:n,icon:t,title:s,children:r,className:l,id:a}=e;return(0,i.jsxs)(d,{type:n,className:l,id:a,children:[s||t?(0,i.jsx)(o,{title:s,icon:t}):null,(0,i.jsx)(c,{children:r})]})}let m={icon:(0,i.jsx)(function(e){return(0,i.jsx)("svg",{viewBox:"0 0 14 16",...e,children:(0,i.jsx)("path",{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})})},{}),title:(0,i.jsx)(l.A,{id:"theme.admonition.note",description:"The default label used for the Note admonition (:::note)",children:"note"})};function x(e){return(0,i.jsx)(h,{...m,...e,className:(0,r.A)("alert alert--secondary",e.className),children:e.children})}let j={icon:(0,i.jsx)(function(e){return(0,i.jsx)("svg",{viewBox:"0 0 12 16",...e,children:(0,i.jsx)("path",{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})})},{}),title:(0,i.jsx)(l.A,{id:"theme.admonition.tip",description:"The default label used for the Tip admonition (:::tip)",children:"tip"})};function u(e){return(0,i.jsx)(h,{...j,...e,className:(0,r.A)("alert alert--success",e.className),children:e.children})}let p={icon:(0,i.jsx)(function(e){return(0,i.jsx)("svg",{viewBox:"0 0 14 16",...e,children:(0,i.jsx)("path",{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})})},{}),title:(0,i.jsx)(l.A,{id:"theme.admonition.info",description:"The default label used for the Info admonition (:::info)",children:"info"})};function f(e){return(0,i.jsx)(h,{...p,...e,className:(0,r.A)("alert alert--info",e.className),children:e.children})}function v(e){return(0,i.jsx)("svg",{viewBox:"0 0 16 16",...e,children:(0,i.jsx)("path",{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})})}let w={icon:(0,i.jsx)(v,{}),title:(0,i.jsx)(l.A,{id:"theme.admonition.warning",description:"The default label used for the Warning admonition (:::warning)",children:"warning"})},g={icon:(0,i.jsx)(function(e){return(0,i.jsx)("svg",{viewBox:"0 0 12 16",...e,children:(0,i.jsx)("path",{fillRule:"evenodd",d:"M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"})})},{}),title:(0,i.jsx)(l.A,{id:"theme.admonition.danger",description:"The default label used for the Danger admonition (:::danger)",children:"danger"})},b={icon:(0,i.jsx)(v,{}),title:(0,i.jsx)(l.A,{id:"theme.admonition.caution",description:"The default label used for the Caution admonition (:::caution)",children:"caution"})},y={note:x,tip:u,info:f,warning:function(e){return(0,i.jsx)(h,{...w,...e,className:(0,r.A)("alert alert--warning",e.className),children:e.children})},danger:function(e){return(0,i.jsx)(h,{...g,...e,className:(0,r.A)("alert alert--danger",e.className),children:e.children})},secondary:e=>(0,i.jsx)(x,{title:"secondary",...e}),important:e=>(0,i.jsx)(f,{title:"important",...e}),success:e=>(0,i.jsx)(u,{title:"success",...e}),caution:function(e){return(0,i.jsx)(h,{...b,...e,className:(0,r.A)("alert alert--warning",e.className),children:e.children})}};function T(e){var n;let t,r=function(e){var n;let t,r,l,{mdxAdmonitionTitle:a,rest:d}=(n=e.children,r=(t=s.Children.toArray(n)).find(e=>s.isValidElement(e)&&"mdxAdmonitionTitle"===e.type),l=t.filter(e=>e!==r),{mdxAdmonitionTitle:r?.props.children,rest:l.length>0?(0,i.jsx)(i.Fragment,{children:l}):null}),o=e.title??a;return{...e,...o&&{title:o},children:d}}(e),l=(t=y[n=r.type])||(console.warn(`No admonition component found for admonition type "${n}". Using Info as fallback.`),y.info);return(0,i.jsx)(l,{...r})}},28453(e,n,t){t.d(n,{R:()=>l,x:()=>a});var i=t(96540);let s={},r=i.createContext(s);function l(e){let n=i.useContext(r);return i.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:l(e.components),i.createElement(r.Provider,{value:n},e.children)}}}]);

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.