Tags related to tag test
Tuesday, July 3. 2007
In my previous entry, I described how one could set up selenium to runs tests from emacs, via the Moz REPL. The most painful part of all of that is setting up the REPL to run. After every firefox startup, you have to manually go to tools menu, and manually select 'MozLab' and then 'Start REPL'. YUCK.
Enter UserChrome.js. With a little more polish, some documentation, and something more then a MozillaZine forum posting for a website; this little extension is poised to become the new GreaseMonkey. It will be the GreaseMonkey for the hard core.
Monday, June 25. 2007
Enter Selenium IDE. The Selenium IDE provides you with a method to record and execute automated tests of your website. It is easy to use, and hella cool. It can test things like the existence of an element, the text contained inside of an element, its width, height, position, etc. Using selenium, you can build yourself unit tests. This is especially useful and powerful if you happen to be one of the unlucky bastards faced with writing code in JSTL, SMARTY, or some other templating-language-that-needs-to-die. Now you finally have unit tests.
Using Selenium, the testing process is a little more automated. More importantly, you can build a series of regression tests, to ensure the stability of your web application.
- you can script your browser from emacs
Update 2007-07-09: new versions (Version 0.2) added
Here are the two files:
Here is how you use them:
First, download the MozREPL and Selenium IDE extensions for firefox
Edit selenemacs.el to make sure that the variable selenemacs-js-file points to selenemacs.js
Enable the MozRepl (Tools->MozLab->StartREPL)
Load up selenemacs.el inside emacs (load-file "path/to/selenemacs.el") works
Enable the minor mode selenemacs-minor-mode
Record your test in SeleniumIDE
Use the emacs command selenemacs-execute-test to launch the test, its shortcut is C-c C-s C-e
Emacs tells you if the test passed or failed.
The idea here is that you write your test, and stop using your eyes to test the results of your coding to the browser, but instead use Selenium. This is especially good if you are doing multi-stage and repetitive like testing logins, searches, etc. You can code and test right inside emacs, and only have to switch to the browser to verify that your tests actually passed.
These files also show an interesting way to script mozilla through emacs. The next step of course is to get emacs to start interacting with Firebug.
Wednesday, November 3. 2004
Wednesday, April 21. 2004
When I answered the questions, I wasn't afraid to be personally revolted by the act of the family eating their dead cat, but did not claim that they should be stopped for it. I did draw the line at the SisterFisting.
But when I saw how other people moralize (or, rather, no not moralize), It got me thinking, and being the social animal that I am, made me question my own answers. So, here is my revised moral compass:
0.10 0.00 and 1.00.
That's right, my universalizing is at 1.00. Again, I am bothered by a few actions, less this time (cat eating, SisterFisting), but no not go so far as to say anything is universally wrong, except for the SisterFisting.
This coincides with my re-reading of Starship Troopers ... (read more for pseudo-scientific ranting about math and morality)
One of the central ideas of Starship Troopers is the idea that morality can be scientifically examined, and codified. So that we can make statements about morality in the same way we can make statements about Number theory or Chemistry.
Now, putting aside the fact that if "Morality Theory" is sufficiently powerful, we can Goedelize the motherfucker, here is a thought I had whilst in a shower.
Take a real number between 0 and 1, call it H for Harm. This is the amount of damage to one person that this action would cause. 1 is equivalent to killing them. Actions that make a permanent effect (maiming/mutilation/psychological torture) would rate round 0.75. etc. (of course, there is no hard and fast rules here, or no real way to figure that number out beyond a look-up table of sorts.
Now, take antihero number, this is the number of individuals who would be harmed. Call this x.
Thus Morality is Hx. Hitler is a bad man, and Gassed 6 million jews. His Morality is 6,000,000.
Sending spam has a very small H, something like 0.00001 I suspect. But, if a spammer sends out 6 million emails, it would be equivalent to killing 60 people.
I am not sure if that means that I hit the mark, or i am WAY off.