testcafe-legacy-api
Advanced tools
Comparing version 3.1.11 to 4.0.0
@@ -5,2 +5,6 @@ 'use strict'; | ||
var _stringify = require('babel-runtime/core-js/json/stringify'); | ||
var _stringify2 = _interopRequireDefault(_stringify); | ||
var _asyncToGenerator2 = require('babel-runtime/helpers/asyncToGenerator'); | ||
@@ -10,6 +14,2 @@ | ||
var _stringify = require('babel-runtime/core-js/json/stringify'); | ||
var _stringify2 = _interopRequireDefault(_stringify); | ||
var _path = require('path'); | ||
@@ -72,43 +72,52 @@ | ||
_getPayloadScript() { | ||
var sharedJs = this.test.fixture.getSharedJs(); | ||
getPayloadScript() { | ||
var _this = this; | ||
return _mustache2.default.render(TEST_RUN_TEMPLATE, { | ||
stepNames: (0, _stringify2.default)(this.test.stepData.names), | ||
testSteps: this.test.stepData.js, | ||
sharedJs: sharedJs, | ||
testRunId: this.id, | ||
browserId: this.browserConnection.id, | ||
browserHeartbeatUrl: this.browserConnection.heartbeatUrl, | ||
browserStatusUrl: this.browserConnection.statusDoneUrl, | ||
takeScreenshots: this.screenshotCapturer.enabled, | ||
takeScreenshotsOnFails: this.opts.takeScreenshotsOnFails, | ||
skipJsErrors: this.opts.skipJsErrors, | ||
nativeDialogsInfo: (0, _stringify2.default)(this.nativeDialogsInfo), | ||
selectorTimeout: this.opts.selectorTimeout | ||
}); | ||
return (0, _asyncToGenerator3.default)(function* () { | ||
var sharedJs = _this.test.fixture.getSharedJs(); | ||
return _mustache2.default.render(TEST_RUN_TEMPLATE, { | ||
stepNames: (0, _stringify2.default)(_this.test.stepData.names), | ||
testSteps: _this.test.stepData.js, | ||
sharedJs: sharedJs, | ||
testRunId: _this.id, | ||
browserId: _this.browserConnection.id, | ||
browserHeartbeatUrl: _this.browserConnection.heartbeatUrl, | ||
browserStatusUrl: _this.browserConnection.statusDoneUrl, | ||
takeScreenshots: _this.screenshotCapturer.enabled, | ||
takeScreenshotsOnFails: _this.opts.takeScreenshotsOnFails, | ||
skipJsErrors: _this.opts.skipJsErrors, | ||
nativeDialogsInfo: (0, _stringify2.default)(_this.nativeDialogsInfo), | ||
selectorTimeout: _this.opts.selectorTimeout, | ||
canUseDefaultWindowActions: (0, _stringify2.default)((yield _this.browserConnection.canUseDefaultWindowActions())) | ||
}); | ||
})(); | ||
} | ||
_getIframePayloadScript(iframeWithoutSrc) { | ||
var sharedJs = this.test.fixture.getSharedJs(); | ||
var payloadScript = _mustache2.default.render(IFRAME_TEST_RUN_TEMPLATE, { | ||
sharedJs: sharedJs, | ||
takeScreenshotsOnFails: this.opts.takeScreenshotsOnFails, | ||
skipJsErrors: this.opts.skipJsErrors, | ||
nativeDialogsInfo: (0, _stringify2.default)(this.nativeDialogsInfo), | ||
selectorTimeout: this.opts.selectorTimeout | ||
}); | ||
getIframePayloadScript(iframeWithoutSrc) { | ||
var _this2 = this; | ||
return iframeWithoutSrc ? 'var isIFrameWithoutSrc = true;' + payloadScript : payloadScript; | ||
return (0, _asyncToGenerator3.default)(function* () { | ||
var sharedJs = _this2.test.fixture.getSharedJs(); | ||
var payloadScript = _mustache2.default.render(IFRAME_TEST_RUN_TEMPLATE, { | ||
sharedJs: sharedJs, | ||
takeScreenshotsOnFails: _this2.opts.takeScreenshotsOnFails, | ||
skipJsErrors: _this2.opts.skipJsErrors, | ||
nativeDialogsInfo: (0, _stringify2.default)(_this2.nativeDialogsInfo), | ||
selectorTimeout: _this2.opts.selectorTimeout | ||
}); | ||
return iframeWithoutSrc ? 'var isIFrameWithoutSrc = true;' + payloadScript : payloadScript; | ||
})(); | ||
} | ||
_addError(err) { | ||
var _this = this; | ||
var _this3 = this; | ||
return (0, _asyncToGenerator3.default)(function* () { | ||
var screenshotPath = null; | ||
var callsite = err.__sourceIndex !== void 0 && err.__sourceIndex !== null && _this.test.sourceIndex[err.__sourceIndex]; | ||
var callsite = err.__sourceIndex !== void 0 && err.__sourceIndex !== null && _this3.test.sourceIndex[err.__sourceIndex]; | ||
try { | ||
screenshotPath = yield _this.screenshotCapturer.captureError(err); | ||
screenshotPath = yield _this3.screenshotCapturer.captureError(err); | ||
} catch (e) { | ||
@@ -120,3 +129,3 @@ // NOTE: swallow the error silently if we can't take screenshots for some | ||
var errAdapter = new _formattableAdapter2.default(err, { | ||
userAgent: _this.browserConnection.userAgent, | ||
userAgent: _this3.browserConnection.userAgent, | ||
screenshotPath: screenshotPath, | ||
@@ -126,3 +135,3 @@ callsite: callsite | ||
_this.errs.push(errAdapter); | ||
_this3.errs.push(errAdapter); | ||
})(); | ||
@@ -132,7 +141,7 @@ } | ||
_fatalError(err) { | ||
var _this2 = this; | ||
var _this4 = this; | ||
return (0, _asyncToGenerator3.default)(function* () { | ||
yield _this2._addError(err); | ||
_this2.emit('done'); | ||
yield _this4._addError(err); | ||
_this4.emit('done'); | ||
})(); | ||
@@ -159,7 +168,7 @@ } | ||
start() { | ||
var _this3 = this; | ||
var _this5 = this; | ||
return (0, _asyncToGenerator3.default)(function* () { | ||
// NOTE: required to keep API similar to TestRun. Just do nothing here. | ||
_this3.emit('start'); | ||
_this5.emit('start'); | ||
})(); | ||
@@ -166,0 +175,0 @@ } |
{ | ||
"name": "testcafe-legacy-api", | ||
"version": "3.1.11", | ||
"version": "4.0.0", | ||
"description": "Legacy API support for TestCafe", | ||
@@ -27,4 +27,5 @@ "main": "lib/index.js", | ||
"devDependencies": { | ||
"@belym.a.2105/gulp-webmake": "0.0.43", | ||
"babel-core": "^6.11.4", | ||
"babel-eslint": "^4.0.10", | ||
"babel-eslint": "^7.2.3", | ||
"babel-plugin-add-module-exports": "^0.2.1", | ||
@@ -35,15 +36,15 @@ "babel-plugin-transform-runtime": "^6.23.0", | ||
"chai": "^3.4.1", | ||
"del": "^1.2.0", | ||
"del": "^3.0.0", | ||
"eslint-plugin-babel": "^2.2.0", | ||
"gulp": "^3.9.0", | ||
"gulp": "^4.0.0", | ||
"gulp-babel": "^6.1.1", | ||
"gulp-eslint": "^1.1.1", | ||
"gulp-eslint": "^5.0.0", | ||
"gulp-if": "^2.0.1", | ||
"gulp-ll": "^1.0.1", | ||
"gulp-mocha": "^2.2.0", | ||
"gulp-mustache": "^2.2.0", | ||
"gulp-ll-next": "^2.1.0", | ||
"gulp-mocha-simple": "^1.0.0", | ||
"gulp-mustache": "^3.0.1", | ||
"gulp-rename": "^1.2.2", | ||
"gulp-step": "^1.0.1", | ||
"gulp-uglify": "^1.5.4", | ||
"gulp-util": "^3.0.7", | ||
"gulp-webmake": "^0.0.4", | ||
"highlight-es": "^1.0.0", | ||
@@ -53,3 +54,3 @@ "multiline": "^1.0.2", | ||
"read-file-relative": "^1.2.0", | ||
"testcafe-hammerhead": "^9.0.0" | ||
"testcafe-hammerhead": "^17.0.1" | ||
}, | ||
@@ -56,0 +57,0 @@ "dependencies": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
513964
7100
26