Browse Source

Upgrade cypress

Vova Tkach 5 years ago
parent
commit
b49884443f

+ 2 - 2
support/node_modules/.yarn-integrity

@@ -6,7 +6,7 @@
   "flags": [],
   "linkedModules": [],
   "topLevelPatterns": [
-    "cypress@3.7.0"
+    "cypress@3.8.0"
   ],
   "lockfileEntries": {
     "@cypress/listr-verbose-renderer@0.4.1": "https://registry.yarnpkg.com/@cypress/listr-verbose-renderer/-/listr-verbose-renderer-0.4.1.tgz#a77492f4b11dcc7c446a34b3e28721afd33c642a",
@@ -55,7 +55,7 @@
     "core-util-is@1.0.2": "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7",
     "core-util-is@~1.0.0": "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7",
     "cross-spawn@^6.0.0": "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4",
-    "cypress@3.7.0": "https://registry.yarnpkg.com/cypress/-/cypress-3.7.0.tgz#e2cd71b87b6ce0d4c72c6ea25da1005d75c1f231",
+    "cypress@3.8.0": "https://registry.yarnpkg.com/cypress/-/cypress-3.8.0.tgz#7d4cd08f81f9048ee36760cc9ee3b9014f9e84ab",
     "dashdash@^1.12.0": "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0",
     "date-fns@^1.27.2": "https://registry.yarnpkg.com/date-fns/-/date-fns-1.30.1.tgz#2e71bf0b119153dbb4cc4e88d9ea5acfb50dc05c",
     "debug@2.6.9": "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f",

+ 59 - 47
support/node_modules/cypress/lib/cli.js

@@ -1,9 +1,5 @@
 'use strict';
 
-var _templateObject = _taggedTemplateLiteral(['\n    ', ' Warning: It looks like you\'re passing --spec a space-separated list of files:\n\n    "', '"\n\n    This will work, but it\'s not recommended.\n\n    The most common cause of this warning is using an unescaped glob pattern. If you are\n    trying to pass a glob pattern, escape it using quotes:\n      cypress run --spec "**/*.spec.js"\n\n    If you are trying to pass multiple spec filenames, separate them by commas instead:\n      cypress run --spec spec1,spec2,spec3\n  '], ['\n    ', ' Warning: It looks like you\'re passing --spec a space-separated list of files:\n\n    "', '"\n\n    This will work, but it\'s not recommended.\n\n    The most common cause of this warning is using an unescaped glob pattern. If you are\n    trying to pass a glob pattern, escape it using quotes:\n      cypress run --spec "**/*.spec.js"\n\n    If you are trying to pass multiple spec filenames, separate them by commas instead:\n      cypress run --spec spec1,spec2,spec3\n  ']);
-
-function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
-
 var _ = require('lodash');
 var commander = require('commander');
 
@@ -11,7 +7,7 @@ var _require = require('common-tags'),
     stripIndent = _require.stripIndent;
 
 var logSymbols = require('log-symbols');
-var debug = require('debug')('cypress:cli');
+var debug = require('debug')('cypress:cli:cli');
 var util = require('./util');
 var logger = require('./logger');
 var errors = require('./errors');
@@ -36,67 +32,83 @@ var coerceFalse = function coerceFalse(arg) {
   return arg !== 'false';
 };
 
-var spaceDelimitedSpecsMsg = function spaceDelimitedSpecsMsg(files) {
-  logger.log();
-  logger.warn(stripIndent(_templateObject, logSymbols.warning, files.join(' ')));
+var spaceDelimitedArgsMsg = function spaceDelimitedArgsMsg(flag, args) {
+  var msg = '\n    ' + logSymbols.warning + ' Warning: It looks like you\'re passing --' + flag + ' a space-separated list of arguments:\n\n    "' + args.join(' ') + '"\n\n    This will work, but it\'s not recommended.\n\n    If you are trying to pass multiple arguments, separate them with commas instead:\n      cypress run --' + flag + ' arg1,arg2,arg3\n  ';
+
+  if (flag === 'spec') {
+    msg += '\n    The most common cause of this warning is using an unescaped glob pattern. If you are\n    trying to pass a glob pattern, escape it using quotes:\n      cypress run --spec "**/*.spec.js"\n    ';
+  }
 
   logger.log();
+  logger.warn(stripIndent(msg));
+  logger.log();
 };
 
 var parseVariableOpts = function parseVariableOpts(fnArgs, args) {
   var opts = fnArgs.pop();
 
-  if (fnArgs.length && opts.spec) {
-    // this will capture space-delimited specs after --spec spec1 but before the next option
+  if (fnArgs.length && (opts.spec || opts.tag)) {
+    // this will capture space-delimited args after
+    // flags that could have possible multiple args
+    // but before the next option
+    // --spec spec1 spec2 or --tag foo bar
 
-    var argIndex = _.indexOf(args, '--spec') + 2;
-    var nextOptOffset = _.findIndex(_.slice(args, argIndex), function (arg) {
-      return _.startsWith(arg, '--');
-    });
-    var endIndex = nextOptOffset !== -1 ? argIndex + nextOptOffset : args.length;
+    var multiArgFlags = _.compact([opts.spec ? 'spec' : opts.spec, opts.tag ? 'tag' : opts.tag]);
 
-    var maybeSpecs = _.slice(args, argIndex, endIndex);
-    var extraSpecs = _.intersection(maybeSpecs, fnArgs);
+    _.forEach(multiArgFlags, function (flag) {
+      var argIndex = _.indexOf(args, '--' + flag) + 2;
+      var nextOptOffset = _.findIndex(_.slice(args, argIndex), function (arg) {
+        return _.startsWith(arg, '--');
+      });
+      var endIndex = nextOptOffset !== -1 ? argIndex + nextOptOffset : args.length;
 
-    if (extraSpecs.length) {
-      opts.spec = [opts.spec].concat(extraSpecs);
-      spaceDelimitedSpecsMsg(opts.spec);
-      opts.spec = opts.spec.join(',');
-    }
+      var maybeArgs = _.slice(args, argIndex, endIndex);
+      var extraArgs = _.intersection(maybeArgs, fnArgs);
+
+      if (extraArgs.length) {
+        opts[flag] = [opts[flag]].concat(extraArgs);
+        spaceDelimitedArgsMsg(flag, opts[flag]);
+        opts[flag] = opts[flag].join(',');
+      }
+    });
   }
 
+  debug('variable-length opts parsed %o', { args: args, opts: opts });
+
   return util.parseOpts(opts);
 };
 
 var descriptions = {
-  record: 'records the run. sends test results, screenshots and videos to your Cypress Dashboard.',
-  key: 'your secret Record Key. you can omit this if you set a CYPRESS_RECORD_KEY environment variable.',
-  spec: 'runs a specific spec file. defaults to "all"',
-  reporter: 'runs a specific mocha reporter. pass a path to use a custom reporter. defaults to "spec"',
-  reporterOptions: 'options for the mocha reporter. defaults to "null"',
-  port: 'runs Cypress on a specific port. overrides any value in the configuration file.',
-  env: 'sets environment variables. separate multiple values with a comma. overrides any value in the configuration file or cypress.env.json',
-  config: 'sets configuration values. separate multiple values with a comma. overrides any value in the configuration file.',
-  browserRunMode: 'runs Cypress in the browser with the given name. if a filesystem path is supplied, Cypress will attempt to use the browser at that path.',
   browserOpenMode: 'path to a custom browser to be added to the list of available browsers in Cypress',
-  detached: 'runs Cypress application in detached mode',
-  project: 'path to the project',
-  global: 'force Cypress into global mode as if its globally installed',
+  browserRunMode: 'runs Cypress in the browser with the given name. if a filesystem path is supplied, Cypress will attempt to use the browser at that path.',
+  cacheClear: 'delete all cached binaries',
+  cacheList: 'list cached binary versions',
+  cachePath: 'print the path to the binary cache',
+  ciBuildId: 'the unique identifier for a run on your CI provider. typically a "BUILD_ID" env var. this value is automatically detected for most CI providers',
+  config: 'sets configuration values. separate multiple values with a comma. overrides any value in cypress.json.',
   configFile: 'path to JSON file where configuration values are set. defaults to "cypress.json". pass "false" to disable.',
-  version: 'prints Cypress version',
-  headed: 'displays the Electron browser instead of running headlessly',
+  detached: 'runs Cypress application in detached mode',
   dev: 'runs cypress in development and bypasses binary check',
-  forceInstall: 'force install the Cypress binary',
+  env: 'sets environment variables. separate multiple values with a comma. overrides any value in cypress.json or cypress.env.json',
   exit: 'keep the browser open after tests finish',
-  cachePath: 'print the path to the binary cache',
-  cacheList: 'list cached binary versions',
-  cacheClear: 'delete all cached binaries',
-  group: 'a named group for recorded runs in the Cypress dashboard',
+  forceInstall: 'force install the Cypress binary',
+  global: 'force Cypress into global mode as if its globally installed',
+  group: 'a named group for recorded runs in the Cypress Dashboard',
+  headed: 'displays the browser instead of running headlessly (defaults to true for Chrome-family browsers)',
+  headless: 'hide the browser instead of running headed (defaults to true for Electron)',
+  key: 'your secret Record Key. you can omit this if you set a CYPRESS_RECORD_KEY environment variable.',
   parallel: 'enables concurrent runs and automatic load balancing of specs across multiple machines or processes',
-  ciBuildId: 'the unique identifier for a run on your CI provider. typically a "BUILD_ID" env var. this value is automatically detected for most CI providers'
+  port: 'runs Cypress on a specific port. overrides any value in cypress.json.',
+  project: 'path to the project',
+  record: 'records the run. sends test results, screenshots and videos to your Cypress Dashboard.',
+  reporter: 'runs a specific mocha reporter. pass a path to use a custom reporter. defaults to "spec"',
+  reporterOptions: 'options for the mocha reporter. defaults to "null"',
+  spec: 'runs specific spec file(s). defaults to "all"',
+  tag: 'named tag(s) for recorded runs in the Cypress Dashboard',
+  version: 'prints Cypress version'
 };
 
-var knownCommands = ['version', 'run', 'open', 'install', 'verify', '-v', '--version', 'help', '-h', '--help', 'cache'];
+var knownCommands = ['cache', 'help', '-h', '--help', 'install', 'open', 'run', 'verify', '-v', '--version', 'version'];
 
 var text = function text(description) {
   if (!descriptions[description]) {
@@ -136,7 +148,7 @@ module.exports = {
 
     var program = new commander.Command();
 
-    // bug in commaner not printing name
+    // bug in commander not printing name
     // in usage help docs
     program._name = 'cypress';
 
@@ -148,16 +160,16 @@ module.exports = {
 
     program.option('-v, --version', text('version')).command('version').description(text('version')).action(showVersions);
 
-    program.command('run').usage('[options]').description('Runs Cypress tests from the CLI without the GUI').option('--record [bool]', text('record'), coerceFalse).option('--headed', text('headed')).option('-k, --key <record-key>', text('key')).option('-s, --spec <spec>', text('spec')).option('-r, --reporter <reporter>', text('reporter')).option('-o, --reporter-options <reporter-options>', text('reporterOptions')).option('-p, --port <port>', text('port')).option('-e, --env <env>', text('env')).option('-c, --config <config>', text('config')).option('-C, --config-file <config-file>', text('configFile')).option('-b, --browser <browser-name-or-path>', text('browserRunMode')).option('-P, --project <project-path>', text('project')).option('--parallel', text('parallel')).option('--group <name>', text('group')).option('--ci-build-id <id>', text('ciBuildId')).option('--no-exit', text('exit')).option('--dev', text('dev'), coerceFalse).action(function () {
+    program.command('run').usage('[options]').description('Runs Cypress tests from the CLI without the GUI').option('-b, --browser <browser-name-or-path>', text('browserRunMode')).option('--ci-build-id <id>', text('ciBuildId')).option('-c, --config <config>', text('config')).option('-C, --config-file <config-file>', text('configFile')).option('-e, --env <env>', text('env')).option('--group <name>', text('group')).option('-k, --key <record-key>', text('key')).option('--headed', text('headed')).option('--headless', text('headless')).option('--no-exit', text('exit')).option('--parallel', text('parallel')).option('-p, --port <port>', text('port')).option('-P, --project <project-path>', text('project')).option('--record [bool]', text('record'), coerceFalse).option('-r, --reporter <reporter>', text('reporter')).option('-o, --reporter-options <reporter-options>', text('reporterOptions')).option('-s, --spec <spec>', text('spec')).option('-t, --tag <tag>', text('tag')).option('--dev', text('dev'), coerceFalse).action(function () {
       for (var _len = arguments.length, fnArgs = Array(_len), _key = 0; _key < _len; _key++) {
         fnArgs[_key] = arguments[_key];
       }
 
-      debug('running Cypress');
+      debug('running Cypress with args %o', fnArgs);
       require('./exec/run').start(parseVariableOpts(fnArgs, args)).then(util.exit).catch(util.logErrorExit1);
     });
 
-    program.command('open').usage('[options]').description('Opens Cypress in the interactive GUI.').option('-p, --port <port>', text('port')).option('-e, --env <env>', text('env')).option('-c, --config <config>', text('config')).option('-C, --config-file <config-file>', text('configFile')).option('-d, --detached [bool]', text('detached'), coerceFalse).option('-b, --browser <browser-path>', text('browserOpenMode')).option('-P, --project <project-path>', text('project')).option('--global', text('global')).option('--dev', text('dev'), coerceFalse).action(function (opts) {
+    program.command('open').usage('[options]').description('Opens Cypress in the interactive GUI.').option('-b, --browser <browser-path>', text('browserOpenMode')).option('-c, --config <config>', text('config')).option('-C, --config-file <config-file>', text('configFile')).option('-d, --detached [bool]', text('detached'), coerceFalse).option('-e, --env <env>', text('env')).option('--global', text('global')).option('-p, --port <port>', text('port')).option('-P, --project <project-path>', text('project')).option('--dev', text('dev'), coerceFalse).action(function (opts) {
       debug('opening Cypress');
       require('./exec/open').start(util.parseOpts(opts)).catch(util.logErrorExit1);
     });

+ 7 - 1
support/node_modules/cypress/lib/errors.js

@@ -117,6 +117,11 @@ var versionMismatch = {
   solution: 'Install Cypress and verify app again'
 };
 
+var incompatibleHeadlessFlags = {
+  description: '`--headed` and `--headless` cannot both be passed.',
+  solution: 'Either pass `--headed` or `--headless`, but not both.'
+};
+
 var solutionUnknown = stripIndent(_templateObject12, chalk.blue(docsUrl), chalk.blue(util.issuesUrl));
 var unexpected = {
   description: 'An unexpected error occurred while verifying the Cypress executable.',
@@ -300,6 +305,7 @@ module.exports = {
     removed: removed,
     CYPRESS_RUN_BINARY: CYPRESS_RUN_BINARY,
     smokeTestFailure: smokeTestFailure,
-    childProcessKilled: childProcessKilled
+    childProcessKilled: childProcessKilled,
+    incompatibleHeadlessFlags: incompatibleHeadlessFlags
   }
 };

+ 4 - 4
support/node_modules/cypress/lib/exec/open.js

@@ -15,10 +15,6 @@ module.exports = {
 
     var args = [];
 
-    if (options.env) {
-      args.push('--env', options.env);
-    }
-
     if (options.config) {
       args.push('--config', options.config);
     }
@@ -31,6 +27,10 @@ module.exports = {
       args.push('--browser', options.browser);
     }
 
+    if (options.env) {
+      args.push('--env', options.env);
+    }
+
     if (options.port) {
       args.push('--port', options.port);
     }

+ 75 - 42
support/node_modules/cypress/lib/exec/run.js

@@ -1,29 +1,41 @@
 'use strict';
 
 var _ = require('lodash');
-var debug = require('debug')('cypress:cli');
+var debug = require('debug')('cypress:cli:run');
 
 var util = require('../util');
 var spawn = require('./spawn');
 var verify = require('../tasks/verify');
 
+var _require = require('../errors'),
+    exitWithError = _require.exitWithError,
+    errors = _require.errors;
+
 // maps options collected by the CLI
 // and forms list of CLI arguments to the server
+
+
 var processRunOptions = function processRunOptions() {
   var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
 
-  debug('processing run options');
+  debug('processing run options %o', options);
 
   var args = ['--run-project', options.project];
 
-  //// if key is set use that - else attempt to find it by environment variable
-  if (options.key == null) {
-    debug('--key is not set, looking up environment variable CYPRESS_RECORD_KEY');
-    options.key = util.getEnv('CYPRESS_RECORD_KEY') || util.getEnv('CYPRESS_CI_KEY');
+  if (options.browser) {
+    args.push('--browser', options.browser);
   }
 
-  if (options.env) {
-    args.push('--env', options.env);
+  if (options.ci) {
+    // push to display the deprecation message
+    args.push('--ci');
+
+    // also automatically record
+    args.push('--record', true);
+  }
+
+  if (options.ciBuildId) {
+    args.push('--ci-build-id', options.ciBuildId);
   }
 
   if (options.config) {
@@ -34,70 +46,81 @@ var processRunOptions = function processRunOptions() {
     args.push('--config-file', options.configFile);
   }
 
-  if (options.port) {
-    args.push('--port', options.port);
+  if (options.env) {
+    args.push('--env', options.env);
   }
 
-  // if we have specific spec(s) push that into the args
-  if (options.spec) {
-    args.push('--spec', options.spec);
+  if (options.exit === false) {
+    args.push('--no-exit');
   }
 
-  //// if we have a specific reporter push that into the args
-  if (options.reporter) {
-    args.push('--reporter', options.reporter);
+  if (options.group) {
+    args.push('--group', options.group);
   }
 
-  //// if we have a specific reporter push that into the args
-  if (options.reporterOptions) {
-    args.push('--reporter-options', options.reporterOptions);
+  if (options.headed) {
+    args.push('--headed', options.headed);
   }
 
-  if (options.ci) {
-    //// push to display the deprecation message
-    args.push('--ci');
+  if (options.headless) {
+    if (options.headed) {
+      // throw this error synchronously, it will be caught later on and
+      // the details will be propagated to the promise chain
+      var err = new Error();
 
-    //// also automatically record
-    args.push('--record', true);
+      err.details = errors.incompatibleHeadlessFlags;
+      throw err;
+    }
+
+    args.push('--headed', !options.headless);
+  }
+
+  // if key is set use that - else attempt to find it by environment variable
+  if (options.key == null) {
+    debug('--key is not set, looking up environment variable CYPRESS_RECORD_KEY');
+    options.key = util.getEnv('CYPRESS_RECORD_KEY') || util.getEnv('CYPRESS_CI_KEY');
   }
 
-  //// if we have a key assume we're in record mode
+  // if we have a key assume we're in record mode
   if (options.key) {
     args.push('--key', options.key);
   }
 
-  //// if record is defined and we're not
-  //// already in ci mode, then send it up
-  if (options.record != null && !options.ci) {
-    args.push('--record', options.record);
+  if (options.outputPath) {
+    args.push('--output-path', options.outputPath);
   }
 
   if (options.parallel) {
     args.push('--parallel');
   }
 
-  if (options.group) {
-    args.push('--group', options.group);
+  if (options.port) {
+    args.push('--port', options.port);
   }
 
-  if (options.ciBuildId) {
-    args.push('--ci-build-id', options.ciBuildId);
+  // if record is defined and we're not
+  // already in ci mode, then send it up
+  if (options.record != null && !options.ci) {
+    args.push('--record', options.record);
   }
 
-  if (options.outputPath) {
-    args.push('--output-path', options.outputPath);
+  // if we have a specific reporter push that into the args
+  if (options.reporter) {
+    args.push('--reporter', options.reporter);
   }
 
-  if (options.browser) {
-    args.push('--browser', options.browser);
+  // if we have a specific reporter push that into the args
+  if (options.reporterOptions) {
+    args.push('--reporter-options', options.reporterOptions);
   }
 
-  if (options.headed) {
-    args.push('--headed', options.headed);
+  // if we have specific spec(s) push that into the args
+  if (options.spec) {
+    args.push('--spec', options.spec);
   }
 
-  if (options.exit === false) {
-    args.push('--no-exit');
+  if (options.tag) {
+    args.push('--tag', options.tag);
   }
 
   return args;
@@ -118,7 +141,17 @@ module.exports = {
     });
 
     function run() {
-      var args = processRunOptions(options);
+      var args = void 0;
+
+      try {
+        args = processRunOptions(options);
+      } catch (err) {
+        if (err.details) {
+          return exitWithError(err.details)();
+        }
+
+        throw err;
+      }
 
       debug('run to spawn.start args %j', args);
 

+ 13 - 4
support/node_modules/cypress/lib/exec/spawn.js

@@ -71,10 +71,15 @@ module.exports = {
 
     debug('needs to start own Xvfb?', needsXvfb);
 
-    // always push cwd into the args
+    // 1. Start arguments with "--" so Electron knows these are OUR
+    // arguments and does not try to sanitize them. Otherwise on Windows
+    // an url in one of the arguments crashes it :(
+    // https://github.com/cypress-io/cypress/issues/5466
+
+    // 2. Always push cwd into the args
     // which additionally acts as a signal to the
     // binary that it was invoked through the NPM module
-    args = [].concat(args, '--cwd', process.cwd());
+    args = ['--'].concat(args, '--cwd', process.cwd());
 
     _.defaults(options, {
       dev: false,
@@ -97,6 +102,8 @@ module.exports = {
           // the launch cmd to be 'npm run dev'
           executable = 'node';
           args.unshift(path.resolve(__dirname, '..', '..', '..', 'scripts', 'start.js'));
+
+          debug('in dev mode the args became %o', args);
         }
 
         var onStderrData = overrides.onStderrData,
@@ -106,8 +113,10 @@ module.exports = {
         var electronArgs = _.clone(args);
         var node11WindowsFix = isPlatform('win32');
 
-        if (verify.needsSandbox()) {
-          electronArgs.push('--no-sandbox');
+        if (!options.dev && verify.needsSandbox()) {
+          // this is one of the Electron's command line switches
+          // thus it needs to be before "--" separator
+          electronArgs.unshift('--no-sandbox');
         }
 
         // strip dev out of child process options

+ 67 - 13
support/node_modules/cypress/lib/tasks/unzip.js

@@ -5,7 +5,7 @@ var is = require('check-more-types');
 var cp = require('child_process');
 var os = require('os');
 var yauzl = require('yauzl');
-var debug = require('debug')('cypress:cli');
+var debug = require('debug')('cypress:cli:unzip');
 var extract = require('extract-zip');
 var Promise = require('bluebird');
 var readline = require('readline');
@@ -17,8 +17,11 @@ var _require = require('../errors'),
 var fs = require('../fs');
 var util = require('../util');
 
-// expose this function for simple testing
-var unzip = function unzip(_ref) {
+var unzipTools = {
+  extract: extract
+
+  // expose this function for simple testing
+};var unzip = function unzip(_ref) {
   var zipFilePath = _ref.zipFilePath,
       installDir = _ref.installDir,
       progress = _ref.progress;
@@ -30,14 +33,16 @@ var unzip = function unzip(_ref) {
     throw new Error('Missing zip filename');
   }
 
+  var startTime = Date.now();
+  var yauzlDoneTime = 0;
+
   return fs.ensureDirAsync(installDir).then(function () {
     return new Promise(function (resolve, reject) {
       return yauzl.open(zipFilePath, function (err, zipFile) {
+        yauzlDoneTime = Date.now();
+
         if (err) return reject(err);
 
-        // debug('zipfile.paths:', zipFile)
-        // zipFile.on('entry', debug)
-        // debug(zipFile.readEntry())
         var total = zipFile.entryCount;
 
         debug('zipFile entries count', total);
@@ -65,6 +70,8 @@ var unzip = function unzip(_ref) {
         };
 
         var unzipWithNode = function unzipWithNode() {
+          debug('unzipping with node.js (slow)');
+
           var endFn = function endFn(err) {
             if (err) {
               return reject(err);
@@ -78,15 +85,50 @@ var unzip = function unzip(_ref) {
             onEntry: tick
           };
 
-          return extract(zipFilePath, opts, endFn);
+          return unzipTools.extract(zipFilePath, opts, endFn);
+        };
+
+        var unzipWithUnzipTool = function unzipWithUnzipTool() {
+          debug('unzipping via `unzip`');
+
+          var inflatingRe = /inflating:/;
+
+          var sp = cp.spawn('unzip', ['-o', zipFilePath, '-d', installDir]);
+
+          sp.on('error', unzipWithNode);
+
+          sp.on('close', function (code) {
+            if (code === 0) {
+              percent = 100;
+              notify(percent);
+
+              return resolve();
+            }
+
+            debug('`unzip` failed %o', { code: code });
+
+            return unzipWithNode();
+          });
+
+          sp.stdout.on('data', function (data) {
+            if (inflatingRe.test(data)) {
+              return tick();
+            }
+          });
+
+          sp.stderr.on('data', function (data) {
+            debug('`unzip` stderr %s', data);
+          });
         };
 
-        //# we attempt to first unzip with the native osx
-        //# ditto because its less likely to have problems
-        //# with corruption, symlinks, or icons causing failures
-        //# and can handle resource forks
-        //# http://automatica.com.au/2011/02/unzip-mac-os-x-zip-in-terminal/
+        // we attempt to first unzip with the native osx
+        // ditto because its less likely to have problems
+        // with corruption, symlinks, or icons causing failures
+        // and can handle resource forks
+        // http://automatica.com.au/2011/02/unzip-mac-os-x-zip-in-terminal/
         var unzipWithOsx = function unzipWithOsx() {
+          debug('unzipping via `ditto`');
+
           var copyingFileRe = /^copying file/;
 
           var sp = cp.spawn('ditto', ['-xkV', zipFilePath, installDir]);
@@ -104,6 +146,8 @@ var unzip = function unzip(_ref) {
               return resolve();
             }
 
+            debug('`ditto` failed %o', { code: code });
+
             return unzipWithNode();
           });
 
@@ -120,12 +164,18 @@ var unzip = function unzip(_ref) {
           case 'darwin':
             return unzipWithOsx();
           case 'linux':
+            return unzipWithUnzipTool();
           case 'win32':
             return unzipWithNode();
           default:
             return;
         }
       });
+    }).tap(function () {
+      debug('unzip completed %o', {
+        yauzlMs: yauzlDoneTime - startTime,
+        unzipMs: Date.now() - yauzlDoneTime
+      });
     });
   });
 };
@@ -154,5 +204,9 @@ var start = function start(_ref2) {
 };
 
 module.exports = {
-  start: start
+  start: start,
+  utils: {
+    unzip: unzip,
+    unzipTools: unzipTools
+  }
 };

+ 1 - 1
support/node_modules/cypress/lib/util.js

@@ -181,7 +181,7 @@ var dequote = function dequote(str) {
 };
 
 var parseOpts = function parseOpts(opts) {
-  opts = _.pick(opts, 'project', 'spec', 'reporter', 'reporterOptions', 'path', 'destination', 'port', 'env', 'cypressVersion', 'config', 'record', 'key', 'configFile', 'browser', 'detached', 'headed', 'global', 'dev', 'force', 'exit', 'cachePath', 'cacheList', 'cacheClear', 'parallel', 'group', 'ciBuildId');
+  opts = _.pick(opts, 'browser', 'cachePath', 'cacheList', 'cacheClear', 'ciBuildId', 'config', 'configFile', 'cypressVersion', 'destination', 'detached', 'dev', 'exit', 'env', 'force', 'global', 'group', 'headed', 'headless', 'key', 'path', 'parallel', 'port', 'project', 'reporter', 'reporterOptions', 'record', 'spec', 'tag');
 
   if (opts.exit) {
     opts = _.omit(opts, 'exit');

+ 1 - 1
support/node_modules/cypress/package.json

@@ -1,6 +1,6 @@
 {
   "name": "cypress",
-  "version": "3.7.0",
+  "version": "3.8.0",
   "main": "index.js",
   "scripts": {
     "postinstall": "node index.js --exec install",

+ 5 - 1
support/node_modules/cypress/types/cypress-npm-api.d.ts

@@ -238,9 +238,13 @@ declare module 'cypress' {
      */
     group: string
     /**
-     * Display the Electron browser instead of running headlessly
+     * Display the browser instead of running headlessly
      */
     headed: boolean
+    /**
+     * Hide the browser instead of running headed
+     */
+    headless: boolean
     /**
      * Specify your secret record key
      */

+ 5 - 2
support/node_modules/cypress/types/index.d.ts

@@ -871,6 +871,7 @@ declare namespace Cypress {
      * @see https://on.cypress.io/invoke
      */
     invoke<T extends (...args: any[]) => any, Subject extends T[]>(index: number): Chainable<ReturnType<T>>
+    invoke<T extends (...args: any[]) => any, Subject extends T[]>(options: Loggable, index: number): Chainable<ReturnType<T>>
 
     /**
      * Invoke a function on the previously yielded subject.
@@ -882,6 +883,7 @@ declare namespace Cypress {
      * @see https://on.cypress.io/invoke
      */
     invoke(functionName: keyof Subject, ...args: any[]): Chainable<Subject> // don't have a way to express return types yet
+    invoke(options: Loggable, functionName: keyof Subject, ...args: any[]): Chainable<Subject>
 
     /**
      * Get a property’s value on the previously yielded subject.
@@ -893,14 +895,15 @@ declare namespace Cypress {
      *    // Drill into nested properties by using dot notation
      *    cy.wrap({foo: {bar: {baz: 1}}}).its('foo.bar.baz')
      */
-    its<K extends keyof Subject>(propertyName: K): Chainable<Subject[K]>
+    its<K extends keyof Subject>(propertyName: K, options?: Loggable): Chainable<Subject[K]>
+
     /**
      * Get a value by index from an array yielded from the previous command.
      * @see https://on.cypress.io/its
      * @example
      *    cy.wrap(['a', 'b']).its(1).should('equal', 'b')
      */
-    its<T, Subject extends T[]>(index: number): Chainable<T>
+    its<T, Subject extends T[]>(index: number, options?: Loggable): Chainable<T>
 
     /**
      * Get the last DOM element within a set of DOM elements.

+ 1 - 1
support/package.json

@@ -1,5 +1,5 @@
 {
   "devDependencies": {
-    "cypress": "3.7.0"
+    "cypress": "3.8.0"
   }
 }

+ 4 - 4
support/yarn.lock

@@ -258,10 +258,10 @@ cross-spawn@^6.0.0:
     shebang-command "^1.2.0"
     which "^1.2.9"
 
-cypress@3.7.0:
-  version "3.7.0"
-  resolved "https://registry.yarnpkg.com/cypress/-/cypress-3.7.0.tgz#e2cd71b87b6ce0d4c72c6ea25da1005d75c1f231"
-  integrity sha512-o+vfRxqAba8TduelzfZQ4WHmj2yNEjaoO2EuZ8dZ9pJpuW+WGtBGheKIp6zkoQsp8ZgFe8OoHh1i2mY8BDnMAw==
+cypress@3.8.0:
+  version "3.8.0"
+  resolved "https://registry.yarnpkg.com/cypress/-/cypress-3.8.0.tgz#7d4cd08f81f9048ee36760cc9ee3b9014f9e84ab"
+  integrity sha512-gtEbqCgKETRc3pQFMsELRgIBNgiQg7vbOWTrCi7WE7bgOwNCaW9PEX8Jb3UN8z/maIp9WwzoFfeySfelYY7nRA==
   dependencies:
     "@cypress/listr-verbose-renderer" "0.4.1"
     "@cypress/xvfb" "1.2.4"