TestGen4Ruby: One Point Oh

From regular versioning culture, one would think that TestGen4Ruby has just graduated and is now an all-mature big boy. False. Just as a clarification, I’m using the versioning scheme suggested by Rubygem’s manual, which can be summed up as: left number => breaks compatibility; middle number => adds new feature without breaking previous stuff; right number => bugfix, cleanup or some other minor change that doesn’t affect the API.

More explanation and arguments in favor of this strategy can be found at the manual itself.

This new version basically fixes a little problem with the input from TestGen4Web. It’s a dirty little fix that doesn’t cover all cases, because that is impossible from inside tg4rb. To fix this for good, a good many changes must be made to tg4w itself. I’m currently working on this.

Just so the “One Point Oh” spirit doesn’t get totally blown away by the clever versioning policy, there is a graduation of sorts going on for TestGen4Web today: this is the last change that is part of my work during the Google Summer of Code (I didn’t have time to commit this before the “pencils down” deadline so I’m releasing now, but it was coded inside that time window). So from now on I’ll just keep fiddling with it on my own. It is a good feeling knowing that now I have a little (my first!) baby free software project on my hands :-)

Well, to the official release notes already:

Subject: [ANN] tg4rb 1.0.0 Released

tg4rb version 1.0.0 has been released!

* <by Helder Ribeiro>
* <(http://tg4rb.googlecode.com)>

## FEATURES:

* takes an XML with actions from tg4w and outputs stand-alone Ruby code that can be run directly or embedded into existing code (e.g. for test automation).
* can be used as a library or as an executable script.
* takes the xpath from tg4w and uses only enough info to guarantee the uniqueness of the referenced element, allowing the generated script to keep working even with some change to page structure.

## PROBLEMS:

* the generated code is damn ugly.
* a few action types from the XML input still aren’t recognized.
* some dependencies aren’t very clearly sorted out yet. you might find you need something that is not specified. if yes, please report this as an issue in our issue tracker.
* i don’t know, find more and let me know =)

## SYNOPSIS:

Changes:

## 1.0.0 / 2007-08-21
* NOTE: This version breaks compatibility with previous version! Scripts written in previous versions won’t work.
* fixed small bug with escaping single quotes
* API change: changed the visibility of element_by_least_restrictive_xpath in Tg4rbToolbox to private
* API change: created public method element() in Tg4rbToolbox
* provided workaround for bug in xpath from tg4w: now clicks on links work with the link’s text (requires HPricot)

## 0.0.2 / 2007-07-09
* fixed silly import problem on generated script

* <by Helder Ribeiro>
* <(http://tg4rb.googlecode.com)>

[ANN] tg4rb 0.0.2 Released!!

Here’s my Google Summer of Code baby!!! =D If you find any problem with the code or the documentation, please send an email to the mailing list or post an issue in our issue tracker. I’m off to Peru today, so I might not check email too often, but I’ll try my best to keep up. Enjoy!

* <by Helder Ribeiro>
* <(http://code.google.com/p/tg4rb)>

## FEATURES:

* takes an XML with actions from tg4w and outputs stand-alone Ruby code that can be run directly or embedded into existing code (e.g. for test automation).
* can be used as a library or as an executable script.
* takes the xpath from tg4w and uses only enough info to guarantee the uniqueness of the referenced element, allowing the generated script to keep working even with some change to page structure.

## PROBLEMS:

* the generated code is damn ugly.
* a few action types from the XML input still aren’t recognized.
* some dependencies aren’t very clearly sorted out yet. you might find you need something that is not specified. if yes, please report this as an issue in our issue tracker.
* i don’t know, find more and let me know =)

## SYNOPSIS:

Changes:

## 0.0.2 / 2007-07-09
* fixed silly import problem on generated script

## 0.0.1 / 2007-07-09
- Birthday
* <by Helder Ribeiro>
* <(http://code.google.com/p/tg4rb)>

Posted in Uncategorized. Tags: , , , , , , . 1 Comment »

TestGen4Web from SVN (or howto start contributing to it)

Yes, this is “from svn”, but first we need to install the current release and then replace it by the code from svn (there must be a better way of doing this, but this works). Go to

http://developer.spikesource.com/frs/?group_id=14&release_id=71

download and install the latest version (0.41.1-beta). This will create a directory {3c20433a-61bc-42fe-831d-415860e17283} under ~/.mozilla/firefox/vllrmpro.default/extensions (or wherever else your firefox extensions are kept).

Now we have to replace this directory by the TestGen4Web code from SVN. First, though, you’ll need an account at SpikeSource (yes, just to check the thing out; go figure).

Done that, choose a directory where you want to keep that code and check it out from SVN (mine is ~work/):

cd ~/work
svn co http://scm.spikesource.com/testgen4web

This will create a “testgen4web” directory in the chosen directory. Now we replace the old directory by a link to our checked out code:

cd ~/.mozilla/firefox/vllrmpro.default/extensions
rm \{3c20433a-61bc-42fe-831d-415860e17283\} -f
ln -s ~/work/testgen4web/extension \{3c20433a-61bc-42fe-831d-415860e17283\}

[If you're on Windows, emptying out the original directory and copying the contents of testgen4web/extension/ into it should work]

Well, that’s it, basically. Now you go around coding and changing things and, after you’re done, save your files and restart Firefox. It comes up again with your new code loaded automatically. Pretty cool, huh?

You can find more resources about TestGen4Web at:

http://developer.spikesource.com/wiki/index.php/Projects:TestGen4Web

Please drop a comment if you run into any problems while trying to do the above.

Happy Hacking ;-)

Posted in Uncategorized. Tags: , , , , , , , . Leave a Comment »

One feed per tag in WordPress

WordPress lets you choose to see only the entries with a specified tag from a blog, like, say, http://obvio171.wordpress.com/tag/soc. Thinking it would also have one feed per tag in the same way, I added that address to Planet-Soc as my soc feed.

To my great surprised, it crawled all of my posts and dumped it into the planet (sorry about that guys). I don’t know if they actually have a way to get one feed per tag, but I couldn’t find it, so I wrote the following:

#! /usr/bin/ruby
require 'rss'
rss = RSS::Parser.parse(open('http://obvio171.wordpress.com/feed/'))
channel = RSS::Rss::Channel.new
rss.channel.items.select {|i| !(i.categories.select {|c| c.content == "soc"}).empty?}.each {|i| channel.items << i}
channel.link = rss.channel.link
channel.title = rss.channel.title
channel.description = rss.channel.description
channel.generator = rss.channel.generator
rss.channel = channel
begin
File.delete('rss_soc.xml')
rescue
end
File.new('rss_soc.xml','w') << rss.to_xml

Now I only have to find a way to remove the old feed from planet-soc and add the new one (which btw is hosted at http://www.students.ic.unicamp.br/~ra033245/rss_soc.xml if anyone’s interested).

Posted in Uncategorized. Tags: , , , , , . 2 Comments »

Around the clock

The first aspect of the Free Software culture I immediately got into contact with was the timezone mess. As soon as I got accepted it was very clear what had to be done: “i need to meet up with my mentors”.

I’m in Campinas, ~100km from São Paulo, Brazil, so UTC-3:00. Angrez is in Bangalore, India, UTC+5:30. Aaron is in Seattle, USA, UTC-8:00. When Angrez gets to work early in the morning it’s past midnight for me and it catches Aaron right after a full day’s work. And still it’s the best time for us to meet online.

It’s a bit difficult then to say things like “so should we meet at five?” without having to do some annoying math in your head (I find the simplest math to be the toughest). Good thing that in these cases good-ol’ Google Calendar comes in to the rescue! I’ve set up a shared calendar where I enter the meeting times and everyone sees it conveniently in their own timezone. The simple stuff. :-)

This asynchronous nature of things sheds some light on why the free software communities make the most use (and the most development) of communication and collaboration tools based mainly in text: source code control (I’ve heard that deep conversations go on in SVN commit messages), issue tracking, mailing lists, IRC, IMs, blogs, etc.

At my current work, nobody in my team (including myself) has any experience with projects different from single-programmer course assignments, thesis-related mockup programs and the like. And we work on a big project. And although we have available to us lots of those communication/collaboration tools (the whole IBM proprietary suite), we only make very basic use of reserved checkout/checkin features (we’re dead scared of merges!), we do releases by copying code, we check out thirty files, do lots of different things and commit at the end of the day. Heck, we don’t even comment commits.

For now that’s one very immediate benefit I’ve taken from starting to get my feet wet on the free software world. I’ve become quite interested in these version control, issue tracking things and now I’m studying the documentation for that bloody suite, searching around for tips on best practices (stupid stuff like comment the freaking commit – better yet with a single short descriptive line followed by meatier description -, only commit consistent states to the trunk – we don’t actually use branches yet, I’m just practicing the lingo-, one feature per commit, etc.) and, of course, I’ve been nagging the hell out of my colleagues =)