Binding to Eventsīoth the global Cypress and cy objects are standard Node event emitters. They are strictly internal to the way Cypress works and not useful for users. Server process, automation servers, mocha, the application, and the reporter. There are a myriad of other events Cypress fires to communicate with the Node Test attributes (Object), runnable instance (Object)įires before the test and all before and beforeEach hooks run.įires after the test and all afterEach and after hooks run. Useful to see how internal cypress commands utilize the Cypress.log() API. This event is debounced to prevent it from firing too quickly and too often. Useful to see how internal cypress commands utilize the Cypress.log() API.įires whenever a command's attributes changes. Log attributes (Object), whether Cypress is in interactive mode (running via cypress open) (Boolean)įires whenever a command emits this event so it can be displayed in the Command Log. This event is essentially to debug why Cypress is failing. When commands fail the final error is the one that actually bubbles up to fail the test. Useful to understand why a command is retrying, and generally includes the actual error causing the retry to happen. This is called on the trailing edge after Cypress has internally waited for the retry interval. Useful for debugging and understanding how commands are handled.įires whenever a command begins its retrying routines. Useful for debugging and understanding how the command queue is async.įires when cy finishes running and executing your command. Useful for debugging purposes if you're confused about the order in which commands will execute.įires when cy begins actually running and executing your command. This event is extremely useful to debug why Cypress may think an element is not interactive.Ĭommand properties and arguments (Object)įires when a cy command is first invoked and enqueued to be run later. It will scroll to 'uncover' elements currently being covered. This event is fired when Cypress is waiting for and calculating actionability. The element or window being scrolled (Object)įires whenever Cypress is scrolling your application. See our recipe Handling errors.įires whenever the viewport changes via a cy.viewport() or naturally when Cypress resets the viewport to the default between tests. This event exists because it's extremely useful for debugging purposes. Binding to this event without rethrowing the error will prevent the test from failing. These are all useful to listen to for debugging purposes. These events come from Cypress as it issues commands and reacts to their state. This event is not cancelable.įires whenever Cypress detects that your application's URL has changed. The real event object is provided to you. You cannot change this behavior.įires when your application has unloaded and is navigating away. Return false from this event and the confirmation will be canceled.įires when your app calls the global window.alert() method. See our recipe Handling errors.įires when your app calls the global nfirm() method. Also useful for debugging purposes because the actual error instance is provided to you. Return false from this event and Cypress will not fail the test. Cypress will fail the test when this fires. The error (Object), Mocha runnable (Object)įires when an uncaught exception occurs in your application. These are the most useful events for you to listen to. These events come from the application currently under test (your application).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |