BeamSec'in phishing ve güvenlik eğitimi platformunda bir özelliğe spec aşamasında dahil oluyorum: gereksinimi netleştiriyor, testlerini tasarlıyor ve Playwright ve TypeScript ile otomasyonunu yazıyorum. Ortamları kendim kuruyor, bir şey bozulunca kök nedeni buluyorum.
Step tanımları · istek reddedilir, kayıt tekrar okunur
API istemcisi · tek retry, assertion yok
@apiFeature:Booking API
CRUD lifecycle of a booking via RESTful Booker, including token-based auth
and what the API does when the token is missing.
# …# The token is the only thing standing between the public internet and someone# else's reservation, so its absence is asserted rather than assumed.Scenario:A write without a token is refusedGiven a booking exists with a total price of 150
When I try to update the booking without a token
Then the request should be refused as forbidden
And the booking total price should still be 150
import { expect } from'@playwright/test';
import { createBdd } from'playwright-bdd';
import { test, type World } from'../../fixtures/fixtures';
// …When('I try to update the booking without a token', async ({ booker, world }) => {
const id = fromWorld(world.bookingId, 'bookingId', 'Given a booking exists');
world.lastResponse = await booker.updateBookingUnauthenticated(id, { totalprice: 1 });
});
Then('the request should be refused as forbidden', async ({ world }) => {
const response = fromWorld(
world.lastResponse,
'lastResponse',
'When I try to update the booking without a token',
);
expect(response.status(), awaitresponseDetail(response)).toBe(403);
});
Then('the booking total price should still be {int}', async ({ booker, world }, price: number) => {
const id = fromWorld(world.bookingId, 'bookingId', 'Given a booking exists');
awaitexpectTotalPrice(booker, id, price);
});
// …async function expectTotalPrice(booker: BookerClient, id: number, price: number): Promise<void> {
const response = await booker.getBooking(id);
expect(response.status()).toBe(200);
const body = (await response.json()) as Booking;
expect(body.totalprice).toBe(price);
}
/** Puts the response body in the failure message, so a red run needs no re-run to diagnose. */async function responseDetail(response: {
status(): number;
text(): Promise<string>;
}): Promise<string> {
return`unexpected status ${response.status()}, body: ${(await response.text()).slice(0, 300)}`;
}
/** Typed wrapper over Playwright's `request`. Nothing here asserts, which is what makes the retry safe. */exportclass BookerClient {
constructor(privatereadonly request: APIRequestContext) {}
/**
* The only retried request in the suite. It is a precondition rather than a subject
* under test, and it is where a sandbox cold start turns a healthy run red.
*/asyncrequestToken(): Promise<string> {
const attempts = env.api.tokenRetries;
const failures: string[] = [];
for (let attempt = 1; attempt <= attempts; attempt++) {
try {
const response = await this.request.post('/auth', {
data: env.api.credentials,
timeout: env.api.timeout,
});
if (response.ok()) {
const body = (await response.json()) as { token?: string; reason?: string };
if (body.token) return body.token;
failures.push(`attempt ${attempt}: 200 but no token (reason: ${body.reason ?? 'none'})`);
} else {
failures.push(`attempt ${attempt}: HTTP ${response.status()}`);
}
} catch (error) {
failures.push(`attempt ${attempt}: ${(error as Error).message}`);
}
if (attempt < attempts) {
// Linear backoff: a cold-starting dyno needs seconds, not milliseconds.awaitnewPromise((resolve) => setTimeout(resolve, attempt * 1_000));
}
}
thrownewError(
`Could not obtain an auth token from ${env.api.baseURL} after ${attempts} attempts:\n` +
failures.map((line) => ` ${line}`).join('\n'),
);
}
// …/**
* Its own method rather than an optional token argument: with an optional argument an
* undefined token would silently turn an authorized test into this one.
*/updateBookingUnauthenticated(id: number, patch: Partial<Booking>): Promise<APIResponse> {
return this.request.patch(`/booking/${id}`, { data: patch, timeout: env.api.timeout });
}
// …
}
barandoganbas.net'i her sabah kontrol eden Playwright suite'i. Konsol hatalarını ve kırık linkleri yakalıyor, iki temada da axe ile WCAG 2.2 AA taraması yapıyor, İngilizce ve Türkçe sayfaları karşılaştırıyor ve Bug Hunt Lab'deki altı bug'ı tek tek tekrar üretiyor.
Nasıl kurulu
Page object'ler ve fixture'lar. Otomatik bir fixture, konsol hatası ya da 4xx/5xx yanıtı gören her testi kırıyor.
Rol ve etikete göre locator'lar, web-first assertion'lar; sabit bekleme yok.
GitHub Actions'ta testlerden önce strict TypeScript ve tip bilgili ESLint çalışıyor.
Her koşunun HTML raporu GitHub Pages'te yayınlanıyor.
E-posta güvenliği ve AI agent modülleri içeren, multi-tenant siber güvenlik farkındalığı ve phishing simülasyonu platformu.
LDAP/Azure AD senkronizasyonu, yetkilendirme ve LLM agent akışlarında 410'dan fazla bug raporladım; 370'ten fazlasının düzeltmesini doğruladım.
Her release'te elle yapılan regresyon testlerinin yerine Playwright/TypeScript ile UI ve API suite'leri yazdım. Suite'ler yetkilendirme, kimlik doğrulama ve tenant izolasyonunu test ediyor; Jenkins'te paralel koşuyor ve geçmeden release çıkmıyor.
Yük testinden LLM agent testine kadar bu işlerden beş örneği Öne çıkan işler ↑ bölümünde anlattım.
2024 · Askerlik
AĞU 2023 – ŞUB 2024 Uzaktan
Hypnotes
Test Automation Engineer
Terapistler için klinik yönetim yazılımı.
Token tabanlı yetkilendirmenin sınırlarını test etmek için Java ve Rest Assured ile sıfırdan bir API test framework'ü yazdım.
NİS – AĞU 2023 California, ABD Uzaktan, sözleşmeli
Hyrai
Software Test Engineer
Karmaşık iş akışları için Java, Selenium, Cucumber ve Gherkin ile bir BDD test framework'ü kurdum. Gereksinimleri geliştirme başlamadan, erken aşamada inceledim.
CSP ve güvenlik header'larıYetkilendirmeTenant izolasyonu
AI testi
LLM agent değerlendirmeHalüsinasyon riskiÇok adımlı görev tutarlılığı
Kimlik ve dizin servisleri
Active DirectoryAzure AD (Entra ID)AD FS (SSO)LDAPGPO
Programlama dilleri
TypeScriptJavaScriptJava
CI/CD ve test yönetimi
JenkinsGitHub ActionsGitJiraXray
Altyapı ve veri
DockerProxmoxRabbitMQLinuxPostgreSQLMongoDBMySQL
qa-lab.spec.tsqueued
Bug Hunt Lab
Bu kayıt formunda altı bug saklı. Uç durumları deneyin, kaçını tekrarlayabildiğinize bakın. Bulduklarınız bug listesine düşer. Her birini hangi test tekniğinin yakaladığı da içeride: denklik paylarına ayırma, sınır değer analizi, durum geçişi testi, karar tablosu ve hata tahmini.
Bu form bilerek hatalı yapıldı. Girdiğiniz hiçbir şey tarayıcıdan çıkmaz, gerçek hesap açılmaz.