cypress 3.1.2 → 3.1.3
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/lib/exec/spawn.js +11 -2
- package/lib/util.js +1 -16
- package/package.json +1 -2
- package/types/index.d.ts +32 -2
package/lib/exec/spawn.js
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
3
|
var _ = require('lodash');
|
4
|
+
var os = require('os');
|
4
5
|
var cp = require('child_process');
|
5
6
|
var path = require('path');
|
6
7
|
var Promise = require('bluebird');
|
@@ -17,12 +18,16 @@ var _require = require('../errors'),
|
|
17
18
|
var isXlibOrLibudevRe = /^(?:Xlib|libudev)/;
|
18
19
|
var isHighSierraWarningRe = /\*\*\* WARNING/;
|
19
20
|
|
21
|
+
function isPlatform(platform) {
|
22
|
+
return os.platform() === platform;
|
23
|
+
}
|
24
|
+
|
20
25
|
function needsStderrPiped(needsXvfb) {
|
21
|
-
return
|
26
|
+
return isPlatform('darwin') || needsXvfb && isPlatform('linux');
|
22
27
|
}
|
23
28
|
|
24
29
|
function needsEverythingPipedDirectly() {
|
25
|
-
return
|
30
|
+
return isPlatform('win32');
|
26
31
|
}
|
27
32
|
|
28
33
|
function getStdio(needsXvfb) {
|
@@ -75,6 +80,7 @@ module.exports = {
|
|
75
80
|
}
|
76
81
|
|
77
82
|
var overrides = util.getEnvOverrides();
|
83
|
+
var node11WindowsFix = isPlatform('win32');
|
78
84
|
|
79
85
|
debug('spawning Cypress with executable: %s', executable);
|
80
86
|
debug('spawn forcing env overrides %o', overrides);
|
@@ -88,6 +94,9 @@ module.exports = {
|
|
88
94
|
// also figure out whether we should force stdout and stderr into thinking
|
89
95
|
// it is a tty as opposed to a pipe.
|
90
96
|
options.env = _.extend({}, options.env, overrides);
|
97
|
+
if (node11WindowsFix) {
|
98
|
+
options = _.extend({}, options, { windowsHide: false });
|
99
|
+
}
|
91
100
|
|
92
101
|
var child = cp.spawn(executable, args, options);
|
93
102
|
|
package/lib/util.js
CHANGED
@@ -19,7 +19,6 @@ var _isInstalledGlobally = require('is-installed-globally');
|
|
19
19
|
var pkg = require(path.join(__dirname, '..', 'package.json'));
|
20
20
|
var logger = require('./logger');
|
21
21
|
var debug = require('debug')('cypress:cli');
|
22
|
-
var compareVersions = require('compare-versions');
|
23
22
|
|
24
23
|
var getosAsync = Promise.promisify(getos);
|
25
24
|
|
@@ -71,8 +70,7 @@ var util = {
|
|
71
70
|
.mapValues(function (value) {
|
72
71
|
// stringify to 1 or 0
|
73
72
|
return value ? '1' : '0';
|
74
|
-
}).
|
75
|
-
.value();
|
73
|
+
}).value();
|
76
74
|
},
|
77
75
|
getForceTty: function getForceTty() {
|
78
76
|
return {
|
@@ -81,13 +79,6 @@ var util = {
|
|
81
79
|
FORCE_STDERR_TTY: util.isTty(process.stderr.fd)
|
82
80
|
};
|
83
81
|
},
|
84
|
-
getNode11WindowsFix: function getNode11WindowsFix() {
|
85
|
-
if (compareVersions(util.getNodeVersion(), 'v11') >= 0 && util.isPlatform('win32')) {
|
86
|
-
return {
|
87
|
-
windowsHide: false
|
88
|
-
};
|
89
|
-
}
|
90
|
-
},
|
91
82
|
getEnvColors: function getEnvColors() {
|
92
83
|
var sc = util.supportsColor();
|
93
84
|
|
@@ -97,12 +88,6 @@ var util = {
|
|
97
88
|
MOCHA_COLORS: sc ? true : undefined
|
98
89
|
};
|
99
90
|
},
|
100
|
-
getNodeVersion: function getNodeVersion() {
|
101
|
-
return process.version;
|
102
|
-
},
|
103
|
-
isPlatform: function isPlatform(platform) {
|
104
|
-
return os.platform() === platform;
|
105
|
-
},
|
106
91
|
isTty: function isTty(fd) {
|
107
92
|
return tty.isatty(fd);
|
108
93
|
},
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "cypress",
|
3
|
-
"version": "3.1.
|
3
|
+
"version": "3.1.3",
|
4
4
|
"main": "index.js",
|
5
5
|
"bin": {
|
6
6
|
"cypress": "bin/cypress"
|
@@ -38,7 +38,6 @@
|
|
38
38
|
"check-more-types": "2.24.0",
|
39
39
|
"commander": "2.11.0",
|
40
40
|
"common-tags": "1.4.0",
|
41
|
-
"compare-versions": "3.4.0",
|
42
41
|
"debug": "3.1.0",
|
43
42
|
"execa": "0.10.0",
|
44
43
|
"executable": "4.1.1",
|
package/types/index.d.ts
CHANGED
@@ -1514,13 +1514,13 @@ declare namespace Cypress {
|
|
1514
1514
|
*
|
1515
1515
|
* @see https://on.cypress.io/wait
|
1516
1516
|
*/
|
1517
|
-
wait(alias: string, options?: Partial<Loggable & Timeoutable>): Chainable<WaitXHR>
|
1517
|
+
wait(alias: string, options?: Partial<Loggable & Timeoutable & TimeoutableXHR>): Chainable<WaitXHR>
|
1518
1518
|
/**
|
1519
1519
|
* Wait for list of XHR requests to complete.
|
1520
1520
|
*
|
1521
1521
|
* @see https://on.cypress.io/wait
|
1522
1522
|
*/
|
1523
|
-
wait(alias: string[], options?: Partial<Loggable & Timeoutable>): Chainable<WaitXHR[]>
|
1523
|
+
wait(alias: string[], options?: Partial<Loggable & Timeoutable & TimeoutableXHR>): Chainable<WaitXHR[]>
|
1524
1524
|
|
1525
1525
|
/**
|
1526
1526
|
* Get the window object of the page that is currently active.
|
@@ -1568,6 +1568,16 @@ declare namespace Cypress {
|
|
1568
1568
|
* })
|
1569
1569
|
*/
|
1570
1570
|
wrap<E extends Node = HTMLElement>(element: E | JQuery<E>, options?: Partial<Loggable & Timeoutable>): Chainable<JQuery<E>>
|
1571
|
+
/**
|
1572
|
+
* Yield the element passed into `.wrap()` to the next command in the Cypress chain.
|
1573
|
+
*
|
1574
|
+
* @see https://on.cypress.io/wrap
|
1575
|
+
* @example
|
1576
|
+
* cy.wrap(new Promise((resolve, reject) => {
|
1577
|
+
* setTimeout(resolve, 1000);
|
1578
|
+
* }).then(result => {})
|
1579
|
+
*/
|
1580
|
+
wrap<F extends Promise<S>, S>(promise: F, options?: Partial<Loggable & Timeoutable>): Chainable<S>
|
1571
1581
|
/**
|
1572
1582
|
* Yields whatever is passed into `.wrap()` to the next command in the Cypress chain.
|
1573
1583
|
*
|
@@ -1647,6 +1657,26 @@ declare namespace Cypress {
|
|
1647
1657
|
timeout: number
|
1648
1658
|
}
|
1649
1659
|
|
1660
|
+
/**
|
1661
|
+
* Options that control how long the Test Runner waits for an XHR request and response to succeed
|
1662
|
+
*/
|
1663
|
+
interface TimeoutableXHR {
|
1664
|
+
/**
|
1665
|
+
* Time to wait for the request (ms)
|
1666
|
+
*
|
1667
|
+
* @default {@link Timeoutable#timeout}
|
1668
|
+
* @see https://docs.cypress.io/guides/references/configuration.html#Timeouts
|
1669
|
+
*/
|
1670
|
+
requestTimeout: number,
|
1671
|
+
/**
|
1672
|
+
* Time to wait for the response (ms)
|
1673
|
+
*
|
1674
|
+
* @default {@link Timeoutable#timeout}
|
1675
|
+
* @see https://docs.cypress.io/guides/references/configuration.html#Timeouts
|
1676
|
+
*/
|
1677
|
+
responseTimeout: number
|
1678
|
+
}
|
1679
|
+
|
1650
1680
|
/**
|
1651
1681
|
* Options to force an event, skipping Actionability check
|
1652
1682
|
* @see https://docs.cypress.io/guides/core-concepts/interacting-with-elements.html#Actionability
|