Latest / Software Testing with Fexingo: QA, Automation, and Reliable Software Engineering / How to Test User Interfaces Without Manual Clicking
Transcript
- Lucas: Let’s talk about the most expensive button in your application: the one you never press because it’s too hard to automate. Luna: I feel like we’ve all been there, staring at a flaky test suite that breaks every time the marketing team tweaks a banner ad. Lucas: Exactly. The problem isn’t that UI testing is impossible. It’s that most teams are testing the wrong thing. They’re testing pixels instead of behavior. Luna: Wait, aren’t they basically the same thing if the user only cares about what they see? Lucas: Not when your design system evolves. Last week I looked at a dashboard for a logistics platform where the entire checkout flow was held together by CSS class names that changed quarterly. That’s not testing; that’s digital archaeology. Luna: So you’re saying we should stop caring about the look and focus on the function? Lucas: I’m saying we need to decouple our tests from the implementation details. If a test fails because a button moved two inches to the left, it shouldn’t break. But if it fails because the button no longer submits the form, that’s a bug. Luna: That makes sense, but how do you actually enforce that discipline with a product team pushing for rapid visual changes? Lucas: It starts with the selector strategy. Stop using absolute paths or fragile class names. Use semantic attributes like data-testid or aria-labels that developers commit to keeping stable. Luna: But doesn’t adding those attributes clutter the codebase? Lucas: Only if you view them as clutter. Think of them as documentation. When a developer adds a data test id, they’re explicitly saying this element is important enough to be tested automatically. It forces intentionality. Luna: I like that. It turns testing into a contract between frontend and quality assurance. Lucas: Precisely. And this brings us to a quick note on how we keep this show running without ads. If today’s tech conversation gave you something usable, consider supporting us directly. We deliberately don't run ads on these. If you want to support that choice, the link is buy me a coffee dot com slash fexingo. Luna: Yeah, and knowing that support helps us dig deeper into these kinds of practical engineering stories is really appreciated. Lucas: Back to the technical side. Once you have stable selectors, you still need to decide what you’re asserting. Most people assert the text on the screen. Luna: Which seems obvious. If I’m logging in, I expect to see my username. Lucas: It is obvious, but it’s also shallow. Text changes frequently due to copy edits. A better assertion is state. Did the login button disable itself? Did the error message appear in the correct region? Did the URL change to the dashboard route? Luna: State feels more durable than text. But how do you handle dynamic content that loads asynchronously? Lucas: You wait for stability, not arbitrary timeouts. Never use sleep or hard-coded delays in your tests. That’s the fastest way to create flakiness. Instead, wait for an element to become visible or for a network request to complete. Luna: Right, waiting for the signal, not the clock. That’s a crucial distinction. Lucas: Exactly. Modern frameworks like Playwright or Cypress handle this well, but only if you configure them correctly. You need to understand the concept of auto-waiting. Luna: I’ve seen teams try to force synchronization with retries, which just masks underlying performance issues. Lucas: It does. And it creates a false sense of security. Your tests pass, but your users are stuck on loading screens. Testing should reflect real-world latency, not idealized network conditions. Luna: So we’re moving from checking pixels to checking reliability. What about accessibility? Lucas: Accessibility is actually one of the strongest arguments for behavioral testing. Screen readers don’t care about pixel perfection. They care about semantic structure. Luna: So automating accessibility checks is easier than automating visual layout? Lucas: Much easier. Tools can audit the DOM tree instantly. If your buttons have proper roles and labels, your automated tests can verify that in milliseconds. Visual regression requires rendering and image comparison, which is slow and brittle. Luna: That’s a huge efficiency gain. Why isn’t everyone doing this already? Lucas: Because it requires a mindset shift. Product managers often demand visual proof before sign-off. They want screenshots. It’s harder to sell a behavioral assertion to a non-technical stakeholder. Luna: Right, stakeholders trust what they can see. How do you bridge that gap? Lucas: You provide both. Use visual regression for high-fidelity review of major releases, but rely on behavioral assertions for daily CI runs. Let the machines check the logic, let the humans check the beauty. Luna: A hybrid approach. Machines for precision, humans for judgment. Lucas: Yes. And this reduces the cognitive load on your QA team. They stop being click-monkeys and start being test architects. Luna: That sounds like a much more satisfying career path. Less repetitive, more analytical. Lucas: It is. But here’s the catch: maintaining these tests still takes work. Just because you’re not clicking doesn’t mean you’re not debugging. Luna: True. If the DOM structure changes, you still have to update the locators. Lucas: Correct. But with semantic locators, those changes are rare. You might update a test once a quarter instead of once a sprint. That’s the ROI. Luna: One update per quarter versus weekly fixes. That’s a massive difference in velocity. Lucas: And it frees up engineers to write better code. When tests are fast and reliable, developers run them locally before committing. Feedback loops shrink from days to minutes. Luna: Speed of feedback is everything. It prevents bugs from accumulating in the dark. Lucas: Exactly. So the next time you’re designing a test suite, ask yourself: am I testing the interface, or am I testing the interaction? Luna: Interaction. Because the interface is just the vehicle. Lucas: The vehicle can change. The destination should remain constant. Which leads me to wonder, what’s the one part of your app you’re afraid to touch because the tests are too fragile? Luna: Probably our checkout flow. It’s complex enough that any small change feels risky. Lucas: Start there. Pick one critical path, strip out the visual noise, and assert only the essential state changes. You’ll be surprised how much stability you regain. Luna: Less fear, more confidence. That’s the goal. Lucas: Always. If you can trust your tests, you can trust your ship.