Uploaded May 2025 | Updated November 2026, 27 minutes ago
This video shows how we can "mock" the protected browser object "location" and intercept the assignment "location.href = ..." made by the application. Find the full example in the blog post glebbahmutov.com/blog/mock-location-href The example source code at github.com/bahmutov/with-window If you want to learn more about Cypress network testing, check out the online course https://cypress.tips/courses/network-testing
This video shows how we can "mock" the protected browser object "location" and intercept the assignment "location.href = ..." made by the application. Find the full example in the blog post glebbahmutov.com/blog/mock-location-href The example source code at github.com/bahmutov/with-window If you want to learn more about Cypress network testing, check out the online course https://cypress.tips/courses/network-testing


![The Text Of Each Element Starts With The Given String
Lets confirm the search results when searching for text mi all start with this text (ignoring the case)
cy.get([name=state]).type(mi)
cy.get(#search-results li)
.should(exist)
.each(function ($li, k) {
const text = $li.text()
expect(text, `state ${k + 1}`).to.match(/^mi/i)
})
Find this example at https://glebbahmutov.com/cypress-examples/ The Text Of Each Element Starts With The Given String](https://i.ytimg.com/vi/BWuWf8mqe3k/mqdefault.jpg)







