diff --git a/tests/actions/constants.py b/tests/actions/constants.py index 36ce7f8..854ef10 100644 --- a/tests/actions/constants.py +++ b/tests/actions/constants.py @@ -6,6 +6,7 @@ WAIT_OPTS = [None] SELECTORS = ("nothing", "tr.td::attr(something)") CLICK_OPTS = [None] +HAR_RECORDING = [False, True] def __gen_nav_opts(): diff --git a/tests/actions/test_actions.py b/tests/actions/test_actions.py index e3a36b4..3a86843 100644 --- a/tests/actions/test_actions.py +++ b/tests/actions/test_actions.py @@ -1,17 +1,18 @@ from pytest import mark from scrapypuppeteer.actions import GoTo, GoForward, GoBack, Click, Scroll from itertools import product -from constants import URLS, NAV_OPTS, WAIT_OPTS, SELECTORS, CLICK_OPTS +from constants import URLS, NAV_OPTS, WAIT_OPTS, SELECTORS, CLICK_OPTS, HAR_RECORDING def _gen_goto(): - for url, nav_opt, wait_opt in product(URLS, NAV_OPTS, WAIT_OPTS): + for url, nav_opt, wait_opt, har_recording in product(URLS, NAV_OPTS, WAIT_OPTS, HAR_RECORDING): expected = { "url": url, "navigationOptions": nav_opt, "waitOptions": wait_opt, + "harRecording": har_recording } - yield url, nav_opt, wait_opt, expected + yield url, nav_opt, wait_opt, har_recording, expected def _gen_back_forward(): @@ -43,8 +44,8 @@ def _gen_scroll(): @mark.parametrize("url, navigation_options, wait_options, expected", _gen_goto()) -def test_goto(url, navigation_options, wait_options, expected): - action = GoTo(url, navigation_options, wait_options) +def test_goto(url, navigation_options, wait_options, har_recording, expected): + action = GoTo(url, navigation_options, wait_options, har_recording) assert action.payload() == expected