mirror of
https://github.com/penpot/penpot.git
synced 2026-02-12 14:42:56 +00:00
🚧 WIP
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -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(';')
|
||||
|
||||
@@ -14,6 +14,6 @@ export default defineConfig({
|
||||
reportsDirectory: '../coverage/e2e',
|
||||
provider: 'v8',
|
||||
},
|
||||
setupFiles: ['dotenv/config'],
|
||||
setupFiles: ['dotenv/config', 'vitest.setup.ts']
|
||||
},
|
||||
});
|
||||
|
||||
3
plugins/apps/e2e/vitest.setup.ts
Normal file
3
plugins/apps/e2e/vitest.setup.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
// import { vi } from 'vitest';
|
||||
|
||||
window.location.href = 'https://localhost:3449';
|
||||
Reference in New Issue
Block a user