cypress-example-kitchensink
Advanced tools
Comparing version 1.10.0 to 1.11.0
@@ -17,3 +17,2 @@ /* global hljs, $ */ | ||
$('#action-canvas').on('click', (e) => { | ||
@@ -166,3 +165,2 @@ draw(e) | ||
$('.ls-btn').on('click', (e) => { | ||
@@ -169,0 +167,0 @@ e.preventDefault() |
@@ -62,2 +62,3 @@ /// <reference types="cypress" /> | ||
.find('[type="text"]').type('HALFOFF') | ||
cy.get('.action-form').submit() | ||
@@ -212,2 +213,3 @@ .next().should('contain', 'Your form has been submitted!') | ||
.should('deep.equal', ['fr-apples', 'fr-oranges', 'fr-bananas']) | ||
// assert the selected values include oranges | ||
@@ -264,3 +266,2 @@ cy.get('.action-select-multiple') | ||
it('cy.scrollTo() - scroll the window or element to a position', () => { | ||
// https://on.cypress.io/scrollTo | ||
@@ -267,0 +268,0 @@ |
@@ -29,3 +29,2 @@ /// <reference types="cypress" /> | ||
it('.as() - alias a route for later use', () => { | ||
// Alias the route to wait for its response | ||
@@ -41,4 +40,3 @@ cy.server() | ||
cy.wait('@getComment').its('status').should('eq', 200) | ||
}) | ||
}) |
@@ -30,3 +30,2 @@ /// <reference types="cypress" /> | ||
cy.getCookies().should('have.length', 1).should((cookies) => { | ||
// each cookie has these properties | ||
@@ -33,0 +32,0 @@ expect(cookies[0]).to.have.property('name', 'token') |
@@ -39,3 +39,2 @@ /// <reference types="cypress" /> | ||
context('Cypress.Cookies', () => { | ||
@@ -78,3 +77,2 @@ beforeEach(() => { | ||
context('Cypress.Server', () => { | ||
@@ -193,3 +191,2 @@ beforeEach(() => { | ||
context('Cypress.platform', () => { | ||
@@ -196,0 +193,0 @@ beforeEach(() => { |
@@ -98,2 +98,3 @@ /// <reference types="cypress" /> | ||
}) | ||
cy.fixture('users').should((users) => { | ||
@@ -100,0 +101,0 @@ expect(users[0].name).to.exist |
@@ -61,3 +61,2 @@ /// <reference types="cypress" /> | ||
it('cy.request() - verify response using BDD syntax', () => { | ||
@@ -117,2 +116,3 @@ cy.request('https://jsonplaceholder.cypress.io/comments') | ||
}) | ||
// we don't know the exact post id - only that it will be > 100 | ||
@@ -122,2 +122,3 @@ // since JSONPlaceholder has built-in 100 posts | ||
.and.to.be.gt(100) | ||
// we don't know the user id here - since it was in above closure | ||
@@ -124,0 +125,0 @@ // so in this test just confirm that the property is there |
@@ -95,2 +95,3 @@ /// <reference types="cypress" /> | ||
.should('have.text', '1489449600') | ||
cy.tick(10000) // 10 seconds passed | ||
@@ -190,3 +191,3 @@ cy.get('#tick-div').click() | ||
Cypress.sinon.match.number, | ||
Cypress.sinon.match(isGreaterThan(2), '> 2').and(Cypress.sinon.match(isLessThan(4), '< 4')) | ||
Cypress.sinon.match(isGreaterThan(2), '> 2').and(Cypress.sinon.match(isLessThan(4), '< 4')), | ||
) | ||
@@ -196,3 +197,3 @@ | ||
Cypress.sinon.match.number, | ||
Cypress.sinon.match(isGreaterThan(200), '> 200').or(Cypress.sinon.match(3)) | ||
Cypress.sinon.match(isGreaterThan(200), '> 200').or(Cypress.sinon.match(3)), | ||
) | ||
@@ -202,4 +203,3 @@ | ||
cy.get('@add').should('have.been.calledWith', | ||
Cypress.sinon.match.number, Cypress.sinon.match(3) | ||
) | ||
Cypress.sinon.match.number, Cypress.sinon.match(3)) | ||
@@ -206,0 +206,0 @@ // you can alias matchers for shorter test code |
@@ -30,6 +30,6 @@ /// <reference types="cypress" /> | ||
// https://on.cypress.io/blob | ||
cy.get('.utility-blob').then(($div) => | ||
// https://github.com/nolanlawson/blob-util#imgSrcToDataURL | ||
// get the dataUrl string for the javascript-logo | ||
Cypress.Blob.imgSrcToDataURL('/assets/img/javascript-logo.png', undefined, 'anonymous') | ||
cy.get('.utility-blob').then(($div) => { | ||
// https://github.com/nolanlawson/blob-util#imgSrcToDataURL | ||
// get the dataUrl string for the javascript-logo | ||
return Cypress.Blob.imgSrcToDataURL('/assets/img/javascript-logo.png', undefined, 'anonymous') | ||
.then((dataUrl) => { | ||
@@ -46,3 +46,4 @@ // create an <img> element and set its src to the dataUrl | ||
.should('have.attr', 'src', dataUrl) | ||
})) | ||
}) | ||
}) | ||
}) | ||
@@ -61,2 +62,3 @@ | ||
}) | ||
expect(matching, 'comments').to.be.false | ||
@@ -68,2 +70,3 @@ | ||
}) | ||
expect(matching, 'comments').to.be.true | ||
@@ -76,6 +79,6 @@ | ||
}) | ||
expect(matching, 'comments').to.be.false | ||
}) | ||
it('Cypress.moment() - format or parse dates using a moment method', () => { | ||
@@ -107,3 +110,2 @@ // https://on.cypress.io/moment | ||
it('Cypress.Promise - instantiate a bluebird promise', () => { | ||
@@ -131,11 +133,12 @@ // https://on.cypress.io/promise | ||
cy.then(() => | ||
// return a promise to cy.then() that | ||
// is awaited until it resolves | ||
cy.then(() => { | ||
// return a promise to cy.then() that | ||
// is awaited until it resolves | ||
// @ts-ignore TS7006 | ||
waitOneSecond().then((str) => { | ||
return waitOneSecond().then((str) => { | ||
expect(str).to.eq('foo') | ||
expect(waited).to.be.true | ||
})) | ||
}) | ||
}) | ||
}) | ||
}) |
@@ -33,3 +33,2 @@ /// <reference types="cypress" /> | ||
}) | ||
}) |
{ | ||
"name": "cypress-example-kitchensink", | ||
"version": "1.10.0", | ||
"version": "1.11.0", | ||
"description": "This is an example app used to showcase Cypress.io testing. For a full reference of our documentation, go to https://docs.cypress.io", | ||
@@ -11,3 +11,3 @@ "main": "index.js", | ||
"scripts": { | ||
"build": "npm run lint && npm run types && npm run stop-only", | ||
"build": "npm run lint && npm run types", | ||
"start": "serve --listen ${PORT:-8080}", | ||
@@ -21,3 +21,3 @@ "start:ci": "serve --no-clipboard --listen ${PORT:-8080}", | ||
"print-env": "print-env", | ||
"lint": "eslint --fix cypress/**/*.js app/assets/js/scripts.js", | ||
"lint": "eslint --fix cypress app/assets/js/scripts.js", | ||
"lint:yaml": "yamllint '*.yml' 'basic/*.yml' .buildkite/pipeline.yml .semaphore/semaphore.yml '.github/workflows/*.yml'", | ||
@@ -28,2 +28,3 @@ "colon:names": "colon-names", | ||
"e2e:record": "cypress run --record", | ||
"e2e:record:chrome": "cypress run --record --browser chrome", | ||
"e2e:record:edge": "cypress run --record --browser edge", | ||
@@ -35,2 +36,3 @@ "e2e:record:parallel": "cypress run --record --parallel", | ||
"test:ci:record:windows": "run-p --race start:ci:windows e2e:record", | ||
"test:ci:record:windows:chrome": "run-p --race start:ci:windows e2e:record:chrome", | ||
"test:ci:record:windows:edge": "run-p --race start:ci:windows e2e:record:edge", | ||
@@ -48,4 +50,2 @@ "test:ci:record:parallel": "run-p --race start:ci e2e:record:parallel", | ||
"local:run:record": "start-test 8080 cy:run:record", | ||
"stop-only": "stop-only -f cypress/integration", | ||
"warn-only": "stop-only -f cypress/integration --warn", | ||
"ci:set-port": "node ./scripts/set-port", | ||
@@ -70,15 +70,16 @@ "semantic-release": "semantic-release" | ||
"@bahmutov/print-env": "1.2.0", | ||
"@cypress/eslint-plugin-dev": "5.0.0", | ||
"colon-names": "1.0.0", | ||
"cypress": "4.2.0", | ||
"eslint": "5.16.0", | ||
"cypress": "4.5.0", | ||
"eslint": "7.0.0", | ||
"eslint-plugin-cypress": "2.8.1", | ||
"eslint-plugin-cypress-dev": "2.1.0", | ||
"eslint-plugin-json-format": "2.0.1", | ||
"eslint-plugin-mocha": "5.3.0", | ||
"execa": "2.0.4", | ||
"execa": "2.0.5", | ||
"globby": "9.1.0", | ||
"husky": "1.3.1", | ||
"netlify-plugin-cypress": "1.1.1", | ||
"semantic-release": "15.13.32", | ||
"start-server-and-test": "1.10.6", | ||
"stop-build": "1.1.0", | ||
"stop-only": "3.1.0", | ||
"typescript": "3.7.4", | ||
@@ -92,6 +93,6 @@ "yaml-lint": "1.2.4" | ||
"hooks": { | ||
"pre-commit": "npm run warn-only && npm run lint:yaml", | ||
"pre-push": "npm run stop-only && npm run lint:yaml" | ||
"pre-commit": "npm run lint && npm run lint:yaml", | ||
"pre-push": "npm run lint && npm run lint:yaml" | ||
} | ||
} | ||
} |
@@ -30,3 +30,3 @@ # Kitchen Sink [![renovate-app badge][renovate-badge]][renovate-app] [![semantic-release][semantic-image] ][semantic-url] | ||
Jenkins | | [basic/Jenkinsfile](basic/Jenkinsfile) | [Jenkinsfile](Jenkinsfile) | ||
Netlify | [![Netlify Status](https://api.netlify.com/api/v1/badges/016bd76b-ebfd-4071-94d9-8668afbb56f7/deploy-status)](https://app.netlify.com/sites/admiring-bose-97b8a4/deploys) | [netlify.toml](netlify.toml) | | ||
Netlify | [![Netlify Status](https://api.netlify.com/api/v1/badges/016bd76b-ebfd-4071-94d9-8668afbb56f7/deploy-status)](https://app.netlify.com/sites/cypress-example-kitchensink/deploys) | [netlify.toml](netlify.toml) | | ||
Semaphore v2 | [![Project dashboard](https://cypress-io.semaphoreci.com/badges/cypress-example-kitchensink/branches/master.svg)](https://cypress-io.semaphoreci.com/projects/cypress-example-kitchensink) | [basic/.semaphore.yml](basic/.semaphore.yml) | [.semaphore/semaphore.yml](.semaphore/semaphore.yml) | ||
@@ -33,0 +33,0 @@ Shippable | [![Shippable CI](https://api.shippable.com/projects/56c38fdc1895ca4474743010/badge?branch=master)](https://app.shippable.com/github/cypress-io/cypress-example-kitchensink) | [shippable.yml](shippable.yml) |
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
2291092
3267
17