testplane 8.20.3 → 8.20.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testplane",
3
- "version": "8.20.3",
3
+ "version": "8.20.5",
4
4
  "description": "Tests framework based on mocha and wdio",
5
5
  "main": "build/src/index.js",
6
6
  "files": [
@@ -4,7 +4,7 @@
4
4
  "use strict";var lib=require("./lib.compat.js");module.exports=function(r){return lib.queryAll(r)};
5
5
  },{"./lib.compat.js":4}],3:[function(require,module,exports){
6
6
  (function (global){(function (){
7
- "use strict";function prepareScreenshotUnsafe(e,t){var r=t.allowViewportOverflow,i=t.captureElementFromTop,o=t.disableAnimation,n=window;if(t.selectorToScroll&&!(n=document.querySelector(t.selectorToScroll)))return{error:"NOTFOUND",message:'Could not find element with css selector specified in "selectorToScroll" option: '+t.selectorToScroll,selector:t.selectorToScroll};var a,l=util.getMainDocumentElem(),c=l.clientWidth,s=l.clientHeight,u=l.scrollWidth,p=l.scrollHeight,d=new Rect({left:util.getScrollLeft(n),top:util.getScrollTop(n),width:c,height:s}),f=configurePixelRatio(t.usePixelRatio),m=[];if(e.forEach(function(e){Rect.isRect(e)?a=a?a.merge(new Rect(e)):new Rect(e):m.push(e)}),a=getCaptureRect(m,{initialRect:a,allowViewportOverflow:r,scrollElem:n,viewportWidth:c,documentHeight:p}),a.error)return a;if(i&&!d.rectInside(a))util.isSafariMobile()?scrollToCaptureAreaInSafari(d,a,n):n.scrollTo(a.left,a.top);else if(r&&d.rectIntersects(a))a.overflowsTopBound(d)&&a.recalculateHeight(d),a.overflowsLeftBound(d)&&a.recalculateWidth(d);else if(!i&&!d.rectIntersects(a))return{error:"OUTSIDE_OF_VIEWPORT",message:'Can not capture element, because it is outside of viewport. Try to set "captureElementFromTop=true" to scroll to it before capture.'};return o&&disableFrameAnimationsUnsafe(),{captureArea:a.scale(f).serialize(),ignoreAreas:findIgnoreAreas(t.ignoreSelectors,{scrollElem:n,pixelRatio:f,viewportWidth:c,documentHeight:p}),viewport:new Rect({left:util.getScrollLeft(n),top:util.getScrollTop(n),width:c,height:s}).scale(f).serialize(),documentHeight:Math.ceil(p*f),documentWidth:Math.ceil(u*f),canHaveCaret:isEditable(document.activeElement),pixelRatio:f}}function disableFrameAnimationsUnsafe(){var e=["","::before","::after"].map(function(e){return"*:not(#testplane-q.testplane-w.testplane-e.testplane-r.testplane-t.testplane-y)"+e}).join(", "),t=[];util.forEachRoot(function(r){var i=document.createElement("style");i.innerHTML=e+["{"," animation-delay: 0ms !important;"," animation-duration: 0ms !important;"," animation-timing-function: step-start !important;"," transition-timing-function: step-start !important;"," scroll-behavior: auto !important;"," transition: none !important;","}"].join("\n"),r.appendChild(i),t.push(i)}),window.__cleanupAnimation=function(){for(var e=0;e<t.length;e++)t[e].parentNode.removeChild(t[e]);delete window.__cleanupAnimation}}function getCaptureRect(e,t){for(var r,i,o=t.initialRect,n=0;n<e.length;n++){if(!(r=lib.queryFirst(e[n])))return{error:"NOTFOUND",message:"Could not find element with css selector specified in setCaptureElements: "+e[n],selector:e[n]};i=getElementCaptureRect(r,t),i&&(o=o?o.merge(i):i)}return o?o.round():{error:"HIDDEN",message:"Area with css selector : "+e+" is hidden",selector:e}}function configurePixelRatio(e){return!1===e?1:window.devicePixelRatio?window.devicePixelRatio:window.screen.deviceXDPI/window.screen.logicalXDPI||1}function findIgnoreAreas(e,t){var r=[];return util.each(e,function(e){var i=queryIgnoreAreas(e);util.each(i,function(e){return addIgnoreArea.call(r,e,t)})}),r}function addIgnoreArea(e,t){var r=e&&getElementCaptureRect(e,t);if(r){var i=r.round().scale(t.pixelRatio).serialize();this.push(i)}}function isHidden(e,t){return"none"===e.display||"hidden"===e.visibility||e.opacity<1e-4||t.width<1e-4||t.height<1e-4}function getElementCaptureRect(e,t){var r=[":before",":after"],i=lib.getComputedStyle(e),o=rect.getAbsoluteClientRect(e,t);if(isHidden(i,o))return null;var n=getExtRect(i,o,t.allowViewportOverflow);return util.each(r,function(r){i=lib.getComputedStyle(e,r),n=n.merge(getExtRect(i,o,t.allowViewportOverflow))}),n}function getExtRect(e,t,r){var i=parseBoxShadow(e.boxShadow),o=parseInt(e.outlineWidth,10);return isNaN(o)&&(o=0),adjustRect(t,i,o,r)}function parseBoxShadow(e){e=e||"";var t,r=/[-+]?\d*\.?\d+px/g,i=e.split(","),o=[];return util.each(i,function(e){(t=e.match(r))&&o.push({offsetX:parseFloat(t[0]),offsetY:parseFloat(t[1])||0,blurRadius:parseFloat(t[2])||0,spreadRadius:parseFloat(t[3])||0,inset:-1!==e.indexOf("inset")})}),o}function adjustRect(e,t,r,i){var o=calculateShadowRect(e,t,i),n=calculateOutlineRect(e,r,i);return o.merge(n)}function calculateOutlineRect(e,t,r){var i=e.top-t,o=e.left-t;return new Rect({top:r?i:Math.max(0,i),left:r?o:Math.max(0,o),bottom:e.bottom+t,right:e.right+t})}function calculateShadowRect(e,t,r){var i=calculateShadowExtent(t),o=e.left+i.left,n=e.top+i.top;return new Rect({left:r?o:Math.max(0,o),top:r?n:Math.max(0,n),width:e.width-i.left+i.right,height:e.height-i.top+i.bottom})}function calculateShadowExtent(e){var t={top:0,left:0,right:0,bottom:0};return util.each(e,function(e){if(!e.inset){var r=e.spreadRadius+e.blurRadius;t.left=Math.min(e.offsetX-r,t.left),t.right=Math.max(e.offsetX+r,t.right),t.top=Math.min(e.offsetY-r,t.top),t.bottom=Math.max(e.offsetY+r,t.bottom)}}),t}function isEditable(e){return!!e&&(/^(input|textarea)$/i.test(e.tagName)||e.isContentEditable)}function scrollToCaptureAreaInSafari(e,t,r){var i=util.getMainDocumentElem(),o=Math.round(i.scrollHeight),n=Math.round(i.clientHeight),a=o-n;r.scrollTo(e.left,Math.min(t.top,a))}var util=require("./util"),rect=require("./rect"),lib=require("./lib.compat.js"),queryIgnoreAreas=require("./ignore-areas"),Rect=rect.Rect;"undefined"==typeof window?global.__geminiCore=exports:window.__geminiCore=exports,exports.queryFirst=lib.queryFirst,exports.prepareScreenshot=function(e,t){t=t||{};try{return prepareScreenshotUnsafe(e,t)}catch(r){return{error:"JS",message:r.stack||r.message}}},exports.disableFrameAnimations=function(){try{return disableFrameAnimationsUnsafe()}catch(e){return{error:"JS",message:e.stack||e.message}}},exports.cleanupFrameAnimations=function(){window.__cleanupAnimation&&window.__cleanupAnimation()},exports.resetZoom=function(){var e=lib.queryFirst('meta[name="viewport"]');if(!e){e=document.createElement("meta"),e.name="viewport";var t=lib.queryFirst("head");t&&t.appendChild(e)}e.content="width=device-width,initial-scale=1.0,user-scalable=no"};
7
+ "use strict";function prepareScreenshotUnsafe(e,t){var r=t.allowViewportOverflow,i=t.captureElementFromTop,o=t.disableAnimation,n=window;if(t.selectorToScroll&&!(n=document.querySelector(t.selectorToScroll)))return{error:"NOTFOUND",message:'Could not find element with css selector specified in "selectorToScroll" option: '+t.selectorToScroll,selector:t.selectorToScroll};var a,l=util.getMainDocumentElem(),c=l.clientWidth,s=l.clientHeight,u=l.scrollWidth,p=l.scrollHeight,d=new Rect({left:util.getScrollLeft(n),top:util.getScrollTop(n),width:c,height:s}),f=configurePixelRatio(t.usePixelRatio),m=[];if(e.forEach(function(e){Rect.isRect(e)?a=a?a.merge(new Rect(e)):new Rect(e):m.push(e)}),a=getCaptureRect(m,{initialRect:a,allowViewportOverflow:r,scrollElem:n,viewportWidth:c,documentHeight:p}),a.error)return a;if(i&&!d.rectInside(a))util.isSafariMobile()?scrollToCaptureAreaInSafari(d,a,n):n.scrollTo(a.left,a.top);else if(r&&d.rectIntersects(a))a.overflowsTopBound(d)&&a.recalculateHeight(d),a.overflowsLeftBound(d)&&a.recalculateWidth(d);else if(!i&&!r&&!d.rectIntersects(a))return{error:"OUTSIDE_OF_VIEWPORT",message:'Can not capture element, because it is outside of viewport. Try to set "captureElementFromTop=true" to scroll to it before capture or to set "allowViewportOverflow=true" to ignore viewport overflow error.'};return o&&disableFrameAnimationsUnsafe(),{captureArea:a.scale(f).serialize(),ignoreAreas:findIgnoreAreas(t.ignoreSelectors,{scrollElem:n,pixelRatio:f,viewportWidth:c,documentHeight:p}),viewport:new Rect({left:util.getScrollLeft(n),top:util.getScrollTop(n),width:c,height:s}).scale(f).serialize(),documentHeight:Math.ceil(p*f),documentWidth:Math.ceil(u*f),canHaveCaret:isEditable(document.activeElement),pixelRatio:f}}function disableFrameAnimationsUnsafe(){var e=["","::before","::after"].map(function(e){return"*:not(#testplane-q.testplane-w.testplane-e.testplane-r.testplane-t.testplane-y)"+e}).join(", "),t=[];util.forEachRoot(function(r){var i=document.createElement("style");i.innerHTML=e+["{"," animation-delay: 0ms !important;"," animation-duration: 0ms !important;"," animation-timing-function: step-start !important;"," transition-timing-function: step-start !important;"," scroll-behavior: auto !important;"," transition: none !important;","}"].join("\n"),r.appendChild(i),t.push(i)}),window.__cleanupAnimation=function(){for(var e=0;e<t.length;e++)t[e].parentNode.removeChild(t[e]);delete window.__cleanupAnimation}}function getCaptureRect(e,t){for(var r,i,o=t.initialRect,n=0;n<e.length;n++){if(!(r=lib.queryFirst(e[n])))return{error:"NOTFOUND",message:"Could not find element with css selector specified in setCaptureElements: "+e[n],selector:e[n]};i=getElementCaptureRect(r,t),i&&(o=o?o.merge(i):i)}return o?o.round():{error:"HIDDEN",message:"Area with css selector : "+e+" is hidden",selector:e}}function configurePixelRatio(e){return!1===e?1:window.devicePixelRatio?window.devicePixelRatio:window.screen.deviceXDPI/window.screen.logicalXDPI||1}function findIgnoreAreas(e,t){var r=[];return util.each(e,function(e){var i=queryIgnoreAreas(e);util.each(i,function(e){return addIgnoreArea.call(r,e,t)})}),r}function addIgnoreArea(e,t){var r=e&&getElementCaptureRect(e,t);if(r){var i=r.round().scale(t.pixelRatio).serialize();this.push(i)}}function isHidden(e,t){return"none"===e.display||"hidden"===e.visibility||e.opacity<1e-4||t.width<1e-4||t.height<1e-4}function getElementCaptureRect(e,t){var r=[":before",":after"],i=lib.getComputedStyle(e),o=rect.getAbsoluteClientRect(e,t);if(isHidden(i,o))return null;var n=getExtRect(i,o,t.allowViewportOverflow);return util.each(r,function(r){i=lib.getComputedStyle(e,r),n=n.merge(getExtRect(i,o,t.allowViewportOverflow))}),n}function getExtRect(e,t,r){var i=parseBoxShadow(e.boxShadow),o=parseInt(e.outlineWidth,10);return isNaN(o)&&(o=0),adjustRect(t,i,o,r)}function parseBoxShadow(e){e=e||"";var t,r=/[-+]?\d*\.?\d+px/g,i=e.split(","),o=[];return util.each(i,function(e){(t=e.match(r))&&o.push({offsetX:parseFloat(t[0]),offsetY:parseFloat(t[1])||0,blurRadius:parseFloat(t[2])||0,spreadRadius:parseFloat(t[3])||0,inset:-1!==e.indexOf("inset")})}),o}function adjustRect(e,t,r,i){var o=calculateShadowRect(e,t,i),n=calculateOutlineRect(e,r,i);return o.merge(n)}function calculateOutlineRect(e,t,r){var i=e.top-t,o=e.left-t;return new Rect({top:r?i:Math.max(0,i),left:r?o:Math.max(0,o),bottom:e.bottom+t,right:e.right+t})}function calculateShadowRect(e,t,r){var i=calculateShadowExtent(t),o=e.left+i.left,n=e.top+i.top;return new Rect({left:r?o:Math.max(0,o),top:r?n:Math.max(0,n),width:e.width-i.left+i.right,height:e.height-i.top+i.bottom})}function calculateShadowExtent(e){var t={top:0,left:0,right:0,bottom:0};return util.each(e,function(e){if(!e.inset){var r=e.spreadRadius+e.blurRadius;t.left=Math.min(e.offsetX-r,t.left),t.right=Math.max(e.offsetX+r,t.right),t.top=Math.min(e.offsetY-r,t.top),t.bottom=Math.max(e.offsetY+r,t.bottom)}}),t}function isEditable(e){return!!e&&(/^(input|textarea)$/i.test(e.tagName)||e.isContentEditable)}function scrollToCaptureAreaInSafari(e,t,r){var i=util.getMainDocumentElem(),o=Math.round(i.scrollHeight),n=Math.round(i.clientHeight),a=o-n;r.scrollTo(e.left,Math.min(t.top,a))}var util=require("./util"),rect=require("./rect"),lib=require("./lib.compat.js"),queryIgnoreAreas=require("./ignore-areas"),Rect=rect.Rect;"undefined"==typeof window?global.__geminiCore=exports:window.__geminiCore=exports,exports.queryFirst=lib.queryFirst,exports.prepareScreenshot=function(e,t){t=t||{};try{return prepareScreenshotUnsafe(e,t)}catch(r){return{error:"JS",message:r.stack||r.message}}},exports.disableFrameAnimations=function(){try{return disableFrameAnimationsUnsafe()}catch(e){return{error:"JS",message:e.stack||e.message}}},exports.cleanupFrameAnimations=function(){window.__cleanupAnimation&&window.__cleanupAnimation()},exports.resetZoom=function(){var e=lib.queryFirst('meta[name="viewport"]');if(!e){e=document.createElement("meta"),e.name="viewport";var t=lib.queryFirst("head");t&&t.appendChild(e)}e.content="width=device-width,initial-scale=1.0,user-scalable=no"};
8
8
  }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
9
9
  },{"./ignore-areas":2,"./lib.compat.js":4,"./rect":7,"./util":8}],4:[function(require,module,exports){
10
10
  "use strict";var Sizzle=require("sizzle"),xpath=require("./xpath");exports.queryFirst=function(e){if(xpath.isXpathSelector(e))return xpath.queryFirst(e);var t=Sizzle(exports.trim(e)+":first");return t.length>0?t[0]:null},exports.queryAll=function(e){return xpath.isXpathSelector(e)?xpath.queryAll(e):Sizzle(e)},exports.trim=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},exports.getComputedStyle=require("./polyfills/getComputedStyle").getComputedStyle,exports.matchMedia=require("./polyfills/matchMedia").matchMedia;
@@ -2,7 +2,7 @@
2
2
  "use strict";var lib=require("./lib.native.js");module.exports=function(e){return lib.queryAll(e)};
3
3
  },{"./lib.native.js":3}],2:[function(require,module,exports){
4
4
  (function (global){(function (){
5
- "use strict";function prepareScreenshotUnsafe(e,t){var r=t.allowViewportOverflow,i=t.captureElementFromTop,o=t.disableAnimation,n=window;if(t.selectorToScroll&&!(n=document.querySelector(t.selectorToScroll)))return{error:"NOTFOUND",message:'Could not find element with css selector specified in "selectorToScroll" option: '+t.selectorToScroll,selector:t.selectorToScroll};var a,l=util.getMainDocumentElem(),c=l.clientWidth,s=l.clientHeight,u=l.scrollWidth,d=l.scrollHeight,p=new Rect({left:util.getScrollLeft(n),top:util.getScrollTop(n),width:c,height:s}),f=configurePixelRatio(t.usePixelRatio),m=[];if(e.forEach(function(e){Rect.isRect(e)?a=a?a.merge(new Rect(e)):new Rect(e):m.push(e)}),a=getCaptureRect(m,{initialRect:a,allowViewportOverflow:r,scrollElem:n,viewportWidth:c,documentHeight:d}),a.error)return a;if(i&&!p.rectInside(a))util.isSafariMobile()?scrollToCaptureAreaInSafari(p,a,n):n.scrollTo(a.left,a.top);else if(r&&p.rectIntersects(a))a.overflowsTopBound(p)&&a.recalculateHeight(p),a.overflowsLeftBound(p)&&a.recalculateWidth(p);else if(!i&&!p.rectIntersects(a))return{error:"OUTSIDE_OF_VIEWPORT",message:'Can not capture element, because it is outside of viewport. Try to set "captureElementFromTop=true" to scroll to it before capture.'};return o&&disableFrameAnimationsUnsafe(),{captureArea:a.scale(f).serialize(),ignoreAreas:findIgnoreAreas(t.ignoreSelectors,{scrollElem:n,pixelRatio:f,viewportWidth:c,documentHeight:d}),viewport:new Rect({left:util.getScrollLeft(n),top:util.getScrollTop(n),width:c,height:s}).scale(f).serialize(),documentHeight:Math.ceil(d*f),documentWidth:Math.ceil(u*f),canHaveCaret:isEditable(document.activeElement),pixelRatio:f}}function disableFrameAnimationsUnsafe(){var e=["","::before","::after"].map(function(e){return"*:not(#testplane-q.testplane-w.testplane-e.testplane-r.testplane-t.testplane-y)"+e}).join(", "),t=[];util.forEachRoot(function(r){var i=document.createElement("style");i.innerHTML=e+["{"," animation-delay: 0ms !important;"," animation-duration: 0ms !important;"," animation-timing-function: step-start !important;"," transition-timing-function: step-start !important;"," scroll-behavior: auto !important;"," transition: none !important;","}"].join("\n"),r.appendChild(i),t.push(i)}),window.__cleanupAnimation=function(){for(var e=0;e<t.length;e++)t[e].parentNode.removeChild(t[e]);delete window.__cleanupAnimation}}function getCaptureRect(e,t){for(var r,i,o=t.initialRect,n=0;n<e.length;n++){if(!(r=lib.queryFirst(e[n])))return{error:"NOTFOUND",message:"Could not find element with css selector specified in setCaptureElements: "+e[n],selector:e[n]};i=getElementCaptureRect(r,t),i&&(o=o?o.merge(i):i)}return o?o.round():{error:"HIDDEN",message:"Area with css selector : "+e+" is hidden",selector:e}}function configurePixelRatio(e){return!1===e?1:window.devicePixelRatio?window.devicePixelRatio:window.screen.deviceXDPI/window.screen.logicalXDPI||1}function findIgnoreAreas(e,t){var r=[];return util.each(e,function(e){var i=queryIgnoreAreas(e);util.each(i,function(e){return addIgnoreArea.call(r,e,t)})}),r}function addIgnoreArea(e,t){var r=e&&getElementCaptureRect(e,t);if(r){var i=r.round().scale(t.pixelRatio).serialize();this.push(i)}}function isHidden(e,t){return"none"===e.display||"hidden"===e.visibility||e.opacity<1e-4||t.width<1e-4||t.height<1e-4}function getElementCaptureRect(e,t){var r=[":before",":after"],i=lib.getComputedStyle(e),o=rect.getAbsoluteClientRect(e,t);if(isHidden(i,o))return null;var n=getExtRect(i,o,t.allowViewportOverflow);return util.each(r,function(r){i=lib.getComputedStyle(e,r),n=n.merge(getExtRect(i,o,t.allowViewportOverflow))}),n}function getExtRect(e,t,r){var i=parseBoxShadow(e.boxShadow),o=parseInt(e.outlineWidth,10);return isNaN(o)&&(o=0),adjustRect(t,i,o,r)}function parseBoxShadow(e){e=e||"";var t,r=/[-+]?\d*\.?\d+px/g,i=e.split(","),o=[];return util.each(i,function(e){(t=e.match(r))&&o.push({offsetX:parseFloat(t[0]),offsetY:parseFloat(t[1])||0,blurRadius:parseFloat(t[2])||0,spreadRadius:parseFloat(t[3])||0,inset:-1!==e.indexOf("inset")})}),o}function adjustRect(e,t,r,i){var o=calculateShadowRect(e,t,i),n=calculateOutlineRect(e,r,i);return o.merge(n)}function calculateOutlineRect(e,t,r){var i=e.top-t,o=e.left-t;return new Rect({top:r?i:Math.max(0,i),left:r?o:Math.max(0,o),bottom:e.bottom+t,right:e.right+t})}function calculateShadowRect(e,t,r){var i=calculateShadowExtent(t),o=e.left+i.left,n=e.top+i.top;return new Rect({left:r?o:Math.max(0,o),top:r?n:Math.max(0,n),width:e.width-i.left+i.right,height:e.height-i.top+i.bottom})}function calculateShadowExtent(e){var t={top:0,left:0,right:0,bottom:0};return util.each(e,function(e){if(!e.inset){var r=e.spreadRadius+e.blurRadius;t.left=Math.min(e.offsetX-r,t.left),t.right=Math.max(e.offsetX+r,t.right),t.top=Math.min(e.offsetY-r,t.top),t.bottom=Math.max(e.offsetY+r,t.bottom)}}),t}function isEditable(e){return!!e&&(/^(input|textarea)$/i.test(e.tagName)||e.isContentEditable)}function scrollToCaptureAreaInSafari(e,t,r){var i=util.getMainDocumentElem(),o=Math.round(i.scrollHeight),n=Math.round(i.clientHeight),a=o-n;r.scrollTo(e.left,Math.min(t.top,a))}var util=require("./util"),rect=require("./rect"),lib=require("./lib.native.js"),queryIgnoreAreas=require("./ignore-areas"),Rect=rect.Rect;"undefined"==typeof window?global.__geminiCore=exports:window.__geminiCore=exports,exports.queryFirst=lib.queryFirst,exports.prepareScreenshot=function(e,t){t=t||{};try{return prepareScreenshotUnsafe(e,t)}catch(r){return{error:"JS",message:r.stack||r.message}}},exports.disableFrameAnimations=function(){try{return disableFrameAnimationsUnsafe()}catch(e){return{error:"JS",message:e.stack||e.message}}},exports.cleanupFrameAnimations=function(){window.__cleanupAnimation&&window.__cleanupAnimation()},exports.resetZoom=function(){var e=lib.queryFirst('meta[name="viewport"]');if(!e){e=document.createElement("meta"),e.name="viewport";var t=lib.queryFirst("head");t&&t.appendChild(e)}e.content="width=device-width,initial-scale=1.0,user-scalable=no"};
5
+ "use strict";function prepareScreenshotUnsafe(e,t){var r=t.allowViewportOverflow,i=t.captureElementFromTop,o=t.disableAnimation,n=window;if(t.selectorToScroll&&!(n=document.querySelector(t.selectorToScroll)))return{error:"NOTFOUND",message:'Could not find element with css selector specified in "selectorToScroll" option: '+t.selectorToScroll,selector:t.selectorToScroll};var a,l=util.getMainDocumentElem(),c=l.clientWidth,s=l.clientHeight,u=l.scrollWidth,p=l.scrollHeight,d=new Rect({left:util.getScrollLeft(n),top:util.getScrollTop(n),width:c,height:s}),f=configurePixelRatio(t.usePixelRatio),m=[];if(e.forEach(function(e){Rect.isRect(e)?a=a?a.merge(new Rect(e)):new Rect(e):m.push(e)}),a=getCaptureRect(m,{initialRect:a,allowViewportOverflow:r,scrollElem:n,viewportWidth:c,documentHeight:p}),a.error)return a;if(i&&!d.rectInside(a))util.isSafariMobile()?scrollToCaptureAreaInSafari(d,a,n):n.scrollTo(a.left,a.top);else if(r&&d.rectIntersects(a))a.overflowsTopBound(d)&&a.recalculateHeight(d),a.overflowsLeftBound(d)&&a.recalculateWidth(d);else if(!i&&!r&&!d.rectIntersects(a))return{error:"OUTSIDE_OF_VIEWPORT",message:'Can not capture element, because it is outside of viewport. Try to set "captureElementFromTop=true" to scroll to it before capture or to set "allowViewportOverflow=true" to ignore viewport overflow error.'};return o&&disableFrameAnimationsUnsafe(),{captureArea:a.scale(f).serialize(),ignoreAreas:findIgnoreAreas(t.ignoreSelectors,{scrollElem:n,pixelRatio:f,viewportWidth:c,documentHeight:p}),viewport:new Rect({left:util.getScrollLeft(n),top:util.getScrollTop(n),width:c,height:s}).scale(f).serialize(),documentHeight:Math.ceil(p*f),documentWidth:Math.ceil(u*f),canHaveCaret:isEditable(document.activeElement),pixelRatio:f}}function disableFrameAnimationsUnsafe(){var e=["","::before","::after"].map(function(e){return"*:not(#testplane-q.testplane-w.testplane-e.testplane-r.testplane-t.testplane-y)"+e}).join(", "),t=[];util.forEachRoot(function(r){var i=document.createElement("style");i.innerHTML=e+["{"," animation-delay: 0ms !important;"," animation-duration: 0ms !important;"," animation-timing-function: step-start !important;"," transition-timing-function: step-start !important;"," scroll-behavior: auto !important;"," transition: none !important;","}"].join("\n"),r.appendChild(i),t.push(i)}),window.__cleanupAnimation=function(){for(var e=0;e<t.length;e++)t[e].parentNode.removeChild(t[e]);delete window.__cleanupAnimation}}function getCaptureRect(e,t){for(var r,i,o=t.initialRect,n=0;n<e.length;n++){if(!(r=lib.queryFirst(e[n])))return{error:"NOTFOUND",message:"Could not find element with css selector specified in setCaptureElements: "+e[n],selector:e[n]};i=getElementCaptureRect(r,t),i&&(o=o?o.merge(i):i)}return o?o.round():{error:"HIDDEN",message:"Area with css selector : "+e+" is hidden",selector:e}}function configurePixelRatio(e){return!1===e?1:window.devicePixelRatio?window.devicePixelRatio:window.screen.deviceXDPI/window.screen.logicalXDPI||1}function findIgnoreAreas(e,t){var r=[];return util.each(e,function(e){var i=queryIgnoreAreas(e);util.each(i,function(e){return addIgnoreArea.call(r,e,t)})}),r}function addIgnoreArea(e,t){var r=e&&getElementCaptureRect(e,t);if(r){var i=r.round().scale(t.pixelRatio).serialize();this.push(i)}}function isHidden(e,t){return"none"===e.display||"hidden"===e.visibility||e.opacity<1e-4||t.width<1e-4||t.height<1e-4}function getElementCaptureRect(e,t){var r=[":before",":after"],i=lib.getComputedStyle(e),o=rect.getAbsoluteClientRect(e,t);if(isHidden(i,o))return null;var n=getExtRect(i,o,t.allowViewportOverflow);return util.each(r,function(r){i=lib.getComputedStyle(e,r),n=n.merge(getExtRect(i,o,t.allowViewportOverflow))}),n}function getExtRect(e,t,r){var i=parseBoxShadow(e.boxShadow),o=parseInt(e.outlineWidth,10);return isNaN(o)&&(o=0),adjustRect(t,i,o,r)}function parseBoxShadow(e){e=e||"";var t,r=/[-+]?\d*\.?\d+px/g,i=e.split(","),o=[];return util.each(i,function(e){(t=e.match(r))&&o.push({offsetX:parseFloat(t[0]),offsetY:parseFloat(t[1])||0,blurRadius:parseFloat(t[2])||0,spreadRadius:parseFloat(t[3])||0,inset:-1!==e.indexOf("inset")})}),o}function adjustRect(e,t,r,i){var o=calculateShadowRect(e,t,i),n=calculateOutlineRect(e,r,i);return o.merge(n)}function calculateOutlineRect(e,t,r){var i=e.top-t,o=e.left-t;return new Rect({top:r?i:Math.max(0,i),left:r?o:Math.max(0,o),bottom:e.bottom+t,right:e.right+t})}function calculateShadowRect(e,t,r){var i=calculateShadowExtent(t),o=e.left+i.left,n=e.top+i.top;return new Rect({left:r?o:Math.max(0,o),top:r?n:Math.max(0,n),width:e.width-i.left+i.right,height:e.height-i.top+i.bottom})}function calculateShadowExtent(e){var t={top:0,left:0,right:0,bottom:0};return util.each(e,function(e){if(!e.inset){var r=e.spreadRadius+e.blurRadius;t.left=Math.min(e.offsetX-r,t.left),t.right=Math.max(e.offsetX+r,t.right),t.top=Math.min(e.offsetY-r,t.top),t.bottom=Math.max(e.offsetY+r,t.bottom)}}),t}function isEditable(e){return!!e&&(/^(input|textarea)$/i.test(e.tagName)||e.isContentEditable)}function scrollToCaptureAreaInSafari(e,t,r){var i=util.getMainDocumentElem(),o=Math.round(i.scrollHeight),n=Math.round(i.clientHeight),a=o-n;r.scrollTo(e.left,Math.min(t.top,a))}var util=require("./util"),rect=require("./rect"),lib=require("./lib.native.js"),queryIgnoreAreas=require("./ignore-areas"),Rect=rect.Rect;"undefined"==typeof window?global.__geminiCore=exports:window.__geminiCore=exports,exports.queryFirst=lib.queryFirst,exports.prepareScreenshot=function(e,t){t=t||{};try{return prepareScreenshotUnsafe(e,t)}catch(r){return{error:"JS",message:r.stack||r.message}}},exports.disableFrameAnimations=function(){try{return disableFrameAnimationsUnsafe()}catch(e){return{error:"JS",message:e.stack||e.message}}},exports.cleanupFrameAnimations=function(){window.__cleanupAnimation&&window.__cleanupAnimation()},exports.resetZoom=function(){var e=lib.queryFirst('meta[name="viewport"]');if(!e){e=document.createElement("meta"),e.name="viewport";var t=lib.queryFirst("head");t&&t.appendChild(e)}e.content="width=device-width,initial-scale=1.0,user-scalable=no"};
6
6
  }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
7
7
  },{"./ignore-areas":1,"./lib.native.js":3,"./rect":4,"./util":5}],3:[function(require,module,exports){
8
8
  "use strict";var xpath=require("./xpath");exports.queryFirst=function(t){return xpath.isXpathSelector(t)?xpath.queryFirst(t):document.querySelector(t)},exports.queryAll=function(t){return xpath.isXpathSelector(t)?xpath.queryAll(t):document.querySelectorAll(t)},exports.getComputedStyle=function(t,e){return getComputedStyle(t,e)},exports.matchMedia=function(t){return matchMedia(t)},exports.trim=function(t){return t.trim()};
@@ -112,12 +112,13 @@ function prepareScreenshotUnsafe(areas, opts) {
112
112
  } else if (allowViewportOverflow && viewPort.rectIntersects(rect)) {
113
113
  rect.overflowsTopBound(viewPort) && rect.recalculateHeight(viewPort);
114
114
  rect.overflowsLeftBound(viewPort) && rect.recalculateWidth(viewPort);
115
- } else if (!captureElementFromTop && !viewPort.rectIntersects(rect)) {
115
+ } else if (!captureElementFromTop && !allowViewportOverflow && !viewPort.rectIntersects(rect)) {
116
116
  return {
117
117
  error: "OUTSIDE_OF_VIEWPORT",
118
118
  message:
119
119
  "Can not capture element, because it is outside of viewport. " +
120
- 'Try to set "captureElementFromTop=true" to scroll to it before capture.'
120
+ 'Try to set "captureElementFromTop=true" to scroll to it before capture' +
121
+ ' or to set "allowViewportOverflow=true" to ignore viewport overflow error.'
121
122
  };
122
123
  }
123
124
 
@@ -128,7 +128,7 @@ module.exports.default = browser => {
128
128
  return assertView(state, selectors, opts);
129
129
  };
130
130
  const assertViewByViewport = async (state, opts) => {
131
- opts = _.defaults(opts, {
131
+ opts = Object.assign(opts, {
132
132
  allowViewportOverflow: true,
133
133
  compositeImage: false,
134
134
  captureElementFromTop: false,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/browser/commands/assert-view/index.js"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,MAAM,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAC/B,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAC7B,MAAM,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC5B,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AACpC,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E,UAAU,EAAE,oBAAoB,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE;YACrE,MAAM,IAAI,KAAK,CACX,aAAa,IAAI,CAAC,QAAQ,+BAA+B,IAAI,CAAC,OAAO,CAAC,cAAc,KAAK,CAC5F,CAAC;QACN,CAAC,CAAC,CAAC;QAEH,OAAO,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IAClD,CAAC,EACD,IAAI,CACP,CAAC;AACN,CAAC,CAAC"}
@@ -1,85 +1,5 @@
1
- import { AssertViewOptsConfig } from "../../config/types";
1
+ import { AssertViewOpts } from "../../config/types";
2
2
  import { ChainablePromiseElement } from "webdriverio";
3
- export interface AssertViewOpts extends Partial<AssertViewOptsConfig> {
4
- /**
5
- * Maximum allowed difference between colors.
6
- * Overrides config {@link https://github.com/gemini-testing/testplane#browsers browsers}.{@link https://github.com/gemini-testing/testplane#tolerance tolerance} value.
7
- *
8
- * @remarks
9
- * Indicates maximum allowed CIEDE2000 difference between colors. Used only in non-strict mode.
10
- * Increasing global default is not recommended, prefer changing tolerance for particular suites or states instead.
11
- * By default it's 2.3 which should be enough for the most cases.
12
- *
13
- * @defaultValue `2.3`
14
- */
15
- tolerance?: number;
16
- /**
17
- * Minimum difference in brightness (zero by default) between the darkest/lightest pixel (which is adjacent to the antialiasing pixel) and theirs adjacent pixels.
18
- * Overrides config {@link https://github.com/gemini-testing/testplane#browsers browsers}.{@link https://github.com/gemini-testing/testplane#antialiasingTolerance antialiasingTolerance} value.
19
- *
20
- * @remarks
21
- * Read more about this option in {@link https://github.com/gemini-testing/looks-same#comparing-images-with-ignoring-antialiasing looks-same}
22
- *
23
- * @defaultValue `4`
24
- */
25
- antialiasingTolerance?: number;
26
- /**
27
- * Allows testing of regions which bottom bounds are outside of a viewport height.
28
- * Overrides config {@link https://github.com/gemini-testing/testplane#browsers browsers}.{@link https://github.com/gemini-testing/testplane#compositeImage compositeImage} value.
29
- *
30
- * @remarks
31
- * In the resulting screenshot the area which fits the viewport bounds will be joined with the area which is outside of the viewport height.
32
- *
33
- * @defaultValue `true`
34
- */
35
- compositeImage?: boolean;
36
- /**
37
- * Allows to specify a delay (in milliseconds) before making any screenshot.
38
- * Overrides config {@link https://github.com/gemini-testing/testplane#browsers browsers}.{@link https://github.com/gemini-testing/testplane#screenshotDelay screenshotDelay} value.
39
- *
40
- * @remarks
41
- * This is useful when the page has elements which are animated or if you do not want to screen a scrollbar.
42
- *
43
- * @defaultValue `0`
44
- */
45
- screenshotDelay?: number;
46
- /**
47
- * Ability to set DOM-node selector which should be scroll when the captured element does not completely fit on the screen.
48
- *
49
- * @remarks
50
- * Useful when you capture the modal (popup). In this case a duplicate of the modal appears on the screenshot.
51
- * That happens because we scroll the page using `window` selector, which scroll only the background of the modal, and the modal itself remains in place.
52
- * Default value is `undefined` (it means scroll relative to `window`). Works only when `compositeImage` is `true` (default).
53
- *
54
- * @defaultValue `undefined`
55
- */
56
- selectorToScroll?: string;
57
- /**
58
- * Ability to disable animations and transitions while making a screenshot
59
- *
60
- * @remarks
61
- * Usefull when you capture screenshot of a page, having animations and transitions.
62
- * Iframe animations are only disabled when using webdriver protocol.
63
- *
64
- * @defaultValue `true`
65
- */
66
- disableAnimation?: boolean;
67
- /**
68
- * Ability to ignore a small amount of different pixels to classify screenshots as being "identical"
69
- *
70
- * @example 5
71
- * @example '1.5%'
72
- *
73
- * @remarks
74
- * Useful when you encounter a few pixels difference that cannot be eliminated using the tolerance and antialiasingTolerance settings.
75
- *
76
- * @note
77
- * This should be considered a last resort and only used in small number of cases where necessary.
78
- *
79
- * @defaultValue `0`
80
- */
81
- ignoreDiffPixelCount?: `${number}%` | number;
82
- }
83
3
  export type AssertViewCommandWithSelector = (this: WebdriverIO.Browser, state: string, selectors: string | string[], opts?: AssertViewOpts) => Promise<void>;
84
4
  export type AssertViewCommandWithoutSelector = (this: WebdriverIO.Browser, state: string, opts?: AssertViewOpts) => Promise<void>;
85
5
  export type AssertViewCommand = AssertViewCommandWithSelector & AssertViewCommandWithoutSelector;
@@ -14,13 +14,13 @@ export interface BuildDiffOptsConfig {
14
14
  ignoreAntialiasing: boolean;
15
15
  ignoreCaret: boolean;
16
16
  }
17
- export interface AssertViewOptsConfig {
17
+ export interface AssertViewOpts {
18
18
  /**
19
19
  * DOM-node selectors which will be ignored (painted with a black rectangle) when comparing images.
20
20
  *
21
21
  * @defaultValue `[]`
22
22
  */
23
- ignoreElements: string | Array<string>;
23
+ ignoreElements?: string | Array<string>;
24
24
  /**
25
25
  * Ability to set capture element from the top area or from current position.
26
26
  *
@@ -29,7 +29,7 @@ export interface AssertViewOptsConfig {
29
29
  *
30
30
  * @defaultValue `true`
31
31
  */
32
- captureElementFromTop: boolean;
32
+ captureElementFromTop?: boolean;
33
33
  /**
34
34
  * Disables check that element is outside of the viewport left, top, right or bottom bounds.
35
35
  *
@@ -41,7 +41,85 @@ export interface AssertViewOptsConfig {
41
41
  *
42
42
  * @defaultValue `false`
43
43
  */
44
- allowViewportOverflow: boolean;
44
+ allowViewportOverflow?: boolean;
45
+ /**
46
+ * Maximum allowed difference between colors.
47
+ * Overrides config {@link https://github.com/gemini-testing/testplane#browsers browsers}.{@link https://github.com/gemini-testing/testplane#tolerance tolerance} value.
48
+ *
49
+ * @remarks
50
+ * Indicates maximum allowed CIEDE2000 difference between colors. Used only in non-strict mode.
51
+ * Increasing global default is not recommended, prefer changing tolerance for particular suites or states instead.
52
+ * By default it's 2.3 which should be enough for the most cases.
53
+ *
54
+ * @defaultValue `2.3`
55
+ */
56
+ tolerance?: number;
57
+ /**
58
+ * Minimum difference in brightness (zero by default) between the darkest/lightest pixel (which is adjacent to the antialiasing pixel) and theirs adjacent pixels.
59
+ * Overrides config {@link https://github.com/gemini-testing/testplane#browsers browsers}.{@link https://github.com/gemini-testing/testplane#antialiasingTolerance antialiasingTolerance} value.
60
+ *
61
+ * @remarks
62
+ * Read more about this option in {@link https://github.com/gemini-testing/looks-same#comparing-images-with-ignoring-antialiasing looks-same}
63
+ *
64
+ * @defaultValue `4`
65
+ */
66
+ antialiasingTolerance?: number;
67
+ /**
68
+ * Allows testing of regions which bottom bounds are outside of a viewport height.
69
+ * Overrides config {@link https://github.com/gemini-testing/testplane#browsers browsers}.{@link https://github.com/gemini-testing/testplane#compositeImage compositeImage} value.
70
+ *
71
+ * @remarks
72
+ * In the resulting screenshot the area which fits the viewport bounds will be joined with the area which is outside of the viewport height.
73
+ *
74
+ * @defaultValue `true`
75
+ */
76
+ compositeImage?: boolean;
77
+ /**
78
+ * Allows to specify a delay (in milliseconds) before making any screenshot.
79
+ * Overrides config {@link https://github.com/gemini-testing/testplane#browsers browsers}.{@link https://github.com/gemini-testing/testplane#screenshotDelay screenshotDelay} value.
80
+ *
81
+ * @remarks
82
+ * This is useful when the page has elements which are animated or if you do not want to screen a scrollbar.
83
+ *
84
+ * @defaultValue `0`
85
+ */
86
+ screenshotDelay?: number;
87
+ /**
88
+ * Ability to set DOM-node selector which should be scroll when the captured element does not completely fit on the screen.
89
+ *
90
+ * @remarks
91
+ * Useful when you capture the modal (popup). In this case a duplicate of the modal appears on the screenshot.
92
+ * That happens because we scroll the page using `window` selector, which scroll only the background of the modal, and the modal itself remains in place.
93
+ * Default value is `undefined` (it means scroll relative to `window`). Works only when `compositeImage` is `true` (default).
94
+ *
95
+ * @defaultValue `undefined`
96
+ */
97
+ selectorToScroll?: string;
98
+ /**
99
+ * Ability to disable animations and transitions while making a screenshot
100
+ *
101
+ * @remarks
102
+ * Usefull when you capture screenshot of a page, having animations and transitions.
103
+ * Iframe animations are only disabled when using webdriver protocol.
104
+ *
105
+ * @defaultValue `true`
106
+ */
107
+ disableAnimation?: boolean;
108
+ /**
109
+ * Ability to ignore a small amount of different pixels to classify screenshots as being "identical"
110
+ *
111
+ * @example 5
112
+ * @example '1.5%'
113
+ *
114
+ * @remarks
115
+ * Useful when you encounter a few pixels difference that cannot be eliminated using the tolerance and antialiasingTolerance settings.
116
+ *
117
+ * @note
118
+ * This should be considered a last resort and only used in small number of cases where necessary.
119
+ *
120
+ * @defaultValue `0`
121
+ */
122
+ ignoreDiffPixelCount?: `${number}%` | number;
45
123
  }
46
124
  export interface ExpectOptsConfig {
47
125
  wait: number;
@@ -124,7 +202,7 @@ export interface CommonConfig {
124
202
  antialiasingTolerance: number;
125
203
  compareOpts: CompareOptsConfig;
126
204
  buildDiffOpts: BuildDiffOptsConfig;
127
- assertViewOpts: AssertViewOptsConfig;
205
+ assertViewOpts: AssertViewOpts;
128
206
  expectOpts: ExpectOptsConfig;
129
207
  meta: {
130
208
  [name: string]: unknown;
@@ -5,9 +5,9 @@ import "expect-webdriverio";
5
5
  import { GlobalHelper } from "./types";
6
6
  export { Testplane as default } from "./testplane";
7
7
  export { Key } from "webdriverio";
8
- export type { WdioBrowser, TestResult, Test, Suite, TestError, AssertViewOpts, HermioneCtx, GlobalHelper, TestplaneCtx, TestFunctionCtx, } from "./types";
8
+ export type { WdioBrowser, TestResult, Test, Suite, TestError, HermioneCtx, GlobalHelper, TestplaneCtx, TestFunctionCtx, } from "./types";
9
9
  export type { Config } from "./config";
10
- export type { ConfigInput } from "./config/types";
10
+ export type { ConfigInput, AssertViewOpts } from "./config/types";
11
11
  export type { TestCollection, FormatterTreeSuite, FormatterTreeTest, FormatterTreeMainRunnable, FormatterListTest, } from "./test-collection";
12
12
  export type { StatsResult } from "./stats";
13
13
  import type { TestDefinition, SuiteDefinition, TestHookDefinition } from "./test-reader/test-object/types";
@@ -7,12 +7,13 @@ import WorkersRegistry from "../utils/workers-registry";
7
7
  import PromiseGroup from "./promise-group";
8
8
  import { TestCollection } from "../test-collection";
9
9
  import { Config } from "../config";
10
- import type { runTest } from "../worker";
10
+ import type { runTest, cancel } from "../worker";
11
11
  import type { Stats as RunnerStats } from "../stats";
12
12
  import EventEmitter from "events";
13
13
  import { Test } from "../types";
14
14
  interface WorkerMethods {
15
15
  runTest: typeof runTest;
16
+ cancel: typeof cancel;
16
17
  }
17
18
  export interface Workers extends EventEmitter, WorkerMethods {
18
19
  }
@@ -60,7 +60,7 @@ class MainRunner extends runner_1.Runner {
60
60
  return;
61
61
  }
62
62
  this.workersRegistry.init();
63
- this.workers = this.workersRegistry.register(require.resolve("../worker"), ["runTest"]);
63
+ this.workers = this.workersRegistry.register(require.resolve("../worker"), ["runTest", "cancel"]);
64
64
  this.browserPool = pool.create(this.config, this);
65
65
  }
66
66
  _isRunning() {
@@ -135,6 +135,7 @@ class MainRunner extends runner_1.Runner {
135
135
  this.cancelled = true;
136
136
  this.browserPool?.cancel();
137
137
  this.activeBrowserRunners.forEach(runner => runner.cancel());
138
+ this.workers?.cancel();
138
139
  }
139
140
  registerWorkers(workerFilepath, exportedMethods) {
140
141
  return this.workersRegistry.register(workerFilepath, exportedMethods);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/runner/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAuB;AACvB,6DAA+C;AAC/C,8CAAgC;AAChC,sDAAwC;AACxC,qDAAiD;AACjD,sCAOmB;AACnB,qCAAkC;AAClC,8EAAqD;AACrD,iFAAwD;AACxD,oEAA2C;AAC3C,wDAAoD;AACpD,wDAA0C;AAmB1C,MAAa,UAAW,SAAQ,eAAM;IAWlC,YAAY,MAAc,EAAE,YAA2B;QACnD,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QAExB,IAAI,CAAC,oBAAoB,GAAG,IAAI,GAAG,EAAE,CAAC;QAEtC,IAAI,CAAC,OAAO,GAAG,IAAI,uBAAY,EAAE,CAAC;QAClC,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QAEvB,IAAI,CAAC,eAAe,GAAG,0BAAe,CAAC,MAA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AC;QAED,OAAO,IAAI,CAAC,iBAAiB,CACzB,WAAW,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,EACvD,gBAAC,CAAC,OAAO,CAAC,YAAY,EAAE,WAAW,CAAC,CACvC,CAAC;IACN,CAAC;IAED,MAAM;QACF,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,WAAW,EAAE,MAAM,EAAE,CAAC;QAE3B,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;QAE7D,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC;IAC3B,CAAC;IAED,eAAe,CAAkC,cAAsB,EAAE,eAAkB;QACvF,OAAO,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,cAAc,EAAE,eAAe,CAAuB,CAAC;IAChG,CAAC;CACJ;AAjJD,gCAiJC"}
@@ -19,7 +19,6 @@ export type { Browser as WdioBrowser } from "webdriverio";
19
19
  export type { Test } from "../test-reader/test-object/test";
20
20
  export type { Suite } from "../test-reader/test-object/suite";
21
21
  export type { TestFunctionCtx } from "../test-reader/test-object/types";
22
- export type { AssertViewOpts } from "../browser/commands/types";
23
22
  export interface RootSuite extends Suite {
24
23
  root: true;
25
24
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":";;;AA0GA,IAAY,WAYX;AAZD,WAAY,WAAW;IACnB,yBAAU,CAAA;IACV,yBAAU,CAAA;IACV,0BAAW,CAAA;IACX,6BAAc,CAAA;IACd,+BAAgB,CAAA;IAChB,6BAAc,CAAA;IACd,kCAAmB,CAAA;IACnB,4BAAa,CAAA;IACb,6BAAc,CAAA;IACd,6BAAc,CAAA;IACd,wBAAS,CAAA;AACb,CAAC,EAZW,WAAW,2BAAX,WAAW,QAYtB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":";;;AAwGA,IAAY,WAYX;AAZD,WAAY,WAAW;IACnB,yBAAU,CAAA;IACV,yBAAU,CAAA;IACV,0BAAW,CAAA;IACX,6BAAc,CAAA;IACd,+BAAgB,CAAA;IAChB,6BAAc,CAAA;IACd,kCAAmB,CAAA;IACnB,4BAAa,CAAA;IACb,6BAAc,CAAA;IACd,6BAAc,CAAA;IACd,wBAAS,CAAA;AACb,CAAC,EAZW,WAAW,2BAAX,WAAW,QAYtB"}
@@ -1 +1,2 @@
1
1
  export function runTest(fullTitle: any, options: any): any;
2
+ export function cancel(): any;
@@ -5,4 +5,7 @@ testplaneFacade.init();
5
5
  exports.runTest = (fullTitle, options) => {
6
6
  return testplaneFacade.runTest(fullTitle, options);
7
7
  };
8
+ exports.cancel = () => {
9
+ return testplaneFacade.cancel();
10
+ };
8
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/worker/index.js"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,MAAM,eAAe,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAEtD,MAAM,eAAe,GAAG,eAAe,CAAC,MAAM,EAAE,CAAC;AACjD,eAAe,CAAC,IAAI,EAAE,CAAC;AAEvB,OAAO,CAAC,OAAO,GAAG,CAAC,SAAS,EAAE,OAAO,EAAE,EAAE;IACrC,OAAO,eAAe,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AACvD,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/worker/index.js"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,MAAM,eAAe,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAEtD,MAAM,eAAe,GAAG,eAAe,CAAC,MAAM,EAAE,CAAC;AACjD,eAAe,CAAC,IAAI,EAAE,CAAC;AAEvB,OAAO,CAAC,OAAO,GAAG,CAAC,SAAS,EAAE,OAAO,EAAE,EAAE;IACrC,OAAO,eAAe,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AACvD,CAAC,CAAC;AAEF,OAAO,CAAC,MAAM,GAAG,GAAG,EAAE;IAClB,OAAO,eAAe,CAAC,MAAM,EAAE,CAAC;AACpC,CAAC,CAAC"}
@@ -25,6 +25,9 @@ module.exports = class TestplaneFacade {
25
25
  .then(() => this._testplane.init());
26
26
  return this.promise;
27
27
  }
28
+ cancel() {
29
+ runtime_config_1.default.getInstance().replServer?.close();
30
+ }
28
31
  syncConfig() {
29
32
  this.syncConfig = () => this.promise;
30
33
  this.promise = this.init().then(() => this._syncConfig());
@@ -1 +1 @@
1
- {"version":3,"file":"testplane-facade.js","sourceRoot":"","sources":["../../../src/worker/testplane-facade.ts"],"names":[],"mappings":";;;;;AAAA,2CAAgF;AAChF,8EAAqD;AACrD,kDAA0B;AAC1B,uDAA+B;AAC/B,oEAAiH;AACjH,4CAAgD;AAGhD,IAAA,eAAK,EAAC,oBAAoB,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;AAEzC,MAAM,CAAC,OAAO,GAAG,MAAM,eAAe;IAIlC,MAAM,CAAC,MAAM;QACT,OAAO,IAAI,IAAI,EAAE,CAAC;IACtB,CAAC;IAED;QACI,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;QACjC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;IAC3B,CAAC;IAED,IAAI;QACA,IAAI,CAAC,IAAI,GAAG,GAAkB,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC;QAE9C,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,KAAK,EAAE;aACtB,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC,CAAC;aAChD,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CA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AC;gBACvB,OAAO,EAAE,CAAC;YACd,CAAC,CAAC,CAAC;YAEH,aAAG,CAAC,IAAI,CAAC,qCAAkB,CAAC,CAAC;QACjC,CAAC,CAAC,CAAC;IACP,CAAC;CACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testplane",
3
- "version": "8.20.3",
3
+ "version": "8.20.5",
4
4
  "description": "Tests framework based on mocha and wdio",
5
5
  "main": "build/src/index.js",
6
6
  "files": [