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

def test_hrm007_add_staff_participants(self):

    browser = self.browser
    config = self.config
    self.login(account='admin', nexturl='hrm/training_event')
    self.dt_filter('Ainaro    Branch    Office')
    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/hrm/training_event/%s/participant' % (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_training', [('person_id', 'Goku    Gohan')])
