This commit is contained in:
Andrey Antukh
2026-02-10 19:18:03 +01:00
parent afe7d41adf
commit 0b68edf84e
5 changed files with 17 additions and 2 deletions

View File

@@ -11,7 +11,7 @@ import comments from './plugins/create-comments';
import { Agent } from './utils/agent';
describe('Plugins', () => {
it('create board - text - rectable', async () => {
it.only('create board - text - rectable', async () => {
const agent = await Agent();
const result = await agent.runCode(testingPlugin.toString(), {
screenshot: 'create-board-text-rect',

View File

@@ -60,6 +60,9 @@ export async function Agent() {
const page = await browser.newPage();
await page.setViewport({ width: 1920, height: 1080 });
await page.setExtraHTTPHeaders({
'X-Client': 'plugins/e2e:puppeter',
});
console.log('Setting authentication cookie...');
page.setCookie({

View File

@@ -15,6 +15,7 @@ export async function PenpotApi() {
const resultLoginRequest = await fetch(
`${apiUrl}/api/main/methods/login-with-password`,
{
credentials: 'include',
method: 'POST',
headers: {
'Content-Type': 'application/json'
@@ -23,7 +24,15 @@ export async function PenpotApi() {
},
);
console.log("AAAAAAAAAAAA", 1, apiUrl)
// console.log("AAAAAAAAAAAA", 2, resultLoginRequest);
console.dir(resultLoginRequest.headers, {depth:20});
console.log('Document Cookies:', window.document.cookie);
const loginData = await resultLoginRequest.json();
const authToken = resultLoginRequest.headers
.get('set-cookie')
?.split(';')

View File

@@ -14,6 +14,6 @@ export default defineConfig({
reportsDirectory: '../coverage/e2e',
provider: 'v8',
},
setupFiles: ['dotenv/config'],
setupFiles: ['dotenv/config', 'vitest.setup.ts']
},
});

View File

@@ -0,0 +1,3 @@
// import { vi } from 'vitest';
window.location.href = 'https://localhost:3449';