2 ms·
Sounds intriguing. There are a few tools for recording interactions with a webpage in order to replay the actions as a test (Ghost Inspector, Selenium IDE, etc)
by onion2k 10y ago
Sounds intriguing. There are a few tools for recording interactions with a webpage in order to replay the actions as a test (Ghost Inspector, Selenium IDE, etc) but they tend to be pretty horrible. I've been working on my own as a Chrome extension for a little while. What you're building sounds really interesting though, especially if it can deal with complex Javascript apps. Anything that can make developers more inclined to test things is a good thing.
- donaltroddyn 10y agoYeah, I've looked at all the current tools and there's basically two types (other then just writing straight Selenium): - Test recorders that aren't a great experience and output incomprehensible, brittle tests. - Test composers that I can best describe as 90's SQL query builders for Selenium. Complex JS apps are still a challenge for us (especially with some of the WTF code we come across in the wild), but we have a strategy in the works for them. We're still pre-release though. If you're interested, send me an email (donal@unravel.io) and I'll add you to our alpha list.
- retreatguru 10y agoWe are using ghostinspector mainly for it ability to compare screenshots between runs. I think the future of testing will be apps like this that don't require you to specify every little div but just record your actions and play them back and catch differences. Right now ghostinspector only takes a screenshot at the very end but they are adding a feature where you can take a shot anytime. As these apps get better at knowing what matters and what to ignore - all the better.
- mod 10y agoAlternatively, one of the consequences of React is that the front-end can largely be unit-tested. You can at least get a pretty good idea that the page will render what you expect if it gets the data you expect. And whether or not it gets that data is a unit test in another place. I'm not a huge fan of React, or javascript, but having been forced to work in it, this is one of the wins.
- computerex 10y agoYou could test the front-end before react though? Also, one can still have a God component. I don't think React changed anything from a testability point of view. Well written modular code is well written modular code.
- foota 10y agoI would argue that the case that React makes for testability is abstracting DOM manipulation in a way that is highly testable.
- computerex 10y agoFrameworks like Knockout have been around for quite some time now. You don't have to use React to not depend on the DOM. There are many alternatives to "jQuery based front-end development" that's not React. Aurelia, for instance, happens to be an amazing framework in my opinion that's also highly testable and that's not React. Like I said, modular code is modular code. You can write good, modular code with just require js modules, and you can also write terrible monolithic React components. Testability isn't the domain of the view layer. Abstracting the DOM into a declarative DOM is great for performance, but doesn't lead to necessarily more testable code.