Skip to content

Commit

Permalink
tests fix
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewKorzh committed Aug 5, 2024
1 parent 1f1bfba commit 0cb8697
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions tests/actions/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
WAIT_OPTS = [None]
SELECTORS = ("nothing", "tr.td::attr(something)")
CLICK_OPTS = [None]
HAR_RECORDING = [False, True]


def __gen_nav_opts():
Expand Down
11 changes: 6 additions & 5 deletions tests/actions/test_actions.py
Original file line number Diff line number Diff line change
@@ -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():
Expand Down Expand Up @@ -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


Expand Down

0 comments on commit 0cb8697

Please sign in to comment.