Files
flowdeck/e2e/explore4.spec.js
T
bruno c7d4fd901f
FlowDeck CI / lint (push) Successful in 51s
FlowDeck CI / test (push) Successful in 5m55s
FlowDeck CI / docker (push) Successful in 47s
feat(e2e): ajouter tests Playwright flux utilisateur core (login, workspace, palette, dashboard)
- e2e/flowdeck_e2e_final.spec.js: 4 tests E2E validés
  1. Login UI local (#email, #password, .btn-primary)
  2. Créer workspace local + entrer (modal .dialog-input)
  3. Ouvrir palette Ctrl+K et valider 'Créer une collection'
  4. Dashboard accessible
- e2e/ : package.json, playwright.config.js, install chromium
2026-09-14 09:53:31 -04:00

56 lines
2.0 KiB
JavaScript

const { test } = require('@playwright/test');
const USER = process.env.FD_USER || '[email protected]';
const PASS = process.env.FD_PASS || 'e2e-secret-123';
const WS = 'Workspace E2E ' + Date.now();
async function uiLogin(page) {
await page.goto('/auth/login?provider=local');
await page.fill('#email', USER);
await page.fill('#password', PASS);
await page.click('.btn-primary');
await page.waitForTimeout(1500);
}
async function enterWorkspace(page, wsName) {
await uiLogin(page);
await page.waitForSelector('.ws-card.btn-new');
await page.click('.ws-card.btn-new');
await page.fill('.dialog-input', wsName);
await page.click('.dialog-box .btn-primary');
await page.waitForTimeout(1200);
await page.click(`.ws-card:has-text("${wsName}")`);
await page.waitForTimeout(1500);
}
test('explore: cliquer + (nouveau) dans workspace', async ({ page }) => {
await enterWorkspace(page, WS);
console.log('URL workspace:', page.url());
// Click the + button (new page)
await page.click('.fd-ap-add');
await page.waitForTimeout(800);
// Capture modal/dialog content
const modal = await page.evaluate(() => {
const dialogs = [...document.querySelectorAll('[role=dialog], .modal, .dialog, .popover, .dropdown-menu, [x-show]')]
.filter(e => e.offsetParent !== null);
return dialogs.map(d => ({
cls: d.className?.slice(0,50),
html: d.innerHTML?.slice(0,500),
}));
});
console.log('MODALS OPEN:', JSON.stringify(modal, null, 1));
// Also check for any new elements after click
const newEls = await page.evaluate(() =>
[...document.querySelectorAll('button, a, li, div[role=menuitem], [data-action]')]
.filter(e => e.offsetParent !== null)
.map(e => ({
tag: e.tagName, cls: (e.className||'').slice(0,40),
text: (e.innerText||'').trim().slice(0,30),
}))
.filter(x => /page|meet|database|note|template|create|new|blank/i.test(x.text+' '+x.cls))
);
console.log('NEW CREATION OPTIONS:', JSON.stringify(newEls, null, 1));
await page.screenshot({ path: 'shots/after_plus.png' });
});