Testing jQuery plugins with Jasmine

JasmineSince I started working at Globo.com, I developed some jQuery plugins (for internal use) with my team, and we are starting to test these plugins using Jasmine, “a behavior-driven development framework for testing your JavaScript code”. In this post, I’ll show how to develop a very simple jQuery plugin (based on an example that I learned with Ricard D. Worth): zebrafy. This plugin “zebrafies” a table, applying different classes to odd and even lines. Let’s start setting up a Jasmine environment… Continue reading

Splinter: Python tool for acceptance tests on web applications

Capybara and Webrat are great Ruby tools for acceptance tests. A few months ago, we started a great tool for acceptance testsSplinter on Python web applications, called Splinter. There are many acceptance test tools on Python world: Selenium, Alfajor, Windmill, Mechanize, zope.testbrowser, etc. Splinter was not created to be another acceptance tool, but an abstract layer over other tools, its goal is provide a unique API that make acceptance testing easier and funnier :)

In this post, I will show some basic usage of Splinter for simple web application tests. Splinter is a tool useful on tests of any web application. You can even test a Java web application using Splinter. This post example is a “test” of a Facebook feature, just because I want to focus on how to use Splinter, not on how to write a web application. The feature to be tested is the creation of an event (the Splinter sprint), following all the flow: first the user will login on Facebook, then click on “Events” menu item, then click on “Create an Event button”, enter all event informations and click on “Create event” button. So, let’s do it… Continue reading

Killer Java applications server with nginx and memcached

Last days I worked setting up a new web serving structure for Wine, the largest wine’s e-commerce in Latin America. After testing, studying and learning a lot, we built a nice solution based on nginx and memcached. I will use a picture to describe the architecture (sorry, I’m not so good with pictures =P):

nginx, tomcat and memcached

As you can see, when a client do a request to the nginx server, it first checks on memcached if the response is already cached. If the response was not found on cache server, then nginx forward the request to Tomcat, which process the request, cache the response on memcached and returns it to nginx. Tomcat works only for the first client, and all other clients requesting the same resource will get the cached response on RAM. My objective with this post is to show how we built this architecture. Continue reading

Using an exclusive Firefox profile for Selenium WebDriver

One of stuffs that I really hate when working with Selenium and Ubuntu is that sometimes Selenium just starts Firefox in offline mode (or something like that). I used to create an exclusive Firefox profile for Selenium when working with Selenium RC, and just started Selenium with the -firefoxProfileTemplate parameter, but now I am almost free of Selenium 1.x, and enjoying Selenium 2 with Firefox WebDriver. The question is: how can I specify the Firefox profile to be used in a WebDriver execution? That is really easy… Continue reading

Flying with tipfy on Google App Engine

tipfy

Hooray, there is a bonus part in the series (after a looooooooooooong wait =P)! On the first blog post, about Django, I received a comment about the use of tipfy, a small Python web framework made specifically for Google App Engine. Like Flask, tipfy is not a full stack framework and we will not use a database abstraction layer, we will use just the Google App Engine Datastore API, but tipfy was designed for Google App Engine, so it is less laborious to work with tipfy on App Engine. Continue reading

Flying with Flask on Google App Engine

Flask
A little late, finally I introduce the third part of using Python frameworks in Google App Engine. I wrote before about web2py and Django, and now is the time of Flask, a Python microframework based on Werkzeug, Jinja2 and good intentions. Unlike Django and web2py, Flask is not a full stack framework, it has not a database abstraction layer or an object relational mapper, Flask is totally decoupled from model layer. It is really good, because we can use the power of SQLAlchemy (which is, IMHO, the best ever data abstraction framework =P) when we are working with relational databases, and when work with non-relational databases, we can use the native API. Continue reading

Proudly powered by WordPress
Theme: Esquire by Matthew Buchanan.