---
title: "0.16.2"
url: "https://www.cypress.io/releases/0-16-2"
description: "Features: Added new cy.screenshot() command which can take screenshots on demand. When running cypress run or in CI, Cypress will now automatically take a…"
---

# 0.16.2

ReleasedReleased on June 10, 2016

**Features:**

-   Added new [`cy.screenshot()`](/api/commands/screenshot) command which can take screenshots on demand.
    
-   When running `cypress run` or in CI, Cypress will now automatically take a screenshot when a test fails. You can optionally turn this off by setting [`screenshotOnHeadlessFailure`](/app/references/configuration#Screenshots) to `false` in your configuration.
    
-   Added new [`screenshotsFolder`](/app/references/configuration#Screenshots) configuration option with default of `cypress/screenshots`.
    
-   When running in [Circle CI](https://circleci.com/), we automatically export screenshots as artifacts which makes them available directly in their web UI. If you're using Circle CI, you'll be able to see screenshots without doing anything. If you're using [Travis CI](https://travis-ci.org/), you'll need to upload artifacts to an `s3 bucket`. This is a small slice of what is coming to help diagnose and understand errors in CI. Also in `0.17.0` we will automatically scroll the tests and more intelligently and open / close test commands so you can visually see what happened. Currently you may not see the test command's failure in the Command Log due to the view not scrolling.
    
-   Added new [`.each()`](/api/commands/each) command which iterates serially on a collection yielding the iteratee, the index, and the collection. Addresses [#156](https://github.com/cypress-io/cypress/issues/156).
    
-   `cy.route()` can now accept a single function and/or you can pass a function to the `response` property. This allows you to lazily evaluate routing responses. Great for referencing fixtures. Addresses [#152](https://github.com/cypress-io/cypress/issues/152).
    
-   [`cy.contains()`](/api/commands/contains) now accepts a regular expression. Addresses [#158](https://github.com/cypress-io/cypress/issues/158).
    
-   [`.type()`](/api/commands/type) now accepts `{downarrow}` and `{uparrow}`. We do not move the caret but do fire all the proper events. Addresses [#157](https://github.com/cypress-io/cypress/issues/157).
    

**Bugfixes:**

-   [`cy.exec()`](/api/commands/exec) now outputs additional `stderr` and `stdout` information. It additionally will automatically `source` your `$SHELL` which makes GUI apps behave as if they've been launched from your terminal. Fixes [#153](https://github.com/cypress-io/cypress/issues/153) and [#154](https://github.com/cypress-io/cypress/issues/154).
    
-   [`.then()`](/api/commands/then) yielding nested subjects.
    
-   [`cy.contains()`](/api/commands/contains) no longer returns the last element found when siblings both contain the same content. Fixes [#158](https://github.com/cypress-io/cypress/issues/158).
    
-   Cypress no longer errors when you return a raw DOM element. It now correctly wraps this as the new subject.
    

**Misc:**

-   [`cy.contains()`](/api/commands/contains) now provides an even more specific error message when it was scoped to a particular DOM element and contained a selector. Fixes [#160](https://github.com/cypress-io/cypress/issues/160).
    
-   You will now see a very specific error message when we detect that you've mixed up `async` and `sync` code in a [`.then()`](/api/commands/then) callback function. An example would be queuing up a new cypress command but then synchronously returning a different value.