cy-giraffe

1.6.0 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i cy-giraffe

Weekly Downloads

1

Version

1.6.0

License

MIT

Unpacked Size

59 kB

Total Files

21

Last publish

Collaborators

  • titnet