def test_calculate_parking_negative_flow(browser, form_data: FormData,
                                         expected_cost, expected_duration):
    calc_page = CalculatorPage(browser)
    calc_page.open()
    calc_page.fill_calculator(form_data)
    calc_page.calculate_button().click()

    assert expected_cost in calc_page.final_cost()
    assert expected_duration in calc_page.final_cost()
def test_calculate_parking_positive_flow(browser, form_data: FormData,
                                         expected_cost_method,
                                         expected_duration):
    calc_page = CalculatorPage(browser)
    calc_page.open()
    calc_page.fill_calculator(form_data)
    calc_page.calculate_button().click()

    if form_data.delay > 0:
        assert "0" in calc_page.final_cost()
        time.sleep(form_data.delay / 1000)

    assert expected_cost_method(form_data) in calc_page.final_cost()

    assert expected_duration in calc_page.final_cost()