CI Pipeline with Test Management / 🧪 Run Tests & Generate Reports (push) Canceled after 0s
Test Reporting & Gherkin Analysis / 🧪 Run Tests & Generate Reports (push) Canceled after 0s
CI Pipeline with Test Management / 🐳 Docker Integration Tests (push) Canceled after 0s
CI Pipeline with Test Management / 🏗️ Build Docker Image (push) Canceled after 0s
CI Pipeline with Test Management / 📊 Generate Test Summary (push) Canceled after 0s
Test Reporting & Gherkin Analysis / 📊 Analyze Test Coverage (push) Canceled after 0s
Test Reporting & Gherkin Analysis / 🔄 Sync with Linear (push) Canceled after 0s
Test Reporting & Gherkin Analysis / ⚡ Performance Monitoring (push) Canceled after 0s
- Products collection (interim mirror of the PLATFM-14 catalogue contract): lifecycle status, product type, required whole-forint net price, yearly billing, service definition, per-product English gate - HostingPlans global: page copy, comparison labels, VAT rate (27%) - Gate: production shows only active plans, staging all but retired; with no showable plan the page is 404 and left out of the menu and the sitemap - /hu/tarhely-csomagok <-> /en/hosting-plans via PAGE_SLUGS (hreflang, language switcher, CTA page picker) - Seed migration 20260929_hosting_plans: mIT Start (14 900 Ft/yr, 5 mailboxes) and mIT Mid (23 900 Ft/yr) as drafts, English AI draft; idempotent - Production SEO suite expects at least 12 sitemap URLs; new SMOKE-10 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
127 lines
6.2 KiB
TypeScript
127 lines
6.2 KiB
TypeScript
import { expect, test } from '@playwright/test'
|
|
|
|
test('SMOKE-01: health endpoint is available', async ({ request }) => {
|
|
const response = await request.get('/api/health')
|
|
expect(response.status()).toBe(200)
|
|
await expect(response).toBeOK()
|
|
const body = await response.json()
|
|
await expect(response.json()).resolves.toMatchObject({ status: 'ok' })
|
|
// The deployed build must carry a git SHA stamp (deploy.sh injects it).
|
|
expect(typeof body.deployVersion).toBe('string')
|
|
expect(body.deployVersion).not.toBe('unversioned')
|
|
})
|
|
|
|
test('SMOKE-02: homepage renders its critical shell without console errors', async ({ page }) => {
|
|
const consoleErrors: string[] = []
|
|
page.on('console', message => {
|
|
if (message.type() !== 'error') return
|
|
// Chromium logs failed resource loads (e.g. favicon 404) as console errors.
|
|
// Those are network noise here; real JS errors must still fail the test.
|
|
if (message.text().startsWith('Failed to load resource')) return
|
|
consoleErrors.push(message.text())
|
|
})
|
|
|
|
await page.goto('/')
|
|
await expect(page.getByRole('heading', { level: 1 })).toBeVisible()
|
|
await expect(page.getByRole('navigation')).toBeVisible()
|
|
await expect(page.getByRole('link', { name: /személyre szabott konzultációt/i })).toBeVisible()
|
|
await expect(page.locator('footer')).toBeVisible()
|
|
expect(consoleErrors).toEqual([])
|
|
})
|
|
|
|
test('SMOKE-03: main navigation opens every public core page', async ({ page }) => {
|
|
const targets = [
|
|
['Kezdőlap', '/hu'],
|
|
['Rólunk', '/hu/rolunk'],
|
|
['Szolgáltatások', '/hu/szolgaltatasok'],
|
|
['Kapcsolat', '/hu/kapcsolat'],
|
|
] as const
|
|
|
|
await page.goto('/')
|
|
for (const [label, expectedPath] of targets) {
|
|
await page.getByRole('navigation').getByRole('link', { name: label }).click()
|
|
await expect(page).toHaveURL(new RegExp(`${expectedPath.replace('/', '\\/')}$`))
|
|
await expect(page.getByRole('heading', { level: 1 })).toHaveCount(1)
|
|
}
|
|
})
|
|
|
|
test('SMOKE-04: service content and contact CTA are visible', async ({ page }) => {
|
|
await page.goto('/')
|
|
await expect(page.getByRole('heading', { name: 'Szolgáltatásaink' })).toBeVisible()
|
|
await expect(page.getByRole('link', { name: /kérjen ajánlatot/i })).toHaveAttribute('href', '/hu/kapcsolat')
|
|
})
|
|
|
|
// MITHOME-123 regression: SMOKE-02 only checked the hero CTA was visible,
|
|
// so its stale "/kapcsolat" target (404) went unnoticed.
|
|
for (const [locale, contactPath] of [['hu', '/hu/kapcsolat'], ['en', '/en/contact']] as const) {
|
|
test(`SMOKE-06-${locale}: hero CTA opens the ${locale} contact page`, async ({ page }) => {
|
|
await page.goto(`/${locale}`)
|
|
const cta = page.locator('section').first().locator('a.btn-primary').first()
|
|
await expect(cta).toHaveAttribute('href', contactPath)
|
|
const response = await page.request.get(contactPath)
|
|
expect(response.status()).toBe(200)
|
|
})
|
|
}
|
|
|
|
// MITHOME-124: external links always open in a new tab (the home Webmail
|
|
// button used to open in the same tab while other webmail links did not).
|
|
test('SMOKE-07: external links on the homepage open in a new tab', async ({ page }) => {
|
|
await page.goto('/hu')
|
|
const external = page.locator('a[href^="http"]:not([href^="' + new URL(page.url()).origin + '"])')
|
|
expect(await external.count()).toBeGreaterThan(0)
|
|
for (const link of await external.all()) {
|
|
await expect(link).toHaveAttribute('target', '_blank')
|
|
await expect(link).toHaveAttribute('rel', /noopener/)
|
|
}
|
|
})
|
|
|
|
// MITHOME-115: the language switcher keeps the current page (translated slug).
|
|
test('SMOKE-08: language switcher opens the same page in the other language', async ({ page }) => {
|
|
await page.goto('/hu/szolgaltatasok')
|
|
const english = page.getByRole('group', { name: 'Nyelv kiválasztása' }).first().getByRole('link', { name: 'English' })
|
|
await expect(english).toHaveAttribute('href', '/en/services')
|
|
await english.click()
|
|
await expect(page).toHaveURL(/\/en\/services$/)
|
|
await expect(page.getByRole('group', { name: 'Choose language' }).first().getByRole('link', { name: 'Magyar' })).toHaveAttribute('href', '/hu/szolgaltatasok')
|
|
})
|
|
|
|
// MITHOME-116: pages announce both languages (hreflang), and staging is
|
|
// never indexed (disallow-all robots.txt, empty sitemap, noindex meta).
|
|
test('SMOKE-09: hreflang alternates and staging noindex', async ({ page, request }) => {
|
|
await page.goto('/hu/szolgaltatasok')
|
|
const origin = new URL(page.url()).origin
|
|
await expect(page.locator('link[rel="alternate"][hreflang="en"]')).toHaveAttribute('href', `${origin}/en/services`)
|
|
await expect(page.locator('link[rel="alternate"][hreflang="x-default"]')).toHaveAttribute('href', `${origin}/hu/szolgaltatasok`)
|
|
await expect(page.locator('link[rel="canonical"]')).toHaveAttribute('href', `${origin}/hu/szolgaltatasok`)
|
|
await expect(page.locator('meta[name="robots"]')).toHaveAttribute('content', /noindex/)
|
|
|
|
const robots = await (await request.get('/robots.txt')).text()
|
|
expect(robots).toMatch(/Disallow: \/\s*$/m)
|
|
expect(robots).not.toContain('Sitemap:')
|
|
})
|
|
|
|
// MITHOME-130: staging shows the draft hosting plans for review (production
|
|
// shows only active ones), with the menu item and both languages.
|
|
test('SMOKE-10: hosting plans page and menu item', async ({ page }) => {
|
|
await page.goto('/hu')
|
|
await page.getByRole('navigation').getByRole('link', { name: 'Tárhelycsomagok' }).first().click()
|
|
await expect(page).toHaveURL(/\/hu\/tarhely-csomagok$/)
|
|
await expect(page.getByRole('heading', { level: 2, name: 'mIT Start' })).toBeVisible()
|
|
await expect(page.getByRole('heading', { level: 2, name: 'mIT Mid' })).toBeVisible()
|
|
await expect(page.getByText(/\+ ÁFA \/ év/).first()).toBeVisible()
|
|
const english = page.getByRole('group', { name: 'Nyelv kiválasztása' }).first().getByRole('link', { name: 'English' })
|
|
await expect(english).toHaveAttribute('href', '/en/hosting-plans')
|
|
})
|
|
|
|
test('SMOKE-05: empty contact form is blocked client-side without API submission', async ({ page }) => {
|
|
let contactPostCount = 0
|
|
page.on('request', request => {
|
|
if (request.method() === 'POST' && new URL(request.url()).pathname === '/api/contact') contactPostCount++
|
|
})
|
|
|
|
await page.goto('/hu/kapcsolat')
|
|
await page.getByRole('button', { name: 'Üzenet küldése' }).click()
|
|
await expect(page.getByRole('textbox', { name: 'Név *' })).toBeVisible()
|
|
await expect.poll(() => contactPostCount).toBe(0)
|
|
})
|