Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

consider adding config.click_by_js #420

Closed
yashaka opened this issue Aug 19, 2022 · 1 comment
Closed

consider adding config.click_by_js #420

yashaka opened this issue Aug 19, 2022 · 1 comment
Assignees

Comments

@yashaka
Copy link
Owner

yashaka commented Aug 19, 2022

No description provided.

@yashaka yashaka self-assigned this Aug 31, 2022
@yashaka
Copy link
Owner Author

yashaka commented Aug 31, 2022

    You might ask, why didn't we have config.click_by_js till now?
    Because making all clicks js based is not a "normal case".
    You might need to speed up all "set value" in your tests, but command.js.click will not speed up anything.
    Yet, sometimes, it might be useful as workaround.
    In such cases - it was considered a good practice to use

        element.perform(command.js.click)

    to achieve the goal in less concise way,
    thus, identifying by this "awkwardness" that it is really a workaround;)

Yet, the latter was pretty subjective... And one would like to hide such awkwardness via element.with_(click_by_js=True), so when we call element.click - it looks nicer :)

Hence.... Ok) let's add it)

yashaka added a commit that referenced this issue Aug 31, 2022
Reasoning...
In the past we considered a good practice to not hide js workarounds in context of clicking... the latter was pretty subjective... And one would like to hide such awkwardness via element.with_(click_by_js=True), so when we call element.click - it looks nicer :) – same way as we can do with type_by_js, set_value_by_js, etc.

TODO: cover with tests;)
- probably in same element__click_test.py, maybe grouping all click_by_js tests in a test class (as sub-test-suite)
  - there should be at least four positive tests with covered by overlay element, that cover:
    - Browser(Config(click_by_js=True)),
    - browser.with_(click_by_js=True),
    - browser.element('#second').with_(click_by_js=True).click()
    - browser.config.click_by_js = True (with teardown to reset this opt to default)
  - and probably one negative test, that fails to click on covered element, because by default click_by_js is False
@yashaka yashaka closed this as completed Sep 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant