# Path: paths.py
# def path_to(page_name):
#     return django_url(
#         {
#           'the NSI home page': '/', 
#           'the about page': '/sobre',
#           'the projects page': '/projetos',
#           'the page list all current members': '/membros',
#           'the news page': '/noticias',
#           'the tools page': '/ferramentas',
#           'the tool page': '/ferramenta',
#           'page that list all former members': '/ex-membros',
#         }[page_name])


import re
from lettuce import world, step
from should_dsl import should
from paths import path_to


@step(r'I fill in "(.*)" with "(.*)"')
def fill_field(step, label, value):
    world.browser.fill(label, value)

@step(r'I go to "(.+)"')
def i_go_to(step, page_name):

# Path: paths.py
# def path_to(page_name):
#     return django_url(
#         {
#           'the NSI home page': '/', 
#           'the about page': '/sobre',
#           'the projects page': '/projetos',
#           'the page list all current members': '/membros',
#           'the news page': '/noticias',
#           'the tools page': '/ferramentas',
#           'the tool page': '/ferramenta',
#           'page that list all former members': '/ex-membros',
#         }[page_name])


# Path: web_steps.py
import re
from lettuce import world, step
from should_dsl import should
from paths import path_to



@step(r'I fill in "(.*)" with "(.*)"')
def fill_field(step, label, value):
    world.browser.fill(label, value)

@step(r'I go to "(.+)"')
def i_go_to(step, page_name):

    world.browser.visit(path_to(page_name))