28 lines
993 B
TypeScript
28 lines
993 B
TypeScript
|
|
/**
|
||
|
|
* Resets all information stored in all registered mocks of the session.
|
||
|
|
*
|
||
|
|
* <example>
|
||
|
|
:mockClearAll.js
|
||
|
|
it('should clear all mocks', async () => {
|
||
|
|
const docMock = await browser.mock('**', {
|
||
|
|
headers: { 'Content-Type': 'text/html' }
|
||
|
|
})
|
||
|
|
const jsMock = await browser.mock('**', {
|
||
|
|
headers: { 'Content-Type': 'application/javascript' }
|
||
|
|
})
|
||
|
|
|
||
|
|
await browser.url('https://guinea-pig.webdriver.io/')
|
||
|
|
console.log(docMock.calls.length, jsMock.calls.length) // returns "1 4"
|
||
|
|
|
||
|
|
await browser.url('https://guinea-pig.webdriver.io/')
|
||
|
|
console.log(docMock.calls.length, jsMock.calls.length) // returns "2 4" (JavaScript comes from cache)
|
||
|
|
|
||
|
|
await browser.mockClearAll()
|
||
|
|
console.log(docMock.calls.length, jsMock.calls.length) // returns "0 0"
|
||
|
|
})
|
||
|
|
* </example>
|
||
|
|
*
|
||
|
|
* @alias browser.mockClearAll
|
||
|
|
*/
|
||
|
|
export declare function mockClearAll(): Promise<void>;
|
||
|
|
//# sourceMappingURL=mockClearAll.d.ts.map
|