@telefonica/acceptance-testing 3.0.0-beta0 → 3.0.0-beta10
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.
- package/dist/acceptance-testing.cjs.development.js +254 -164
- package/dist/acceptance-testing.cjs.development.js.map +1 -1
- package/dist/acceptance-testing.cjs.production.min.js +1 -1
- package/dist/acceptance-testing.cjs.production.min.js.map +1 -1
- package/dist/acceptance-testing.esm.js +254 -164
- package/dist/acceptance-testing.esm.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/docker-compose.yaml +1 -3
- package/jest-puppeteer-config.js +38 -25
- package/package.json +11 -10
|
@@ -462,8 +462,7 @@ var matchPath = function matchPath(spiedPath, currentPath) {
|
|
|
462
462
|
return pattern.test(normalizedCurrentPath);
|
|
463
463
|
};
|
|
464
464
|
|
|
465
|
-
var _excluded = ["
|
|
466
|
-
_excluded2 = ["userAgent", "isDarkMode", "viewport", "cookies"];
|
|
465
|
+
var _excluded = ["userAgent", "isDarkMode", "viewport", "cookies"];
|
|
467
466
|
var _pkg$acceptanceTests, _ref, _projectConfig$covera;
|
|
468
467
|
var LINUX_DOCKER_HOST_IP = '172.17.0.1';
|
|
469
468
|
var getGlobalBrowser = function getGlobalBrowser() {
|
|
@@ -473,7 +472,7 @@ var getGlobalPage$1 = function getGlobalPage() {
|
|
|
473
472
|
return global.page;
|
|
474
473
|
};
|
|
475
474
|
var isCi = /*#__PURE__*/process.argv.includes('--ci') || process.env.CI;
|
|
476
|
-
var isUsingDockerizedChromium = isCi || /*#__PURE__*/new URL( /*#__PURE__*/getGlobalBrowser().wsEndpoint()).port === '9223';
|
|
475
|
+
var isUsingDockerizedChromium = !!isCi || /*#__PURE__*/new URL( /*#__PURE__*/getGlobalBrowser().wsEndpoint()).port === '9223';
|
|
477
476
|
/** Check if running inside WSL */
|
|
478
477
|
var isWsl = function isWsl() {
|
|
479
478
|
if (process.platform !== 'linux') {
|
|
@@ -544,7 +543,7 @@ var toMatchImageSnapshot = /*#__PURE__*/jestImageSnapshot.configureToMatchImageS
|
|
|
544
543
|
failureThresholdType: 'percent',
|
|
545
544
|
customSnapshotIdentifier: function customSnapshotIdentifier(_ref2) {
|
|
546
545
|
var defaultIdentifier = _ref2.defaultIdentifier;
|
|
547
|
-
return defaultIdentifier;
|
|
546
|
+
return defaultIdentifier + '-snap';
|
|
548
547
|
}
|
|
549
548
|
});
|
|
550
549
|
var calledToMatchImageSnapshotOutsideDocker = false;
|
|
@@ -634,18 +633,15 @@ var waitForPaintEnd = /*#__PURE__*/function () {
|
|
|
634
633
|
return _ref3.apply(this, arguments);
|
|
635
634
|
};
|
|
636
635
|
}();
|
|
637
|
-
var normalizeSreenshotOptions = function normalizeSreenshotOptions(
|
|
638
|
-
|
|
639
|
-
_ref5$captureBeyondVi = _ref5.captureBeyondViewport,
|
|
640
|
-
captureBeyondViewport = _ref5$captureBeyondVi === void 0 ? false : _ref5$captureBeyondVi,
|
|
641
|
-
options = _objectWithoutPropertiesLoose(_ref5, _excluded);
|
|
642
|
-
// Puppeter default for captureBeyondViewport is true, but we think false is a better default.
|
|
643
|
-
// When this is true, the fixed elements (like fixed footers) are relative to the original page
|
|
644
|
-
// viewport, not to the full page, so those elements look weird in fullPage screenshots.
|
|
645
|
-
return _extends({}, options, {
|
|
646
|
-
captureBeyondViewport: captureBeyondViewport
|
|
647
|
-
});
|
|
636
|
+
var normalizeSreenshotOptions = function normalizeSreenshotOptions(options) {
|
|
637
|
+
return options;
|
|
648
638
|
};
|
|
639
|
+
// const normalizeSreenshotOptions = ({captureBeyondViewport = false, ...options}: ScreenshotOptions = {}) => {
|
|
640
|
+
// // Puppeter default for captureBeyondViewport is true, but we think false is a better default.
|
|
641
|
+
// // When this is true, the fixed elements (like fixed footers) are relative to the original page
|
|
642
|
+
// // viewport, not to the full page, so those elements look weird in fullPage screenshots.
|
|
643
|
+
// return {...options, captureBeyondViewport};
|
|
644
|
+
// };
|
|
649
645
|
// Puppeteer already calls scrollIntoViewIfNeeded before clicking an element. But it doesn't work in all situations
|
|
650
646
|
// For example, when there is a fixed footer in the page and the element to click is under it, the browser won't scroll
|
|
651
647
|
// because the element is already in the viewport (the ifNeeded part is important here). By forcing the scroll to the
|
|
@@ -658,144 +654,238 @@ var scrollIntoView = function scrollIntoView(el) {
|
|
|
658
654
|
});
|
|
659
655
|
};
|
|
660
656
|
var getPageApi = function getPageApi(page) {
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
657
|
+
return {
|
|
658
|
+
type: function () {
|
|
659
|
+
var _type = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(elementHandle, text, options) {
|
|
660
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
661
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
662
|
+
case 0:
|
|
663
|
+
_context2.next = 2;
|
|
664
|
+
return scrollIntoView(elementHandle);
|
|
665
|
+
case 2:
|
|
666
|
+
return _context2.abrupt("return", elementHandle.type(text, options));
|
|
667
|
+
case 3:
|
|
668
|
+
case "end":
|
|
669
|
+
return _context2.stop();
|
|
670
|
+
}
|
|
671
|
+
}, _callee2);
|
|
672
|
+
}));
|
|
673
|
+
function type(_x3, _x4, _x5) {
|
|
674
|
+
return _type.apply(this, arguments);
|
|
675
|
+
}
|
|
676
|
+
return type;
|
|
677
|
+
}(),
|
|
678
|
+
click: function () {
|
|
679
|
+
var _click = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(elementHandle, options) {
|
|
680
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
681
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
682
|
+
case 0:
|
|
683
|
+
_context3.next = 2;
|
|
684
|
+
return scrollIntoView(elementHandle);
|
|
685
|
+
case 2:
|
|
686
|
+
return _context3.abrupt("return", elementHandle.click(options));
|
|
687
|
+
case 3:
|
|
688
|
+
case "end":
|
|
689
|
+
return _context3.stop();
|
|
690
|
+
}
|
|
691
|
+
}, _callee3);
|
|
692
|
+
}));
|
|
693
|
+
function click(_x6, _x7) {
|
|
694
|
+
return _click.apply(this, arguments);
|
|
695
|
+
}
|
|
696
|
+
return click;
|
|
697
|
+
}(),
|
|
698
|
+
select: function () {
|
|
699
|
+
var _select = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(elementHandle) {
|
|
700
|
+
var _len,
|
|
701
|
+
values,
|
|
702
|
+
_key,
|
|
703
|
+
_args4 = arguments;
|
|
704
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
705
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
706
|
+
case 0:
|
|
707
|
+
_context4.next = 2;
|
|
708
|
+
return scrollIntoView(elementHandle);
|
|
709
|
+
case 2:
|
|
710
|
+
for (_len = _args4.length, values = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
711
|
+
values[_key - 1] = _args4[_key];
|
|
712
|
+
}
|
|
713
|
+
return _context4.abrupt("return", elementHandle.select.apply(elementHandle, values));
|
|
714
|
+
case 4:
|
|
715
|
+
case "end":
|
|
716
|
+
return _context4.stop();
|
|
717
|
+
}
|
|
718
|
+
}, _callee4);
|
|
719
|
+
}));
|
|
720
|
+
function select(_x8) {
|
|
721
|
+
return _select.apply(this, arguments);
|
|
722
|
+
}
|
|
723
|
+
return select;
|
|
724
|
+
}(),
|
|
725
|
+
screenshot: function () {
|
|
726
|
+
var _screenshot = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(options) {
|
|
727
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
728
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
729
|
+
case 0:
|
|
730
|
+
if (options != null && options.skipNetworkWait) {
|
|
731
|
+
_context5.next = 3;
|
|
732
|
+
break;
|
|
733
|
+
}
|
|
732
734
|
_context5.next = 3;
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
return
|
|
772
|
-
}
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
}
|
|
783
|
-
};
|
|
784
|
-
},
|
|
735
|
+
return page.waitForNetworkIdle();
|
|
736
|
+
case 3:
|
|
737
|
+
_context5.next = 5;
|
|
738
|
+
return waitForPaintEnd(page, options);
|
|
739
|
+
case 5:
|
|
740
|
+
return _context5.abrupt("return", page.screenshot(normalizeSreenshotOptions(options)));
|
|
741
|
+
case 6:
|
|
742
|
+
case "end":
|
|
743
|
+
return _context5.stop();
|
|
744
|
+
}
|
|
745
|
+
}, _callee5);
|
|
746
|
+
}));
|
|
747
|
+
function screenshot(_x9) {
|
|
748
|
+
return _screenshot.apply(this, arguments);
|
|
749
|
+
}
|
|
750
|
+
return screenshot;
|
|
751
|
+
}(),
|
|
752
|
+
clear: function () {
|
|
753
|
+
var _clear = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(elementHandle) {
|
|
754
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
755
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
756
|
+
case 0:
|
|
757
|
+
_context6.next = 2;
|
|
758
|
+
return elementHandle.click({
|
|
759
|
+
clickCount: 3
|
|
760
|
+
});
|
|
761
|
+
case 2:
|
|
762
|
+
_context6.next = 4;
|
|
763
|
+
return elementHandle.press('Delete');
|
|
764
|
+
case 4:
|
|
765
|
+
case "end":
|
|
766
|
+
return _context6.stop();
|
|
767
|
+
}
|
|
768
|
+
}, _callee6);
|
|
769
|
+
}));
|
|
770
|
+
function clear(_x10) {
|
|
771
|
+
return _clear.apply(this, arguments);
|
|
772
|
+
}
|
|
773
|
+
return clear;
|
|
774
|
+
}(),
|
|
775
|
+
// For some reason, puppeteer browserContext.overridePermissions doesn't work with newer chrome versions.
|
|
776
|
+
// This workaround polyfills the browser geolocation api to return the mocked position
|
|
777
|
+
setGeolocation: function setGeolocation(position) {
|
|
778
|
+
return page.evaluate(function (position) {
|
|
779
|
+
window.navigator.geolocation.getCurrentPosition = function (callback) {
|
|
780
|
+
// @ts-expect-error - puppeteer's setGeoLocation does not expect a timestamp to be passed
|
|
781
|
+
callback({
|
|
782
|
+
coords: position
|
|
783
|
+
});
|
|
784
|
+
};
|
|
785
|
+
}, position);
|
|
786
|
+
},
|
|
787
|
+
$: page.$.bind(page),
|
|
788
|
+
$$: page.$$.bind(page),
|
|
789
|
+
$$eval: page.$$eval.bind(page),
|
|
790
|
+
$eval: page.$eval.bind(page),
|
|
791
|
+
accessibility: page.accessibility,
|
|
792
|
+
addScriptTag: page.addScriptTag.bind(page),
|
|
793
|
+
addStyleTag: page.addStyleTag.bind(page),
|
|
794
|
+
authenticate: page.authenticate.bind(page),
|
|
795
|
+
bringToFront: page.bringToFront.bind(page),
|
|
796
|
+
browser: page.browser.bind(page),
|
|
797
|
+
browserContext: page.browserContext.bind(page),
|
|
798
|
+
close: page.close.bind(page),
|
|
799
|
+
content: page.content,
|
|
800
|
+
cookies: page.cookies.bind(page),
|
|
801
|
+
coverage: page.coverage,
|
|
802
|
+
createCDPSession: page.createCDPSession.bind(page),
|
|
803
|
+
createPDFStream: page.createPDFStream.bind(page),
|
|
804
|
+
deleteCookie: page.deleteCookie.bind(page),
|
|
805
|
+
emit: page.emit.bind(page),
|
|
806
|
+
emulate: page.emulate.bind(page),
|
|
807
|
+
emulateCPUThrottling: page.emulateCPUThrottling.bind(page),
|
|
808
|
+
emulateIdleState: page.emulateIdleState.bind(page),
|
|
809
|
+
emulateMediaFeatures: page.emulateMediaFeatures.bind(page),
|
|
810
|
+
emulateMediaType: page.emulateMediaType.bind(page),
|
|
811
|
+
emulateNetworkConditions: page.emulateNetworkConditions.bind(page),
|
|
812
|
+
emulateTimezone: page.emulateTimezone.bind(page),
|
|
813
|
+
emulateVisionDeficiency: page.emulateVisionDeficiency.bind(page),
|
|
814
|
+
evaluate: page.evaluate.bind(page),
|
|
815
|
+
evaluateHandle: page.evaluateHandle.bind(page),
|
|
816
|
+
evaluateOnNewDocument: page.evaluateOnNewDocument.bind(page),
|
|
817
|
+
exposeFunction: page.exposeFunction.bind(page),
|
|
818
|
+
focus: page.focus.bind(page),
|
|
819
|
+
frames: page.frames.bind(page),
|
|
820
|
+
getDefaultTimeout: page.getDefaultTimeout.bind(page),
|
|
821
|
+
goBack: page.goBack.bind(page),
|
|
822
|
+
goForward: page.goForward.bind(page),
|
|
823
|
+
"goto": page["goto"].bind(page),
|
|
824
|
+
hover: page.hover.bind(page),
|
|
825
|
+
isClosed: page.isClosed.bind(page),
|
|
826
|
+
isDragInterceptionEnabled: page.isDragInterceptionEnabled.bind(page),
|
|
827
|
+
isJavaScriptEnabled: page.isJavaScriptEnabled.bind(page),
|
|
828
|
+
isServiceWorkerBypassed: page.isServiceWorkerBypassed.bind(page),
|
|
829
|
+
keyboard: page.keyboard,
|
|
830
|
+
listenerCount: page.listenerCount.bind(page),
|
|
831
|
+
locator: page.locator.bind(page),
|
|
832
|
+
mainFrame: page.mainFrame.bind(page),
|
|
833
|
+
metrics: page.metrics.bind(page),
|
|
834
|
+
mouse: page.mouse,
|
|
835
|
+
off: page.off.bind(page),
|
|
836
|
+
on: page.on.bind(page),
|
|
837
|
+
once: page.once.bind(page),
|
|
838
|
+
pdf: page.pdf,
|
|
839
|
+
queryObjects: page.queryObjects.bind(page),
|
|
840
|
+
reload: page.reload.bind(page),
|
|
841
|
+
removeAllListeners: page.removeAllListeners.bind(page),
|
|
842
|
+
removeExposedFunction: page.removeExposedFunction.bind(page),
|
|
843
|
+
removeScriptToEvaluateOnNewDocument: page.removeScriptToEvaluateOnNewDocument.bind(page),
|
|
844
|
+
screencast: page.screencast,
|
|
845
|
+
setBypassCSP: page.setBypassCSP.bind(page),
|
|
846
|
+
setBypassServiceWorker: page.setBypassServiceWorker.bind(page),
|
|
847
|
+
setCacheEnabled: page.setCacheEnabled.bind(page),
|
|
848
|
+
setContent: page.setContent.bind(page),
|
|
849
|
+
setCookie: page.setCookie.bind(page),
|
|
850
|
+
setDefaultNavigationTimeout: page.setDefaultNavigationTimeout.bind(page),
|
|
851
|
+
setDefaultTimeout: page.setDefaultTimeout.bind(page),
|
|
852
|
+
setDragInterception: page.setDragInterception.bind(page),
|
|
853
|
+
setExtraHTTPHeaders: page.setExtraHTTPHeaders.bind(page),
|
|
854
|
+
setJavaScriptEnabled: page.setJavaScriptEnabled.bind(page),
|
|
855
|
+
setOfflineMode: page.setOfflineMode.bind(page),
|
|
856
|
+
setRequestInterception: page.setRequestInterception.bind(page),
|
|
857
|
+
setUserAgent: page.setUserAgent.bind(page),
|
|
858
|
+
setViewport: page.setViewport.bind(page),
|
|
859
|
+
tap: page.tap.bind(page),
|
|
860
|
+
target: page.target.bind(page),
|
|
861
|
+
title: page.title,
|
|
862
|
+
touchscreen: page.touchscreen,
|
|
863
|
+
tracing: page.tracing,
|
|
864
|
+
url: page.url,
|
|
865
|
+
viewport: page.viewport,
|
|
866
|
+
waitForDevicePrompt: page.waitForDevicePrompt.bind(page),
|
|
867
|
+
waitForFileChooser: page.waitForFileChooser.bind(page),
|
|
868
|
+
waitForFrame: page.waitForFrame.bind(page),
|
|
869
|
+
waitForFunction: page.waitForFunction.bind(page),
|
|
870
|
+
waitForNavigation: page.waitForNavigation.bind(page),
|
|
871
|
+
waitForNetworkIdle: page.waitForNetworkIdle.bind(page),
|
|
872
|
+
waitForRequest: page.waitForRequest.bind(page),
|
|
873
|
+
waitForResponse: page.waitForResponse.bind(page),
|
|
874
|
+
waitForSelector: page.waitForSelector.bind(page),
|
|
875
|
+
workers: page.workers
|
|
785
876
|
};
|
|
786
|
-
return api;
|
|
787
877
|
};
|
|
788
878
|
var needsRequestInterception = false;
|
|
789
879
|
var requestHandlers = [];
|
|
790
880
|
var requestInterceptor = function requestInterceptor(req) {
|
|
791
881
|
var _requestHandlers$find;
|
|
792
|
-
var
|
|
793
|
-
var matcher =
|
|
882
|
+
var _ref5 = (_requestHandlers$find = requestHandlers.find(function (_ref6) {
|
|
883
|
+
var matcher = _ref6.matcher;
|
|
794
884
|
return matcher(req);
|
|
795
885
|
})) != null ? _requestHandlers$find : {
|
|
796
886
|
handler: null
|
|
797
887
|
},
|
|
798
|
-
handler =
|
|
888
|
+
handler = _ref5.handler;
|
|
799
889
|
if (!handler) {
|
|
800
890
|
req["continue"]();
|
|
801
891
|
return;
|
|
@@ -812,12 +902,12 @@ var interceptRequest = function interceptRequest(matcher) {
|
|
|
812
902
|
});
|
|
813
903
|
return spy;
|
|
814
904
|
};
|
|
815
|
-
var createApiEndpointMock = function createApiEndpointMock(
|
|
816
|
-
var
|
|
817
|
-
var
|
|
818
|
-
origin =
|
|
819
|
-
baseUrl =
|
|
820
|
-
var originRegExp = globToRegExp((
|
|
905
|
+
var createApiEndpointMock = function createApiEndpointMock(_temp2) {
|
|
906
|
+
var _ref8;
|
|
907
|
+
var _ref7 = _temp2 === void 0 ? {} : _temp2,
|
|
908
|
+
origin = _ref7.origin,
|
|
909
|
+
baseUrl = _ref7.baseUrl;
|
|
910
|
+
var originRegExp = globToRegExp((_ref8 = origin != null ? origin : baseUrl) != null ? _ref8 : '*');
|
|
821
911
|
interceptRequest(function (req) {
|
|
822
912
|
var _URL = new URL(req.url()),
|
|
823
913
|
origin = _URL.origin;
|
|
@@ -865,12 +955,12 @@ var createApiEndpointMock = function createApiEndpointMock(_temp3) {
|
|
|
865
955
|
};
|
|
866
956
|
};
|
|
867
957
|
var openPage = /*#__PURE__*/function () {
|
|
868
|
-
var
|
|
958
|
+
var _ref10 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(_ref9) {
|
|
869
959
|
var userAgent, isDarkMode, viewport, cookies, urlConfig, url, currentUserAgent, page, connectionError;
|
|
870
960
|
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
871
961
|
while (1) switch (_context7.prev = _context7.next) {
|
|
872
962
|
case 0:
|
|
873
|
-
userAgent =
|
|
963
|
+
userAgent = _ref9.userAgent, isDarkMode = _ref9.isDarkMode, viewport = _ref9.viewport, cookies = _ref9.cookies, urlConfig = /*#__PURE__*/_objectWithoutPropertiesLoose(_ref9, _excluded);
|
|
874
964
|
url = function () {
|
|
875
965
|
if (urlConfig.url !== undefined) {
|
|
876
966
|
return urlConfig.url;
|
|
@@ -981,13 +1071,13 @@ var openPage = /*#__PURE__*/function () {
|
|
|
981
1071
|
}, _callee7, null, [[27, 32]]);
|
|
982
1072
|
}));
|
|
983
1073
|
return function openPage(_x11) {
|
|
984
|
-
return
|
|
1074
|
+
return _ref10.apply(this, arguments);
|
|
985
1075
|
};
|
|
986
1076
|
}();
|
|
987
|
-
var buildQueryMethods = function buildQueryMethods(
|
|
988
|
-
var
|
|
989
|
-
page =
|
|
990
|
-
element =
|
|
1077
|
+
var buildQueryMethods = function buildQueryMethods(_temp3) {
|
|
1078
|
+
var _ref11 = _temp3 === void 0 ? {} : _temp3,
|
|
1079
|
+
page = _ref11.page,
|
|
1080
|
+
element = _ref11.element;
|
|
991
1081
|
var boundQueries = {};
|
|
992
1082
|
var _loop = function _loop() {
|
|
993
1083
|
var _Object$entries$_i = _Object$entries[_i],
|
|
@@ -1032,7 +1122,7 @@ var buildQueryMethods = function buildQueryMethods(_temp4) {
|
|
|
1032
1122
|
elementHandle = _context12.sent;
|
|
1033
1123
|
newElementHandle = Object.create(elementHandle);
|
|
1034
1124
|
newElementHandle.screenshot = /*#__PURE__*/function () {
|
|
1035
|
-
var
|
|
1125
|
+
var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(options) {
|
|
1036
1126
|
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
1037
1127
|
while (1) switch (_context8.prev = _context8.next) {
|
|
1038
1128
|
case 0:
|
|
@@ -1056,11 +1146,11 @@ var buildQueryMethods = function buildQueryMethods(_temp4) {
|
|
|
1056
1146
|
}, _callee8);
|
|
1057
1147
|
}));
|
|
1058
1148
|
return function (_x12) {
|
|
1059
|
-
return
|
|
1149
|
+
return _ref13.apply(this, arguments);
|
|
1060
1150
|
};
|
|
1061
1151
|
}();
|
|
1062
1152
|
newElementHandle.click = /*#__PURE__*/function () {
|
|
1063
|
-
var
|
|
1153
|
+
var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(options) {
|
|
1064
1154
|
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
1065
1155
|
while (1) switch (_context9.prev = _context9.next) {
|
|
1066
1156
|
case 0:
|
|
@@ -1075,11 +1165,11 @@ var buildQueryMethods = function buildQueryMethods(_temp4) {
|
|
|
1075
1165
|
}, _callee9);
|
|
1076
1166
|
}));
|
|
1077
1167
|
return function (_x13) {
|
|
1078
|
-
return
|
|
1168
|
+
return _ref14.apply(this, arguments);
|
|
1079
1169
|
};
|
|
1080
1170
|
}();
|
|
1081
1171
|
newElementHandle.type = /*#__PURE__*/function () {
|
|
1082
|
-
var
|
|
1172
|
+
var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(text, options) {
|
|
1083
1173
|
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
1084
1174
|
while (1) switch (_context10.prev = _context10.next) {
|
|
1085
1175
|
case 0:
|
|
@@ -1094,7 +1184,7 @@ var buildQueryMethods = function buildQueryMethods(_temp4) {
|
|
|
1094
1184
|
}, _callee10);
|
|
1095
1185
|
}));
|
|
1096
1186
|
return function (_x14, _x15) {
|
|
1097
|
-
return
|
|
1187
|
+
return _ref15.apply(this, arguments);
|
|
1098
1188
|
};
|
|
1099
1189
|
}();
|
|
1100
1190
|
newElementHandle.select = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
|
|
@@ -1196,7 +1286,7 @@ var prepareFile = function prepareFile(filepath) {
|
|
|
1196
1286
|
var usesDocker = isLocal && isHeadless;
|
|
1197
1287
|
var dockerComposeFile = path.join(__dirname, '..', 'docker-compose.yaml');
|
|
1198
1288
|
if (usesDocker) {
|
|
1199
|
-
var containerId = child_process.execSync("docker
|
|
1289
|
+
var containerId = child_process.execSync("docker compose -f " + dockerComposeFile + " ps -q").toString().trim();
|
|
1200
1290
|
if (!containerId) {
|
|
1201
1291
|
throw Error('acceptance-testing container not found');
|
|
1202
1292
|
}
|
|
@@ -1255,7 +1345,7 @@ var waitForElementToBeRemoved = function waitForElementToBeRemoved(element, time
|
|
|
1255
1345
|
}
|
|
1256
1346
|
var startStack = new Error().stack;
|
|
1257
1347
|
var wait = /*#__PURE__*/function () {
|
|
1258
|
-
var
|
|
1348
|
+
var _ref19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
|
|
1259
1349
|
var t0, box;
|
|
1260
1350
|
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
|
1261
1351
|
while (1) switch (_context15.prev = _context15.next) {
|
|
@@ -1292,7 +1382,7 @@ var waitForElementToBeRemoved = function waitForElementToBeRemoved(element, time
|
|
|
1292
1382
|
}, _callee15);
|
|
1293
1383
|
}));
|
|
1294
1384
|
return function wait() {
|
|
1295
|
-
return
|
|
1385
|
+
return _ref19.apply(this, arguments);
|
|
1296
1386
|
};
|
|
1297
1387
|
}();
|
|
1298
1388
|
return wait()["catch"](function (error) {
|