test: add unit tests for keyword modules#473
Open
Dor-bl wants to merge 1 commit intoserhatbolsu:masterfrom
Open
test: add unit tests for keyword modules#473Dor-bl wants to merge 1 commit intoserhatbolsu:masterfrom
Dor-bl wants to merge 1 commit intoserhatbolsu:masterfrom
Conversation
- Add tests for _keyevent.py (100% coverage) - Add tests for _runonfailure.py (81% coverage) - Add tests for _screenshot.py (100% coverage) - Add tests for _screenrecord.py (57% coverage) - Add tests for _waiting.py (100% coverage) Improves overall test coverage from 33% to 39%
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Improves overall test coverage from 33% to 39%
Implements
This pull request adds comprehensive unit tests for several internal keyword classes in the AppiumLibrary, significantly improving test coverage for key functionalities such as key events, run-on-failure behavior, screen recording, screenshots, and waiting mechanisms. The new tests use Python's
unittestframework and extensive mocking to verify correct behavior under various scenarios, including edge cases and error handling.New Unit Test Coverage:
Key Event Keywords:
_KeyeventKeywords, coveringpress_keycodeandlong_press_keycodemethods, including handling of meta states and string-to-int conversion.Run-On-Failure Keywords:
_RunOnFailureKeywords, verifying registration, state transitions, disabling, and error reporting logic for run-on-failure keywords.Screen Recording Keywords:
_ScreenrecordKeywords, checking start/stop behavior, time limits, output format handling, prevention of duplicate recordings, and error handling for missing sessions.Screenshot Keywords:
_ScreenshotKeywords, ensuring correct screenshot capture with and without filenames, file saving, fallback mechanisms, subdirectory handling, and HTML embedding.Waiting Keywords:
_WaitingKeywords, covering sleep interval management, timeout formatting, and all major wait-until behaviors (element/text presence/absence), including error and edge cases.