-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
62e940c
commit 5adfb2d
Showing
8 changed files
with
78 additions
and
111 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
15 changes: 8 additions & 7 deletions
15
Sources/WebDriver/ElementNotFoundError.swift → Sources/WebDriver/NoSuchElementError.swift
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,20 @@ | ||
public struct ElementNotFoundError: Error { | ||
/// Thrown when findElement fails to locate an element. | ||
public struct ElementNotFoundError: Error, CustomStringConvertible { | ||
/// The locator that was used to search for the element. | ||
public var locator: ElementLocator | ||
|
||
/// A human-readable description of the element. | ||
public var description: String? | ||
|
||
/// The error that caused the element to not be found. | ||
public var sourceError: Error | ||
|
||
public init(locator: ElementLocator, description: String? = nil, sourceError: Error) { | ||
public init(locator: ElementLocator, sourceError: Error) { | ||
self.locator = locator | ||
self.description = description | ||
self.sourceError = sourceError | ||
} | ||
|
||
/// The error response returned by the WebDriver server, if this was the source of the failure. | ||
public var errorResponse: ErrorResponse? { sourceError as? ErrorResponse } | ||
} | ||
|
||
public var description: String { | ||
"Element not found using locator [\(locator.using)=\(locator.value)]: \(sourceError)" | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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