'@case: HRM005
@description: Add a premade made staff to a Organisation
@TestDoc: https://docs.google.com/spreadsheet/ccc?key=0AmB3hMcgB-3idG1XNGhhRG9QWF81dUlKLXpJaFlCMFE
@Test Wiki: http://eden.sahanafoundation.org/wiki/DeveloperGuidelines/Testing'

def test_hrm005_add_staff_to_organization(self):

    browser = self.browser
    config = self.config
    self.login(account='admin', nexturl='org/organisation')
    self.dt_filter('Sri    Lanka    Red    Cross    Society')
    self.dt_action()
    url = browser.current_url
    url_parts = url.split('/')
    try:
        org_id = int(url_parts[(-2)])
    except:
        org_id = int(url_parts[(-1)])
    browser.get(('%s/org/organisation/%s/human_resource' % (config.url, org_id)))
    add_btn = self.browser.find_elements_by_id('show-add-btn')
    if (len(add_btn) > 0):
        add_btn[0].click()
    self.create('hrm_human_resource', [('site_id', 'Lori    (Facility)'), ('first_name', 'Herculano', 'pr_person'), ('last_name', 'Hugh', 'pr_person'), ('email', 'herculandfo@icandodfmybest.com', 'pr_person'), ('job_title_id', 'Secretary    General')])
