mirror of
https://github.com/penpot/penpot.git
synced 2025-08-03 09:08:31 +02:00
✨ Add login page as Page Object Model
This commit is contained in:
parent
7280dfd3f7
commit
832c1db63b
19 changed files with 143 additions and 85 deletions
|
@ -1,14 +1,14 @@
|
|||
export const interceptRPC = async (page, path, jsonFilename, options = {}) => {
|
||||
const interceptConfig = {
|
||||
status: 200,
|
||||
...options
|
||||
...options,
|
||||
};
|
||||
|
||||
await page.route(`**/api/rpc/command/${path}`, (route) => {
|
||||
route.fulfill({
|
||||
await page.route(`**/api/rpc/command/${path}`, async (route) => {
|
||||
await route.fulfill({
|
||||
...interceptConfig,
|
||||
contentType: "application/transit+json",
|
||||
path: `playwright/fixtures/${jsonFilename}`,
|
||||
path: `playwright/data/${jsonFilename}`,
|
||||
});
|
||||
});
|
||||
};
|
||||
|
|
8
frontend/playwright/helpers/intercepts.js
Normal file
8
frontend/playwright/helpers/intercepts.js
Normal file
|
@ -0,0 +1,8 @@
|
|||
import { interceptRPC } from "./index";
|
||||
|
||||
|
||||
export const setupNotLogedIn = async (page) => {
|
||||
await interceptRPC(page, "get-profile", "get-profile-anonymous.json");
|
||||
|
||||
};
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue