Skip to content

Commit

Permalink
Fix typo and cleanup comments. No code change. (#154)
Browse files Browse the repository at this point in the history
* Fix typo.
* Add periods to keep comment style consistent.
  • Loading branch information
jeffdav authored Jul 31, 2024
1 parent 34d6a32 commit c321473
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions Sources/WebDriver/Session.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public class Session {
}
}
}

public var location: Location {
get throws {
let response = try webDriver.send(Requests.SessionLocation.Get(session: id))
Expand Down Expand Up @@ -302,7 +302,7 @@ public class Session {
session: id, action: .buttonUp, button: button))
}

/// Clicks one of the mouse buttons
/// Clicks one of the mouse buttons.
/// - Parameter button: The button to be clicked.
public func click(button: MouseButton = .left) throws {
try webDriver.send(Requests.SessionButton(
Expand Down Expand Up @@ -356,50 +356,50 @@ public class Session {
try webDriver.send(Requests.SessionKeys(session: id, value: value))
}

/// Change focus to another window
/// - Parameter name: The window to change focus to
/// Change focus to another window.
/// - Parameter name: The window to change focus to.
public func focus(window name: String) throws {
try webDriver.send(Requests.SessionWindow.Post(session: id, name: name))
}

/// Close selected window
/// - Parameter name: The selected window to close
/// Close selected window.
/// - Parameter name: The selected window to close.
public func close(window name: String) throws {
try webDriver.send(Requests.SessionWindow.Delete(session: id, name: name))
}

public func window(handle: String) throws -> Window { .init(session: self, handle: handle) }

/// - Prarmeter: Orientation the window will flip to {LANDSCAPE|PORTRAIT}
/// - Parameter: Orientation the window will flip to {LANDSCAPE|PORTRAIT}.
public func setOrientation(_ value: ScreenOrientation) throws {
try webDriver.send(Requests.SessionOrientation.Post(session: id, orientation: value))
}

/// Get the current page source
/// Get the current page source.
public var source: String {
get throws {
try webDriver.send(Requests.SessionSource(session: id)).value
}
}
/// - Returns: Current window handle

/// - Returns: Current window handle.
public var windowHandle: String {
get throws {
let response = try webDriver.send(Requests.SessionWindowHandle(session: id))
return response.value
}
}

/// Set the current geolocation
/// Set the current geolocation.
public func setLocation(_ location: Location) throws {
try webDriver.send(Requests.SessionLocation.Post(session: id, location: location))
}

public func setLocation(latitude: Double, longitude: Double, altitude: Double) throws {
try setLocation(Location(latitude: latitude, longitude: longitude, altitude: altitude))
public func setLocation(latitude: Double, longitude: Double, altitude: Double) throws {
try setLocation(Location(latitude: latitude, longitude: longitude, altitude: altitude))
}

/// - Returns: Array of window handles
/// - Returns: Array of window handles.
public var windowHandles: [String] {
get throws {
let response = try webDriver.send(Requests.SessionWindowHandles(session: id))
Expand Down

0 comments on commit c321473

Please sign in to comment.