- update scenario tests to create runs with required environmentId - adjust browser controller expectations to session auto-create behavior - sync playwright/context mocks with current browser service usage
27 lines
722 B
TypeScript
27 lines
722 B
TypeScript
const makePage = () => ({
|
|
goto: jest.fn(),
|
|
content: jest.fn().mockResolvedValue("<html></html>"),
|
|
title: jest.fn().mockReturnValue(""),
|
|
url: jest.fn().mockReturnValue(""),
|
|
evaluate: jest.fn(),
|
|
close: jest.fn(),
|
|
});
|
|
|
|
const makeContext = () => ({
|
|
newPage: jest.fn().mockResolvedValue(makePage()),
|
|
cookies: jest.fn().mockResolvedValue([]),
|
|
addCookies: jest.fn().mockResolvedValue(undefined),
|
|
addInitScript: jest.fn().mockResolvedValue(undefined),
|
|
});
|
|
|
|
const makeBrowser = () => ({
|
|
newContext: jest
|
|
.fn()
|
|
.mockImplementation(() => Promise.resolve(makeContext())),
|
|
close: jest.fn(),
|
|
});
|
|
|
|
export const chromium = {
|
|
launch: jest.fn().mockImplementation(() => Promise.resolve(makeBrowser())),
|
|
};
|