This is how I finally accomplished this:
SCREEN_SIZES = {
"desktop": (1020, 768),
"tablet": (768, 1024),
"mobile": (320, 460)
}
@step(ur'I am in the "(?P<breakpoint>(desktop|tablet|mobile))" view')
def set_viewport(step, breakpoint):
""" Changes the resolution of the window """
# Set the window size
world.browser.driver.set_window_size(*SCREEN_SIZES[breakpoint])