cover calendar provider links in browser QA

This commit is contained in:
2026-09-06 20:08:34 +03:00
parent 528aba16ae
commit 2120414d12
4 changed files with 50 additions and 0 deletions
+23
View File
@@ -33,6 +33,29 @@ try {
await page.getByRole('heading', { name: 'Günlük İhale Bülteni', exact: true }).waitFor({ state: 'attached', timeout: 10_000 });
evidence.checks.dailyBulletinHeading = await page.getByRole('heading', { name: 'Günlük İhale Bülteni', exact: true }).count() === 1;
if (!evidence.checks.dailyBulletinHeading) throw new Error('Günlük bülten başlığı açılmadı.');
const calendarPage = await context.newPage();
try {
await calendarPage.goto(`${url.replace(/\/qa-signin$/, '')}/qa-calendar-links`, { waitUntil: 'networkidle' });
const googleLink = calendarPage.getByRole('link', { name: 'Google Takvim taslağı', exact: true });
const outlookLink = calendarPage.getByRole('link', { name: 'Outlook taslağı', exact: true });
await googleLink.waitFor({ state: 'attached', timeout: 10_000 });
await outlookLink.waitFor({ state: 'attached', timeout: 10_000 });
const [googleHref, outlookHref] = await Promise.all([googleLink.getAttribute('href'), outlookLink.getAttribute('href')]);
const googleUrl = new URL(googleHref);
const outlookUrl = new URL(outlookHref);
evidence.checks.calendarProviderLinks = {
googleHost: googleUrl.hostname,
googleDates: googleUrl.searchParams.get('dates'),
outlookHost: outlookUrl.hostname,
outlookStart: outlookUrl.searchParams.get('startdt'),
outlookEnd: outlookUrl.searchParams.get('enddt'),
};
if (googleUrl.hostname !== 'calendar.google.com' || googleUrl.searchParams.get('dates') !== '20260910T070000Z/20260910T070000Z' ||
outlookUrl.hostname !== 'outlook.live.com' || outlookUrl.searchParams.get('startdt') !== '2026-09-10T07:00:00Z' ||
outlookUrl.searchParams.get('enddt') !== '2026-09-10T07:00:00Z') {
throw new Error(`Takvim provider bağlantısı kaynak son tarihi korumuyor: ${JSON.stringify(evidence.checks.calendarProviderLinks)}`);
}
} finally { await calendarPage.close(); }
await page.getByRole('button', { name: 'Ana İhale Listesi', exact: true }).click();
await page.getByRole('button', { name: 'Pazar', exact: true }).click();
await page.getByRole('button', { name: 'Analitik Dashboard', exact: true }).click();
+14
View File
@@ -140,6 +140,20 @@ const ui=await createServer({server:{host:'127.0.0.1',port:0,proxy:{'/api':{targ
</script></body></html>`;
res.setHeader('Content-Type','text/html; charset=utf-8');res.end(await server.transformIndexHtml('/qa-overview-frame',html));return;
}
if(req.url==='/qa-calendar-links'){
const calendarTender={...tenders[0],ikn:'2026/1582991',tarih:'10.09.2026',saat:'10:00',baslik:'QA Giresun mikroskop',kurum:'Giresun TEST KURUMU',ihaleYeri:'QA toplantı salonu'};
const html=`<html lang="tr"><head><meta name="viewport" content="width=device-width,initial-scale=1"></head><body><div id="root"></div><script type="module">
import React from '/node_modules/.vite/deps/react.js';
import ReactDOM from '/node_modules/.vite/deps/react-dom_client.js';
import {AppProvider,useApp} from '/src/context/AppContext.jsx';
import {TenderDetailModal} from '/src/components/TenderDetailModal.jsx';
import '/src/index.css';
const selected=${JSON.stringify(calendarTender)};
function Probe(){const {setActiveTenderDetail,authUser}=useApp();React.useEffect(()=>{if(!authUser?.email)return;const timer=setTimeout(()=>setActiveTenderDetail(selected),0);return()=>clearTimeout(timer);},[authUser?.email]);return React.createElement(TenderDetailModal);}
ReactDOM.createRoot(document.getElementById('root')).render(React.createElement(AppProvider,{},React.createElement(Probe)));
</script></body></html>`;
res.setHeader('Content-Type','text/html; charset=utf-8');res.end(await server.transformIndexHtml('/qa-calendar-links',html));return;
}
if(req.url==='/qa-source-update'||req.url==='/qa-source-update?ready=1'||req.url==='/qa-source-update?ready=1&file=1') {
const query=new URL(req.url,'http://localhost').searchParams;
qaFiles=query.has('file')?[{...qaFile}]:null;