Esempio n. 1
0
        sheet = book.add_worksheet()
        sheet.write(0, 0, 'requirementID')
        sheet.write(0, 1, 'Remarks')
        sheet.write(0, 2, 'Test Status')
        for rno, item in enumerate(cls.db.values(), start=1):
            sheet.write(rno, 0, item.id)
            sheet.write(rno, 1, item.remarks)
            result = 'Passed' if item.stat else 'Failed'
            sheet.write(rno, 2, result)

    def __repr__(self):
        return f'id:{self.id},stat={self.stat}\n remarks:\n{self.remarks}'


if 'node_list' not in globals():
    nodes = gm_get_nodes(lg_info['username'], lg_info['password'], nodeid,
                         nodename)
    node_list = [value for key, value in nodes.items()]
with session() as c:
    c.post("http://10.58.199.163:8025/testlink-1.9.16/login.php", data=payload)
    len_skip_db = len(testcase.db)
    if len_skip_db == 0:
        for i in range(5, sheet.nrows):
            internal_id = sheet.cell(i, 1).value
            internal_id = internal_id[:internal_id.find(':')]
            stat = sheet.cell(i, 6).value
            for index, item in enumerate(node_list):
                if item.internal_id == internal_id:
                    testcase(node_list.pop(index), stat)
                    break
    else:
        skip_list = testcase.skip_db
Esempio n. 2
0
                              node_list[index].name)


def write_data(spec):
    global rno, sheet
    for tcase in spec.testcases:
        sheet.write(rno, 0, tcase.externalID)
        sheet.write(rno, 1, tcase.cfield_data['TestCaseID'])
        sheet.write(rno, 2, tcase.cfield_data['Requirement_ID'])
        sheet.write(rno, 3, tcase.cfield_data['Test Classification'])
        sheet.write(rno, 4, tcase.cfield_data['ASIL Level'])
        rno += 1


if 'nodes' not in globals():
    nodes = gm_get_nodes(payload['tl_login'], payload['tl_password'], nodeid,
                         nodename)
    node_list = [value for key, value in nodes.items()]
skip_list = []
with session() as c:
    c.post("http://10.58.199.163:8025/testlink-1.9.16/login.php", data=payload)
    while idx < len(node_list):
        if node_list[idx].tcase:
            suite = nodes[node_list[idx].parent]
            if suite.nof_children < 25:
                exp_payload["containerID"] = suite.node_id
                rsp = c.post(exp_url, params=exp_payload)
                if rsp.text == '':
                    try:
                        idx = buildTestSpec()
                        write_data(testSpec)
                    except Exception as e:
Esempio n. 3
0
    browser.get(
        'http://10.58.199.163:8025/testlink-1.9.16/lib/testcases/tcEdit.php?testcase_id={}&tcversion_id={}&has_been_executed=0&doAction=edit&show_mode=&edit_tc=Edit&containerID={}'
        .format(nid, tcvid, pid))
    req = browser.find_element_by_id("custom_field_0_2")
    if (req.get_attribute('value').find(new_req) == -1):
        req.send_keys(',' + new_req)
    alevel = browser.find_element_by_id("custom_field_0_3")
    if (alevel.get_attribute('value') == ""):
        alevel.send_keys(asil)
    browser.find_element_by_xpath('//*[@id="do_update_bottom"]').click()
    wait.until_not(
        EC.visibility_of_element_located((By.ID, "do_update_bottom")))


#%%
tl_nodes = gm_get_nodes(lg_info['username'], lg_info['password'], node_id,
                        'HW-SW')
node_list = list(filter(lambda x: x.tcase, tl_nodes))
#%%
browser = webdriver.Firefox()
wait = WebDriverWait(browser, 10)
login()
for index, tc in enumerate(node_list):
    if (sheet.cell(index, 1).value != ""):
        tc_vid = get_tcvid(tc.node_id)
        create_new_version(tc.node_id, tc_vid)
        tc_vid = get_tcvid(tc.node_id)
        edit_cfield(tc.node_id, tc_vid, tc.parent,
                    sheet.cell(index, 1).value, 'B(B)')

#%%
#browser = webdriver.Firefox()