Socket
Socket
Sign inDemoInstall

cypress-example-kitchensink

Package Overview
Dependencies
Maintainers
2
Versions
82
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cypress-example-kitchensink - npm Package Compare versions

Comparing version 0.4.2 to 0.5.0

app/commands/files.html

65

cypress/integration/example_spec.js

@@ -229,2 +229,8 @@ //

// cy.type() may additionally include key modifiers
.type('{alt}{option}') //these are equivalent
.type('{ctrl}{control}') //these are equivalent
.type('{meta}{command}{cmd}') //these are equivalent
.type('{shift}')
// **** Type Options ****

@@ -240,3 +246,4 @@ //

// (generally due to the app not properly throttling events)
.type('slow.typing@email.com', {delay: 100}).should('have.value', 'slow.typing@email.com')
.type('slow.typing@email.com', {delay: 100})
.should('have.value', 'slow.typing@email.com')

@@ -1043,14 +1050,17 @@ .get('.action-disabled')

context('Fixtures', function(){
context('Files', function(){
beforeEach(function(){
cy.visit('http://localhost:8080/commands/fixtures')
cy.visit('http://localhost:8080/commands/files')
})
// **** Fixtures ****
// **** Files ****
//
// Instead of writing a response inline you can
// connect a response with a fixture file
// located in _fixtures folder.
// Use files to represent data
// or read / write files in your project
it('cy.fixture() - load a fixture', function(){
// Instead of writing a response inline you can
// connect a response with a fixture file
// located in fixtures folder.
cy.server()

@@ -1098,2 +1108,43 @@

it('cy.readFile() - read a files contents', function(){
// You can read a file and returns its contents
// The filePath is relative to your project's root.
cy
// https://on.cypress.io/api/readfile
.readFile('app/commands/actions.html')
.then(function (html) {
expect(html).to.include('<!DOCTYPE html>')
})
})
it('cy.writeFile() - write to a file', function(){
// You can write to a file with the specified contents
// If the path to the file does not exist, the file
// and it's path will be created.
// If the file already exists, it will be over-written.
cy
// Use a response from a request to automatically
// generate a fixture file for use later
.request('https://jsonplaceholder.typicode.com/users').then(function(response){
// https://on.cypress.io/api/writefile
cy.writeFile('cypress/fixtures/users.json', response.body)
})
.fixture('users').then(function(users){
expect(users[0].name).to.exist
})
cy
// JavaScript arrays and objects are stringified and formatted into text.
.writeFile('cypress/fixtures/profile.json', { id: 8739, name: 'Jane', email: 'jane@example.com'})
.fixture('profile').then(function(profile){
expect(profile.name).to.eq('Jane')
})
})
})

@@ -1100,0 +1151,0 @@

4

package.json
{
"name": "cypress-example-kitchensink",
"version": "0.4.2",
"version": "0.5.0",
"description": "This is an example app used to showcase Cypress.io testing. For a full reference of our documentation, go to docs.cypress.io",

@@ -26,4 +26,4 @@ "main": "index.js",

"devDependencies": {
"@cypress/core-releaser": "0.1.6"
"@cypress/core-releaser": "0.1.8"
}
}

@@ -19,3 +19,3 @@ # Kitchen Sink [![Circle CI](https://circleci.com/gh/cypress-io/cypress-example-kitchensink.svg?style=svg)](https://circleci.com/gh/cypress-io/cypress-example-kitchensink) [![Travis CI](https://travis-ci.org/cypress-io/cypress-example-kitchensink.svg?branch=master)](https://travis-ci.org/cypress-io/cypress-example-kitchensink)

- Network Requests
- Fixtures
- Files
- Local Storage

@@ -75,2 +75,9 @@ - Cookies

#### 0.5.0 - *(09/01/16)*
- renamed Fixtures section to Files
- added examples for writeFile
- added example for readFile
- added examples for using modifier keys on cy.type
- fixed some formatting
#### 0.4.2

@@ -77,0 +84,0 @@ - rename commandTimeout -> defaultCommandTimeout

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc