Skip to content

ISSUE-31 - Implement Standardized type-safe SeleniumErrors #32

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

Merged
merged 8 commits into from
Apr 13, 2025

Conversation

AdonisCodes
Copy link

@AdonisCodes AdonisCodes commented Apr 10, 2025

Reason

The Library currently doesn't support an easy way to recognize what type of exceptions are being thrown. This PR implements a similar concept to how alamofire adds an extension onto the generic error object to try and identify what type of error it is. This PR also touches all the tests that are looking for a specific exception type.

Tech Details List

  • Implements isSeleniumError(ofType: SeleniumErrorType) -> Bool that validates if an error is a specific type
  • Implements asSeleniumError(ofType: SeleniumErrorType) -> SeleniumError? that returns a SeleniumError if the condition is met
  • Implements a public enum SeleniumErrorType mapping error values
  • Enhances all tests that checks for SeleniumError to also validate the error type that was thrown

Tasks:

  • Document testing Instructions
  • Refactor tests to check error type as well

Links:

ISSUE-31
resolves #31

Testing

  • Ensure unit tests pass

@AdonisCodes AdonisCodes linked an issue Apr 10, 2025 that may be closed by this pull request
@vimscientist69
Copy link

The tasks above, are they completed? Are they important for this pull request?

Copy link

@vimscientist69 vimscientist69 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall. Make a commit to fix return false blocks to be on separate lines.

@AdonisCodes AdonisCodes marked this pull request as ready for review April 13, 2025 13:55
@AdonisCodes AdonisCodes merged commit 86dd175 into master Apr 13, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request v0.2.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Standardized + Type Safe Errors
2 participants