Uploaded February 2025 | Updated September 2026, 1 week ago
Using page object methods to add a todo item with a random title, while yielding both the title and the id to the next command. Important: if "cy.then" callback uses "cy" commands and a plain "return", then Cypress does not know which value to yield. So you need to use "cy.wrap(...)" instead of the return statement. See the code at github.com/bahmutov/todomvc-callback-example/pull/3/files
Using page object methods to add a todo item with a random title, while yielding both the title and the id to the next command. Important: if "cy.then" callback uses "cy" commands and a plain "return", then Cypress does not know which value to yield. So you need to use "cy.wrap(...)" instead of the return statement. See the code at github.com/bahmutov/todomvc-callback-example/pull/3/files










