Skip to main content

mockRestoreAll

Restores all mock information and behavior stored in all registered mocks of the session.

Usage#
browser.mockRestoreAll()
Example#
mockRestoreAll.js
it('should restore all mocks', () => {
const googleMock = browser.mock('https://google.com/')
googleMock.respond('https://webdriver.io')
const wdioMock = browser.mock('https://webdriver.io')
wdioMock.respond('http://json.org')
browser.url('https://google.com/')
console.log(browser.getTitle()) // JSON
browser.mockRestoreAll()
browser.url('https://google.com/')
console.log(browser.getTitle()) // Google
})