Skip to content

tit/cy-giraffe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published