Skip to content

Releases: Lakitna/cypress-commands

Cypress commands 3.0.0

14 Jun 11:58
41e6009
Compare
Choose a tag to compare

Breaking changes

Dropped support for node@10

Cypress 10 supports node@16 or up, to simplify CI we're no longer testing with Node@10. It should
still work, but it's no longer guaranteed.

Dropped support for Cypress@<=9

Cypress 10 introduces a new configuration format. To simplify CI we're no longer testing with
Cypress@9 or lower. It should still work, but it's no longer guaranteed.

If you're not ready to upgrade to Cypress 10 yet, stick to cypress-commands@2.

Changes

Added support for Cypress@10

Cypress 10 introduces breaking changes to the plugin system. None of these breaking changes have
impact on cypress-commands. Changes to ensure support for Cypress@10 are mainly documentation
changes.

Cypress commands 2.0.1

08 Oct 11:20
e35d4f7
Compare
Choose a tag to compare

Fixes

  • Type definition for .attribute() no longer requires you to pass an options object.

Cypress commands 2.0.0

15 Sep 08:04
c1d0cf9
Compare
Choose a tag to compare

Breaking changes

Whitespace handling for zero-width whitespace in .text() and .attribute()

Whitespace handling in .text() and .attribute() has been changed to no longer consider
zero-width whitespace to be whitespace in modes {whitespace: 'simplify'} and
{whitespace: 'keep-newline'}. Mode {whitespace: 'keep'} has not changed.

<div>super\u200Bcalifragilistic\u200Bexpialidocious</div>
// Old situation
cy.get('div').text().should('equal', 'super califragilistic expialidocious');
// New situation
cy.get('div').text().should('equal', 'supercalifragilisticexpialidocious');

When using .text() on elements containing the <wbr> tag: <wbr> is now considered a zero-width
space and will thus be removed with whitespace simplify and keep-newline as described above.

<div>super<wbr>califragilistic<wbr>expialidocious</div>
// Old situation
cy.get('div').text().should('equal', 'super califragilistic expialidocious');
// New situation
cy.get('div').text().should('equal', 'supercalifragilisticexpialidocious');

Output order of .text()

When using .text({ depth: Number }) the order of texts has been changed to better reflect what the
user sees. It will now first traverse all the way to the deepest point, before going sideways. This
will make .text() behave much better with inline styling and links.

<div class="parent">
    parent div top
    <div>
        child div
    </div>
    parent div middle
    <div>
        second-child div
    </div>
    parent div bottom
</div>
// Old situation
// Note how the first part of the string is the various parts of `div.parent`
cy.get('parent')
  .text({ depth: 1 })
  .should('equal', 'parent div top parent div middle parent div bottom child div second-child div');
// New situation
cy.get('div')
  .text({ depth: 1 })
  .should('equal', 'parent div top child div parent div middle second-child div parent div bottom');

Inline text formatting:

<div>
    Text with <b>some</b> styling and <a href="...">a link</a>.
</div>
// Old situation
cy.get('div').text({ depth: 1 }).should('equal', 'Text with styling and . some a link');
// New situation
cy.get('div').text({ depth: 1 }).should('equal', 'Text with some styling and a link.');

Stricter types

Types have been made stricter for .attribute(), text(), and .to(). This is a great improvement
for TypeScript users as it reduces any manual casting. It allows for things like:

cy.get('div')
  .text() // yields type 'string | string[]'
  .to('array') // yields type 'string[]'
  .then((texts: string[]) => ...);
cy.get('div')
  .attribute('class') // yields type 'string | string[]'
  .to('array') // yields type 'string[]'
  .then((texts: string[]) => ...);

Fixes

  • Support for Cypress 8.3.0 and above. There was a change in an internal API used for the
    .attribute() command. This internal API allows us to do some complex stuff with
    {strict: true}. The fix does not impact versions <= 8.2.0. See #60 for details.

  • .attribute() would not work properly in situations where it finds one attribute with a string
    length longer than the number of elements. For example:

    <div data-foo="hello"></div>
    <div></div>
    <div></div>
    cy.get('div').attribute('data-foo'); // Throws error because `hello`.length > $elements.length

    This change also prompted some refactoring.

  • Updated docs based on changed made upstream in the Cypress docs.

  • Added config for Prettier/editorconfig and Eslint rules to match them. Reformatted a lot of files
    because of this.

  • Moved CI from Travis to Github. Now tests on multiple versions of NodeJS and multiple versions of
    Cypress.

  • Updated a lot of dependencies. It was over due.

  • Switched use of path to path-browserify to reduce config overhead for TypeScript users.

Cypress commands 1.1.0

25 Mar 21:37
0bcbdfc
Compare
Choose a tag to compare

Release contains

#41 Update types for then command
#42 Updates for cypress@4

Cypress-commands 1.0.0

16 Jan 20:36
b37397d
Compare
Choose a tag to compare
  • Committed to major version
  • Dependency upgrades

Cypress-commands 0.3.1

17 Oct 21:11
c056725
Compare
Choose a tag to compare

#32 Bugfix for .mjs bundle

Cypress-commands 0.3.0

01 Oct 12:04
df0c1f9
Compare
Choose a tag to compare

#23 Distribute bundle
#29 requestBaseUrl can't be undefined
#25 Generic cast command to
#30 Add whitespace option to attribute command

Cypress-commands 0.1.1

11 Apr 19:45
511d104
Compare
Choose a tag to compare

#11 Fixed some inconsistencies in .text()

Cypress-commands 0.1.0

10 Apr 20:58
01e2a27
Compare
Choose a tag to compare

#4 New command .text()
#9 Type definitions for .then()