Posts

Showing posts from January, 2026

cypress e2e tests: page objects vs application actions vs custom commands

Should you use Application Actions when writing cypress tests? Or is the Page Objects pattern better? Or neither and just write tests and use cypress custom commands to share common selectors and user actions? Page Objects is a well established pattern. Create classes for pages in your app and put selectors in those classes. Then in your test use (and reuse) the page object classes methods to simulate user actions such as fill in a field or submit a form. This centralizes and reuses selector code. Application Actions pattern exposes the applications model as a property on window which can be directly edited in cypress test code. Now test setup to add todos so they can be toggled becomes basically like so: `window.appModel.addToDos([{}, {}])` The author provides examples of how to use Application actions including with async operations. Faster setup results in faster tests. And per the author better organized app code. The Application Actions post link argues that Page Objects are a ...

My learnings from Addy Osmanis article on how good is AI React coding

These are my notes from the article How Good Is AI at Coding React (Really)?  by Addy Osmani. There's a lot of information packed into this presentation Addy says that AI is a force multiplier. "It amplifies everything: good requirements, good architecture, good taste" AI is most useful for scenarios such as building isolated components, scaffolding, implementing explicit requirements. Its less useful for scenarios such as: multi-step integration, design taste, complex state management.  We can generalize this to: the higher the complexity the less useful (productive) is the LLM.  I called this same point out in a presentation I made in October to our tech leaders.  And in fact Addys says this explicity later in the article:  "If you remember nothing else from this article, remember this: AI handles simple tasks well and then falls off a cliff as complexity rises." I like that Addy calls out "Objective benchmarks". We've seen by now that LLM model ...