Skip to content

feat: add examples for sinon.match#385

Merged
bahmutov merged 9 commits into
masterfrom
add-sinon-match-examples
Mar 18, 2020
Merged

feat: add examples for sinon.match#385
bahmutov merged 9 commits into
masterfrom
add-sinon-match-examples

Conversation

@bahmutov
Copy link
Copy Markdown
Contributor

@bahmutov bahmutov changed the title feat: add examples for sinon.match [WIP] feat: add examples for sinon.match Mar 13, 2020
@cypress
Copy link
Copy Markdown

cypress Bot commented Mar 13, 2020



Test summary

117 0 0 0


Run details

Project cypress-example-kitchensink
Status Passed
Commit f0c7acd
Started Mar 18, 2020 2:50 PM
Ended Mar 18, 2020 2:56 PM
Duration 06:14 💡
OS Windows 10.0.17763
Browser Edge 79

View run in Cypress Dashboard ➡️


This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

@cypress
Copy link
Copy Markdown

cypress Bot commented Mar 13, 2020



Test summary

234 0 0 0


Run details

Project cypress-example-kitchensink
Status Passed
Commit f40da7c ℹ️
Started Mar 18, 2020 2:42 PM
Ended Mar 18, 2020 2:46 PM
Duration 04:24 💡
OS Linux Ubuntu Linux - 16.04
Browser Electron 80

View run in Cypress Dashboard ➡️


This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

@bahmutov
Copy link
Copy Markdown
Contributor Author

@jennifer-shehane take a look at the examples - if they are ok, I will copy them into HTML files and we can land this.

@bahmutov bahmutov requested a review from CypressCecelia March 17, 2020 17:45
Copy link
Copy Markdown

@CypressCecelia CypressCecelia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just had a HelpScout message last week about this, actually.

@bahmutov
Copy link
Copy Markdown
Contributor Author

perfect @CypressCecelia thanks, I will copy the tests to HTML and will merge it

@bahmutov bahmutov changed the title [WIP] feat: add examples for sinon.match feat: add examples for sinon.match Mar 18, 2020
@github-actions
Copy link
Copy Markdown

🌀 Tests overview by Testomatio

Found 117 cypress tests in 19 files

✔️ Added 2 tests

+ Spies, Stubs, and Clock: cy.stub() matches depending on arguments
+ Spies, Stubs, and Clock: matches call arguments using Sinon matchers
📑 List all tests

📝 cypress/integration/examples/actions.spec.js

  • 📎 Actions
    • .type() - type into a DOM element
    • .focus() - focus on a DOM element
    • .blur() - blur off a DOM element
    • .clear() - clears an input or textarea element
    • .submit() - submit a form
    • .click() - click on a DOM element
    • .dblclick() - double click on a DOM element
    • .rightclick() - right click on a DOM element
    • .check() - check a checkbox or radio element
    • .uncheck() - uncheck a checkbox element
    • .select() - select an option in a <select> element
    • .scrollIntoView() - scroll an element into view
    • .trigger() - trigger an event on a DOM element
    • cy.scrollTo() - scroll the window or element to a position

📝 cypress/integration/examples/aliasing.spec.js

  • 📎 Aliasing
    • .as() - alias a DOM element for later use
    • .as() - alias a route for later use

📝 cypress/integration/examples/assertions.spec.js

  • 📎 Assertions
    • 📎 Implicit Assertions
      • .should() - make an assertion about the current subject
      • .and() - chain multiple assertions together
    • 📎 Explicit Assertions
      • expect - make an assertion about a specified subject
      • pass your own callback function to should()
      • finds element by class name regex
      • can throw any error
      • matches unknown text between two elements
      • assert - assert shape of an object
      • retries the should callback until assertions pass

📝 cypress/integration/examples/connectors.spec.js

  • 📎 Connectors
    • .each() - iterate over an array of elements
    • .its() - get properties on the current subject
    • .invoke() - invoke a function on the current subject
    • .spread() - spread an array as individual args to callback function
    • 📎 .then()
      • invokes a callback function with the current subject
      • yields the returned value to the next command
      • yields the original subject without return
      • yields the value yielded by the last Cypress command inside

📝 cypress/integration/examples/cookies.spec.js

  • 📎 Cookies
    • cy.getCookie() - get a browser cookie
    • cy.getCookies() - get browser cookies
    • cy.setCookie() - set a browser cookie
    • cy.clearCookie() - clear a browser cookie
    • cy.clearCookies() - clear browser cookies

📝 cypress/integration/examples/cypress_api.spec.js

  • 📎 Cypress.Commands
    • .add() - create a custom command
  • 📎 Cypress.Cookies
    • .debug() - enable or disable debugging
    • .preserveOnce() - preserve cookies by key
    • .defaults() - set defaults for all cookies
  • 📎 Cypress.Server
    • .defaults() - change default config of server
  • 📎 Cypress.arch
    • Get CPU architecture name of underlying OS
  • 📎 Cypress.config()
    • Get and set configuration options
  • 📎 Cypress.dom
    • .isHidden() - determine if a DOM element is hidden
  • 📎 Cypress.env()
    • Get environment variables
  • 📎 Cypress.log
    • Control what is printed to the Command Log
  • 📎 Cypress.platform
    • Get underlying OS name
  • 📎 Cypress.version
    • Get current version of Cypress being run
  • 📎 Cypress.spec
    • Get current spec information

📝 cypress/integration/examples/files.spec.js

  • 📎 Files
    • cy.fixture() - load a fixture
    • cy.fixture() or require - load a fixture
    • cy.readFile() - read file contents
    • cy.writeFile() - write to a file

📝 cypress/integration/examples/local_storage.spec.js

  • 📎 Local Storage
    • cy.clearLocalStorage() - clear all data in local storage

📝 cypress/integration/examples/location.spec.js

  • 📎 Location
    • cy.hash() - get the current URL hash
    • cy.location() - get window.location
    • cy.url() - get the current URL

📝 cypress/integration/examples/misc.spec.js

  • 📎 Misc
    • .end() - end the command chain
    • cy.exec() - execute a system command
    • cy.focused() - get the DOM element that has focus
    • 📎 Cypress.Screenshot
      • cy.screenshot() - take a screenshot
      • Cypress.Screenshot.defaults() - change default config of screenshots
      • cy.wrap() - wrap an object

📝 cypress/integration/examples/navigation.spec.js

  • 📎 Navigation
    • cy.go() - go back or forward in the browser's history
    • cy.reload() - reload the page
    • cy.visit() - visit a remote url

📝 cypress/integration/examples/network_requests.spec.js

  • 📎 Network Requests
    • cy.server() - control behavior of network requests and responses
    • cy.request() - make an XHR request
    • cy.request() - verify response using BDD syntax
    • cy.request() with query parameters
    • cy.request() - pass result to the second request
    • cy.request() - save response in the shared test context
    • cy.route() - route responses to matching requests

📝 cypress/integration/examples/querying.spec.js

  • 📎 Querying
    • cy.get() - query DOM elements
    • cy.contains() - query DOM elements with matching content
    • .within() - query DOM elements within a specific element
    • cy.root() - query the root DOM element
    • best practices - selecting elements

📝 cypress/integration/examples/spies_stubs_clocks.spec.js

  • 📎 Spies, Stubs, and Clock
    • cy.spy() - wrap a method in a spy
    • cy.spy() retries until assertions pass
    • cy.stub() - create a stub and/or replace a function with stub
    • cy.clock() - control time in the browser
    • cy.tick() - move time in the browser
    • cy.stub() matches depending on arguments
    • matches call arguments using Sinon matchers

📝 cypress/integration/examples/traversal.spec.js

  • 📎 Traversal
    • .children() - get child DOM elements
    • .closest() - get closest ancestor DOM element
    • .eq() - get a DOM element at a specific index
    • .filter() - get DOM elements that match the selector
    • .find() - get descendant DOM elements of the selector
    • .first() - get first DOM element
    • .last() - get last DOM element
    • .next() - get next sibling DOM element
    • .nextAll() - get all next sibling DOM elements
    • .nextUntil() - get next sibling DOM elements until next el
    • .not() - remove DOM elements from set of DOM elements
    • .parent() - get parent DOM element from DOM elements
    • .parents() - get parent DOM elements from DOM elements
    • .parentsUntil() - get parent DOM elements from DOM elements until el
    • .prev() - get previous sibling DOM element
    • .prevAll() - get all previous sibling DOM elements
    • .prevUntil() - get all previous sibling DOM elements until el
    • .siblings() - get all sibling DOM elements

📝 cypress/integration/examples/utilities.spec.js

  • 📎 Utilities
    • Cypress._ - call a lodash method
    • Cypress.$ - call a jQuery method
    • Cypress.Blob - blob utilities and base64 string conversion
    • Cypress.minimatch - test out glob patterns against strings
    • Cypress.moment() - format or parse dates using a moment method
    • Cypress.Promise - instantiate a bluebird promise

📝 cypress/integration/examples/viewport.spec.js

  • 📎 Viewport
    • cy.viewport() - set the viewport size and dimension

📝 cypress/integration/examples/waiting.spec.js

  • 📎 Waiting
    • cy.wait() - wait for a specific amount of time
    • cy.wait() - wait for a specific route

📝 cypress/integration/examples/window.spec.js

  • 📎 Window
    • cy.window() - get the global window object
    • cy.document() - get the document object
    • cy.title() - get the title

@bahmutov bahmutov merged commit 60c6469 into master Mar 18, 2020
@bahmutov
Copy link
Copy Markdown
Contributor Author

🎉 This PR is included in version 1.10.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Sinon to Cypress TypeScript interface

2 participants