watircuke (Watir and Cucumber)
June 11th, 2009
Watircuke is a project I’m starting and can be cloned over at Github. If you’re looking for easy, fast and reliable automated “Cross-Browser” testing, you may want to give my framework a spin.
Cheers!
Try adding cucumber to watir
April 17th, 2009

Cucumber is the hot new testing tool that can execute plain-text documents as automated functional tests. Cucumber basically consists of features and steps with some handy-dandy support files. Watir is an open-source library for automating web browsers. I am finding huge productivity gains when combing the two.
Install Cucumber / Watir and execute ruby script/generate cucumber inside your Rails app.
This will generate the below features folder.

Now open the support folder and add the watir configuration code to your env.rb.
Ok now that we are all configured let’s take a look at some code, starting with my sample security.feature.

Notice Line 4 “Given I am on the login page“. Cucumber takes this line and treats it as a regular expression. It will try and find a match in either the step_definitions and/or support folder. “the login page” portion can be found inside paths.rb in my support directory under the “path_to(page_name)” method.


So now any feature steps that end in “the login page” will send the browser to the url “http://deploy.visualcv.com/login”, thanks to watir.
But what about the “I am on” portion? Well, that can be found in the page_steps.rb under the step_definitions directory.


See how “.goto” watir method points to the (page_to(page_name)) method found in paths.rb. That is how “Given I am on the login page” gets executed properly from the security.feature.
Good news? That is as complex as it gets. Now for the easy steps.
Let’s take a look at Line 5 of the security.feature And I click the link “Forgot Your Password?“. Under the step_definitions directory I have a link_steps.rb file.

All I am doing here is passing in the text “Forgot Your Password?” into the watir hash via the block(|text|). I can pass in any link text I wish to this one line of code. Talk about Refactoring your code.
So, I’ve decided to keep the same concept with buttons, assertions, text_fields, etc…



This makes scripting very fast, very organized, very easy and very English.
Enough code talk, let’s see some action in a ScreenCast!
rails redefines “Up and Running”
February 11th, 2009
I highly recommend updating to Rails 2.3 and checking out Templates. If your tired of trying to figure out which gems or plugins you might need for your next project, you can script a template that will prompt you for your favs. “Do you want rspec for this project?” Yes Please. Tired of .gitignoring the same silly files? Done! Now if you really wanna fry your noodle, store different templates up at your github account and remotely call these templates whenever you generate a new $app.
united we stand, divided they fall
December 24th, 2008
I first heard about Merb from Ezra Zygmuntowicz @RubyEast in September of ‘07. My first thought was, hmmm… what will this do to Rails? I played with Merb a little bit to see what all the hub-bub was about. Impressive! My buddy and I are planning to use it in our next project.
Then I saw this tweet yesterday from DHH.
“Merb gets merged into Rails 3: http://is.gd/dbnC — what a great day for the community! Read also Yehuda’s take: http://is.gd/dbnP“
I was pretty excited and shocked at first. Not sure how often this happens in other camps, but now that I think about it…it is classic Ruby. You see, Ruby is not just a fantastic language but the people involved are all about collaboration. We focus on community and not about self-interests. For example, I received an email last week from Chad Fowler, asking me to review his next book. I attended one of Chad’s trainings back in March and bumped into him at a couple conferences. I was not expecting to be honored with such a favor. But hey, this is the Ruby Community. This is what it’s all about.
A Proud Moment for Rudy
November 5th, 2008
My wife is an amazing woman. She currently works primarily from home as an Email Marketing Manager for Catalyst Direct. I’m not quite sure how she handles both the job and raising our 22 month old daughter, but man, she is doing an exceptional job. She recently entered an article that was just published by the DMNews E-mail Marketing Guide 2008. Wow, well done Lora. I’m extremely proud of you!

the entire article:
Improving your e-mail marketing results doesn’t have to cost thousands of dollars. When every penny counts, basic, lowcost optimization techniques can yield significant improvements.
Here are a few tricks of the trade.
Capture audit We all lose track of the countless places we gather e-mail addresses. It’s time to take a good, hard look at correcting this problem. Audit each of your online and offline e-mail capture methods. Create a matrix with column headings that refer to each source (SEM landing page, Web site, POS). Complete the matrix by pulling e-mail metrics from the past six months and segmenting the results based on source of e-mail capture. Then, determine where your most profitable e-mail acquisition occurs. Focus optimization efforts there and lessen efforts in the least profitable categories.
Capture forms Optimize your forms to capture only the most profitable subscribers. Sign up for Google analytics and run it on every form page. You need to know your completion rate versus impressions. What do people click on and what do they ignore?
After evaluating the data, it’s time to test: Test copy, both its tone and length. If subscribers feel they have either insufficient or too much information, they’ll leave. Test the number of fields. Fewer are better. Test imagery. The addition of e-mail examples (expandable in a pop-up screen) could alleviate subscribers’ fears about content and relevancy. Test layout. Many researchers concur that a one-column design brings the highest number of conversions.
Remarketing opportunities Before you dream up a new and costly campaign, examine previous campaigns and see where you might harvest new opportunities. Market to individuals who opened but didn’t click and to individuals who clicked but didn’t convert. Market to “loiterers”: those who opened or clicked on eight of your last 10 campaigns but still haven’t purchased.
Optimize e-mail creative With mobile rendering now the biggest concern, it’s time to face the problem of unreadable e-mails. Reduce the imagery in the top three inches of your design and set the heights and widths on all images. If your call to action is an image, provide viewable text links. Forget open rates. Readers should be able to get the message without having to download images or click on a web version. Make your imagery complement, not carry, the message. Focus on conversions instead. Don’t pay for a complete redesign to spice up your template. Instead, test the addition or placement of one element and discover how it can impact your click-through rate. Here’s to optimization, and to a higher ROI in 2009.
|


