1.6.0 • Published 3 years ago

cy-giraffe v1.6.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

cy-giraffe

Extends the standard set of commands in Cypress

Installation

npm install cy-giraffe

In your cypress/support/commands.js file, add the following:

require('cy.giraffe')

Command List

log

Changes camelCase to snake_case in the second argument of the log command.

Example:

cy
  .log('open file', {fileName: 'main.json'})

Before use cy-giraffe

log_before

After use cy-giraffe

log_after

hide

Hide element.
It is used when you need to hide dynamic content before taking a screenshot.

Example:

<div class="static">static content</div>
<div class="dynamic">dynamic content</div>
<div class="static">static content</div>
cy
  .get('div[class="dynamic"]')
  .should('be.visible')
  .hide()
  .should('not.be.visible')

Before use cy-giraffe

hide_before

After use cy-giraffe

hide_after

innerText

Get .innerText from element. Standard .should('have.text') returns .textContent. Read more:

Example:

<span class="fullName">Homer <span style="display: none;">J. </span>Simpson</span>
cy
  .get('span[class="fullName"]')
  .should('have.text', 'Homer J. Simpson')
  .innerText()
  .should('eq', 'Homer Simpson')

inner_text

1.6.0

3 years ago

1.5.0

3 years ago

1.4.0

3 years ago

1.3.0

3 years ago

1.2.0

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago