def expense_list_has_payment(context, has_or_not, title, payer, amount): title = title if title != 'n/a' else '' payer = payer if payer != 'n/a' else '' amount = amount if amount != 'n/a' else '' elp = ExpenseListPage(context.browser) if has_or_not == 'has': assert elp.list_row_is_present([ title, payer, amount ]), 'Row with ' + str([title, payer, amount]) + ' is not present' else: assert not elp.list_row_is_present([ title, payer, amount ]), 'Row with ' + str([title, payer, amount]) + ' is present'
def run(self, testData): self.driver.get('http://localhost:3000') expenseList = ExpenseListPage(self.driver) expenseList.open_select_dropdown('filter') f_text = testData[0] exp_rows = testData[1] expenseList.select_value_in_select_dropdown('filter', f_text) assert expenseList.get_select_dropdown_value( 'filter') == f_text, expenseList.get_select_dropdown_value( 'filter') + '!=' + f_text assert expenseList.get_number_of_visible_rows() == len(exp_rows), str( expenseList.get_number_of_visible_rows()) + '!=' + str( len(exp_rows)) for exp_row in exp_rows: assert expenseList.list_row_is_present(exp_row)
def run(self, testData): self.driver.get('http://localhost:3000') expenseList = ExpenseListPage(self.driver) assert expenseList.list_row_is_present(testData)
def validate_incorrect_expense(self, testData): expenseList = ExpenseListPage(self.driver) assert not expenseList.list_row_is_present(testData[0]), 'Invalid expense was added to list: ' + str(testData[0]) assert expenseList.get_number_of_visible_rows() == testData[1], 'New expense was added'
def validate_correct_expense(self, testData): expenseList = ExpenseListPage(self.driver) assert expenseList.list_row_is_present(testData), 'Correct expense was not added to list: ' + str(testData)