-
-
Notifications
You must be signed in to change notification settings - Fork 60
update tab.py to fix some (but not all) of the tests that are failing from PR #55 #137
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
update tab.py to fix some (but not all) of the tests that are failing from PR #55 #137
Conversation
… time and bandwidth. (issue cdpdriver#44) (cdpdriver#68)
* add remove_handler, wait_for_load_page, - add remove_handler to stop listen to event - add expect_response, expect_response as in playwright-python - add wait_for_page_load to wait until page loaded * improve - fix `remove_handler` - improve `expect_*` - improve `RequestExpectation` * improve and format * Update .gitignore * change to re.fullmatch * Update connection.py * Update tab.py * Update CHANGELOG.md * Update CHANGELOG.md * add expect_download * format * fix conflict * Update CHANGELOG.md * Update zendriver/core/expect.py Co-authored-by: Stephan Lensky <[email protected]> * add test_expect_download * Update test_tab.py --------- Co-authored-by: Stephan Lensky <[email protected]>
* Update CDP models * Removed cdp.browser.PermissionType.FLASH from the removed permissions when granting *all* permissions since it was removed from CDP * Added changelog entry --------- Co-authored-by: Stephan Lensky <[email protected]>
* fix: allows tests to be run on windows (SIGUSR1 not supported) * fix: escape url pattern for regex, since windows uses backslash which makes it crash * fix: using forward slashes in file path since cdp always returns back forward slashes * run format + update changelogs * feat: run ci on windows * portable way to get chrome version (windows fix)
* fix: adding a missing chrome canary path * fix: adding a missing chrome canary path (changelogs) * fix: re-enabled --load-extension flag (disabled by default in Chrome 136+)
…lectorEventLoopPolicy` on Windows (cdpdriver#117) * feat: adding disable_asyncio_subprocess to use subprocess.Popen instead (for better support on Windows) * test and document with WindowsSelectorEventLoopPolicy * update changelogs * disable_asyncio_subprocess defaults to True on Windows * using subprocess.Popen for all platforms * apply format
…#128) * alternate method that supports special chars (e.g. emojis) * changelogs * replacing send_keys_with_special_chars with special_characters parameter in send_keys * Update CHANGELOG.md --------- Co-authored-by: Stephan Lensky <[email protected]>
…_up (cdpdriver#132) * feat: being able to choose scroll speed in Tab scroll_down and scroll_up * changelogs * fix: waiting for scroll + set speed in example to avoid loading multiple times --------- Co-authored-by: Stephan Lensky <[email protected]>
…er#135) * feat: add option to wait for promise in Element.apply method * Update element.py Co-authored-by: Stephan Lensky <[email protected]> * reorder doc --------- Co-authored-by: Stephan Lensky <[email protected]>
The reason I ran into |
…example to explicitly define `best_match`, readded `expect.py` which was missing from this branch.
I've re-added the |
Hello, thank you for the PR! Could you merge or rebase your branch on the current main one? It would make the review way easier, since files were moved (e.g. the |
This pull request was automatically closed because it has been inactive for 7 days since being marked as stale. |
Description
Specifically, this fixes
tests/bot_detection/test_browserscan.py
by changing the traversal order: Instead of checking the current node for a match before its children (pre-order traversal), we check the children first (post-order traversal). This ensures that if a match exists deeper in the DOM tree, it will be found before any of its ancestors.The other change that this makes is that it ignores matches of text nodes directly, instead letting the parent elements be the match. This is because we are interested in the element containing the text, not the text node itself.
Finally, I started work on fixing
tests/core/test_tab.py::test_find_finds_element_by_text
but haven't completed it yet. Specifically, I changed the ordering of parameters in functions that have the two new parameters. I movedtext
to be the first parameter, astest_tab.py
makes that assumption here:and I think that is a fair assumption to make.
Pre-merge Checklist
I have described my change in the section above.
I have ran the
./scripts/format.sh
and./scripts/lint.sh
scripts. My code is properly formatted and has no linting errors.I have added my change to CHANGELOG.md under the
[Unreleased]
section.