3 ms·
I think what he was saying was: If I have a webpage that only does one thing, it executes alert('Hello world'); Then the headless solution would have to be a
by orkj 12y ago
I think what he was saying was:
If I have a webpage that only does one thing, it executes
alert('Hello world');
Then the headless solution would have to be able to check that the alert fired. If your testing framework does not execute the JavaScript on the page (i.e just fetching the resources) then you are back to square one.
I have no idea if Mechanize executes page JavaScript, but SlimerJS (and PhantomJS) does. Which is the difference here.
* execute alert will probably for most use cases be bootstrapping some MVC and setting properties, doing navigation and so on.
- StevePerkins 12y agoWhatever JavaScript a web page runs, shouldn't it be driven by some kind of event though? Rather it be the "onLoad" event itself, or the user clicking/hovering/changing something, etc. In a real use case setting, you wouldn't have users load a web page and then somehow arbitrarily execute JavaScript code directly, without any particular event firing. So why wouldn't you test through the relevant events?