Zum Hauptinhalt springen
AI & KI NachrichtenIBM Technology: The Problem with Jev: Can You Trust AI Decisions?(20.10.2026 um 18:00 Uhr)
•
YouTube Security VideosAMD and Generative Bionics Discuss Advances in Physical AI and Robotics(20.10.2026 um 17:07 Uhr)
•
YouTube Security Videosheise & c't: PCs bleiben teuer: Warum der Markt jetzt einbricht(20.10.2026 um 16:25 Uhr)
•
YouTube Security Videosheise & c't: c’t Open Hannover 2026(20.10.2026 um 18:02 Uhr)
•
YouTube Security VideosNASA Moon Base: Rovers and Lunar Terrain Vehicles (October 2026 Update)(20.10.2026 um 17:02 Uhr)
•
YouTube Security VideosGoogle Cloud Tech: The no-Code roadmap: How I approach prototyping(20.10.2026 um 18:00 Uhr)
•
YouTube Security VideosGoogle Cloud Tech: Google’s approach to security review with agents(20.10.2026 um 18:21 Uhr)
••
YouTube Security VideosFlutter: if-case statements (Technique of the Week)(20.10.2026 um 18:00 Uhr)
•
YouTube Security VideosGiannis x Google Search: Miami Pickup Hoops(20.10.2026 um 16:32 Uhr)
•
AI & KI NachrichtenIBM Technology: The Problem with Jev: Can You Trust AI Decisions?(20.10.2026 um 18:00 Uhr)
•
YouTube Security VideosAMD and Generative Bionics Discuss Advances in Physical AI and Robotics(20.10.2026 um 17:07 Uhr)
•
YouTube Security Videosheise & c't: PCs bleiben teuer: Warum der Markt jetzt einbricht(20.10.2026 um 16:25 Uhr)
•
YouTube Security Videosheise & c't: c’t Open Hannover 2026(20.10.2026 um 18:02 Uhr)
•
YouTube Security VideosNASA Moon Base: Rovers and Lunar Terrain Vehicles (October 2026 Update)(20.10.2026 um 17:02 Uhr)
•
YouTube Security VideosGoogle Cloud Tech: The no-Code roadmap: How I approach prototyping(20.10.2026 um 18:00 Uhr)
•
YouTube Security VideosGoogle Cloud Tech: Google’s approach to security review with agents(20.10.2026 um 18:21 Uhr)
••
YouTube Security VideosFlutter: if-case statements (Technique of the Week)(20.10.2026 um 18:00 Uhr)
•
YouTube Security VideosGiannis x Google Search: Miami Pickup Hoops(20.10.2026 um 16:32 Uhr)
•
Intelligence View
⚡ tsecurity.de Intelligence

Stability & Maintainability at Scale (Playwright + TypeScript, Ch.23)

As a suite grows, two things decide whether it stays an asset or becomes a liability: is it stable (does it fail only for real reasons?) and is it maintainable…

Beitrag
0
Seite
0
↗ Quelle (dev.to)
Social ReaktionenReagiere als Erste:r — dein Feedback zählt!

As a suite grows, two things decide whether it stays an asset or becomes a liability:

is it stable (does it fail only for real reasons?) and is it maintainable

(can you add the next flow without copy-paste?). This chapter is about the habits

that keep both true — demonstrated by adding comment and settings flows.




Code for this chapter is tagged ch-23 in the repo:

https://github.com/aktibaba/playwright-qa-course — see src/utils/unique.ts,

src/pages/SettingsPage.ts, and the new comment-ui / settings-ui specs.






Centralize the tricky bits



The flaky slug bug a few chapters back came from generating "unique" data that

wasn't unique across parallel workers. The lesson isn't "be careful" — it's put the

hard thing in one place so nobody gets it wrong again
:




// src/utils/unique.ts
let counter = 0;
export function uniqueId(prefix = "id"): string {
counter += 1;
return `${prefix}-${Date.now()}-${counter}-${Math.floor(Math.random() * 1e9)}`;
}






Now the article factory and the user factory both call uniqueId() — one proven

recipe, zero chances to reintroduce the collision. That's maintainability: the

correct way is the only way.





Wait for the right signal, not a guess



The settings screen loads the current user asynchronously, then fills the form.

Editing a field before that load lands would submit empty values over the real ones.

The stable fix is never a waitForTimeout — it's waiting for the actual readiness

signal:




// src/pages/SettingsPage.ts
async goto(): Promise<void> {
await this.page.goto("/#/settings");
await expect(this.updateButton).toBeVisible();
await expect(this.username).not.toHaveValue(""); // the form has loaded
}






Encapsulating that wait in the Page Object means every settings test inherits the

stability for free — the test just calls goto().





New flows, same machinery



Adding comments and settings didn't require new infrastructure — they reuse the

fixtures and Page Objects we already have. A comment test reads as behavior:




test.use({ storageState: ".auth/playwright.json" });

test("post a comment and see it appear", async ({ makeArticle, articlePage }) => {
const article = await makeArticle(); // seed via API
await articlePage.goto(article.slug);
const body = `Nice article ${Date.now()}`;
await articlePage.postComment(body); // act in UI
await expect(articlePage.comment(body)).toBeVisible(); // verify in UI
});






The settings test goes further on isolation: it registers a fresh user through

the API and logs in as them, so changing a profile never contends with other tests

on the shared seed user. New surface, but the same registerUser, loginPage, and

settingsPage building blocks. That's what "scales" means here — the marginal cost

of the next flow is small.





…and another real bug



Writing the settings flow, the UI test failed — and so did a direct API check. The

SUT's update endpoint 500'd on every profile update:




// the original, buggy condition
if (password !== undefined || password !== "") { // always true!
loggedUser.password = await bcryptHash(password); // bcryptHash(undefined) -> 500
}






a !== x || a !== y is always true, so every update tried to hash an absent

password ("data and salt arguments required") — and on a real save would have

clobbered the user's password. One character — || → && — fixed it. The suite

didn't just verify the settings screen; it proved the whole feature was broken.






Next up



Chapter 24 — Framework maturation & docs: we tidy the project, document how to

run and extend it, and round out coverage so a newcomer can be productive in

minutes. Tag: ch-24.




Following along? Star the repo

and tell me the one helper that removed the most flakiness from your suite.


Intelligence Digest — kostenlos Täglich die wichtigsten Security-News · jederzeit abbestellbar
Community Rating & Social Proof
⭐ Leser-Wertung
–
Ø / 5.0
Noch keine Leser-Bewertungen
War diese Seite hilfreich?
0
Jetzt Bewertung abgeben
🟢 Niedrig (1-3.9) 🟡 Mittel (4.0-6.9) 🔴 Hoch (7.0-8.9) Kritisch (9.0-10.0)

Verwandte Story-Cluster & Quellen (Vektor-KI)

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Stability & Maintainability at Scale (Playwright + TypeScript, Ch.23)

Thematisch verwandte Begriffe: Stability, Maintainability, Scale, Playwright · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

💬 Kommentare werden geladen…
Zum Aktualisieren ziehen
Nächster Beitrag