From da1479a991c5f334c4e1dec43714c085c123877f Mon Sep 17 00:00:00 2001 From: AdonisCodes Date: Tue, 1 Apr 2025 08:10:32 -0600 Subject: [PATCH 1/6] feat: fixes --- Example/Package.swift | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Example/Package.swift b/Example/Package.swift index c9e34ef..579a9f7 100644 --- a/Example/Package.swift +++ b/Example/Package.swift @@ -9,7 +9,7 @@ let package = Package( .macOS(.v12), ], dependencies: [ - .package(name: "SwiftWebDriver", path: "../"), + .package(url: "https://github.com/GetAutomaApp/SwiftWebDriver.git", branch: "master") ], targets: [ .executableTarget( diff --git a/README.md b/README.md index 6d18bd4..e642019 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Adding the dependency Add the following entry in your Package.swift to start using SwiftWebDriver: ```swift -.package(url: "https://github.com/GetAutomaApp/SwiftWebDriver.git", branch: "master) +.package(url: "https://github.com/GetAutomaApp/SwiftWebDriver.git", branch: "master") ``` and add dependency to your target: From c8ed2acf5b97d6cb08e140ad2d957d7d629bbf6c Mon Sep 17 00:00:00 2001 From: AdonisCodes Date: Tue, 1 Apr 2025 08:36:42 -0600 Subject: [PATCH 2/6] test --- Example/Package.resolved | 31 +++++++++- Example/Package.swift | 2 +- .../Sources/SeleniumSwiftExample/main.swift | 62 +++++++++---------- 3 files changed, 61 insertions(+), 34 deletions(-) diff --git a/Example/Package.resolved b/Example/Package.resolved index 966fff3..7b8bbf0 100644 --- a/Example/Package.resolved +++ b/Example/Package.resolved @@ -45,6 +45,24 @@ "version" : "1.1.4" } }, + { + "identity" : "swift-http-structured-headers", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-http-structured-headers.git", + "state" : { + "revision" : "8e769facea6b7d46ea60e5e93635a384fd573480", + "version" : "1.2.1" + } + }, + { + "identity" : "swift-http-types", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-http-types.git", + "state" : { + "revision" : "ef18d829e8b92d731ad27bb81583edd2094d1ce3", + "version" : "1.3.1" + } + }, { "identity" : "swift-log", "kind" : "remoteSourceControl", @@ -68,8 +86,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio-extras.git", "state" : { - "revision" : "fb70a0f5e984f23be48b11b4f1909f3bee016178", - "version" : "1.19.1" + "revision" : "00f3f72d2f9942d0e2dc96057ab50a37ced150d4", + "version" : "1.25.0" } }, { @@ -116,6 +134,15 @@ "revision" : "a34201439c74b53f0fd71ef11741af7e7caf01e1", "version" : "1.4.2" } + }, + { + "identity" : "swiftwebdriver", + "kind" : "remoteSourceControl", + "location" : "https://github.com/GetAutomaApp/SwiftWebDriver.git", + "state" : { + "branch" : "master", + "revision" : "000f8fce2c2383aadc2d85f7d723a1f124b0d00f" + } } ], "version" : 2 diff --git a/Example/Package.swift b/Example/Package.swift index 579a9f7..ac2034a 100644 --- a/Example/Package.swift +++ b/Example/Package.swift @@ -9,7 +9,7 @@ let package = Package( .macOS(.v12), ], dependencies: [ - .package(url: "https://github.com/GetAutomaApp/SwiftWebDriver.git", branch: "master") + .package(url: "https://github.com/GetAutomaApp/SwiftWebDriver.git", from: "0.2.0") ], targets: [ .executableTarget( diff --git a/Example/Sources/SeleniumSwiftExample/main.swift b/Example/Sources/SeleniumSwiftExample/main.swift index c728eb3..44e9778 100644 --- a/Example/Sources/SeleniumSwiftExample/main.swift +++ b/Example/Sources/SeleniumSwiftExample/main.swift @@ -1,36 +1,36 @@ -// main.swift -// Copyright (c) 2025 GetAutomaApp -// All source code and related assets are the property of GetAutomaApp. -// All rights reserved. -// -// This package is freely distributable under the MIT license. -// This Package is a modified fork of https://github.com/ashi-psn/SwiftWebDriver. +// // main.swift +// // Copyright (c) 2025 GetAutomaApp +// // All source code and related assets are the property of GetAutomaApp. +// // All rights reserved. +// // +// // This package is freely distributable under the MIT license. +// // This Package is a modified fork of https://github.com/ashi-psn/SwiftWebDriver. -import SwiftWebDriver +// import SwiftWebDriver -let chromeOption = try ChromeOptions( - args: [ - Args(.headless), - ] -) +// let chromeOption = try ChromeOptions( +// args: [ +// Args(.headless), +// ] +// ) -let chromeDriver = try ChromeDriver( - driverURLString: "http://localhost:9515", - browserObject: chromeOption -) +// let chromeDriver = try ChromeDriver( +// driverURLString: "http://localhost:9515", +// browserObject: chromeOption +// ) -let driver = WebDriver( - driver: chromeDriver -) +// let driver = WebDriver( +// driver: chromeDriver +// ) -Task.detached { - do { - let status = try await driver.status() - print(status) - let sessionId = try await driver.start() - print(sessionId) - try await driver.stop() - } catch { - print(error) - } -} +// Task.detached { +// do { +// let status = try await driver.status() +// print(status) +// let sessionId = try await driver.start() +// print(sessionId) +// try await driver.stop() +// } catch { +// print(error) +// } +// } From e6079b4bb1153a5c64d1bb8c77e22f970c2498a6 Mon Sep 17 00:00:00 2001 From: AdonisCodes Date: Wed, 2 Apr 2025 07:27:36 -0600 Subject: [PATCH 3/6] fix --- Package.resolved | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Package.resolved b/Package.resolved index ec5b7b1..ef785c1 100644 --- a/Package.resolved +++ b/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "991c442680adc239891b03e66c20788a5c85d7ceb2fe27ef352a9002f745bec7", + "originHash" : "f6e3329a72ca132d61529b0e892c85e620494b917a584a8e8412b3ea9c02855a", "pins" : [ { "identity" : "async-http-client", @@ -25,7 +25,7 @@ "location" : "https://github.com/GetAutomaApp/swift-any-codable.git", "state" : { "branch" : "main", - "revision" : "10e1be7ea48a0bc3a6eff01a117cc8cafd4dd0e2" + "revision" : "70b85d4dc84a71370b4ee18140388aff378389d3" } }, { From da3121fed60e92e07e28ec0a432cd8b2223b6f1d Mon Sep 17 00:00:00 2001 From: AdonisCodes Date: Wed, 2 Apr 2025 07:28:11 -0600 Subject: [PATCH 4/6] fix package resolve --- Example/Package.resolved | 8 ++++---- Package.resolved | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Example/Package.resolved b/Example/Package.resolved index 7b8bbf0..570c208 100644 --- a/Example/Package.resolved +++ b/Example/Package.resolved @@ -23,8 +23,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/GetAutomaApp/swift-any-codable.git", "state" : { - "branch" : "main", - "revision" : "7905b4c8bf6aaee39ba6bed715deee6a99839d1a" + "revision" : "10e1be7ea48a0bc3a6eff01a117cc8cafd4dd0e2", + "version" : "1.0.2" } }, { @@ -140,8 +140,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/GetAutomaApp/SwiftWebDriver.git", "state" : { - "branch" : "master", - "revision" : "000f8fce2c2383aadc2d85f7d723a1f124b0d00f" + "revision" : "bbc35781fe30bfaa1dc8ca57fb3eb7c603bf6583", + "version" : "0.2.1" } } ], diff --git a/Package.resolved b/Package.resolved index ef785c1..c1eef21 100644 --- a/Package.resolved +++ b/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "f6e3329a72ca132d61529b0e892c85e620494b917a584a8e8412b3ea9c02855a", + "originHash" : "d4a26a5c94eaff56111cd94951b6d365f68202f4571faf25c762433afc21823c", "pins" : [ { "identity" : "async-http-client", @@ -24,8 +24,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/GetAutomaApp/swift-any-codable.git", "state" : { - "branch" : "main", - "revision" : "70b85d4dc84a71370b4ee18140388aff378389d3" + "revision" : "10e1be7ea48a0bc3a6eff01a117cc8cafd4dd0e2", + "version" : "1.0.2" } }, { From c2a6316726e8bd38bca5b47b7d22f8214e06bb11 Mon Sep 17 00:00:00 2001 From: AdonisCodes Date: Wed, 2 Apr 2025 07:32:54 -0600 Subject: [PATCH 5/6] fix: revert example test file --- .../Sources/SeleniumSwiftExample/main.swift | 62 +++++++++---------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/Example/Sources/SeleniumSwiftExample/main.swift b/Example/Sources/SeleniumSwiftExample/main.swift index 44e9778..c728eb3 100644 --- a/Example/Sources/SeleniumSwiftExample/main.swift +++ b/Example/Sources/SeleniumSwiftExample/main.swift @@ -1,36 +1,36 @@ -// // main.swift -// // Copyright (c) 2025 GetAutomaApp -// // All source code and related assets are the property of GetAutomaApp. -// // All rights reserved. -// // -// // This package is freely distributable under the MIT license. -// // This Package is a modified fork of https://github.com/ashi-psn/SwiftWebDriver. +// main.swift +// Copyright (c) 2025 GetAutomaApp +// All source code and related assets are the property of GetAutomaApp. +// All rights reserved. +// +// This package is freely distributable under the MIT license. +// This Package is a modified fork of https://github.com/ashi-psn/SwiftWebDriver. -// import SwiftWebDriver +import SwiftWebDriver -// let chromeOption = try ChromeOptions( -// args: [ -// Args(.headless), -// ] -// ) +let chromeOption = try ChromeOptions( + args: [ + Args(.headless), + ] +) -// let chromeDriver = try ChromeDriver( -// driverURLString: "http://localhost:9515", -// browserObject: chromeOption -// ) +let chromeDriver = try ChromeDriver( + driverURLString: "http://localhost:9515", + browserObject: chromeOption +) -// let driver = WebDriver( -// driver: chromeDriver -// ) +let driver = WebDriver( + driver: chromeDriver +) -// Task.detached { -// do { -// let status = try await driver.status() -// print(status) -// let sessionId = try await driver.start() -// print(sessionId) -// try await driver.stop() -// } catch { -// print(error) -// } -// } +Task.detached { + do { + let status = try await driver.status() + print(status) + let sessionId = try await driver.start() + print(sessionId) + try await driver.stop() + } catch { + print(error) + } +} From 22ebea94ab7f296d7a07c7156437b3266f391a27 Mon Sep 17 00:00:00 2001 From: AdonisCodes Date: Wed, 2 Apr 2025 07:34:25 -0600 Subject: [PATCH 6/6] fix: remove preconcurrency statement --- Sources/SwiftWebDriver/API/APIClient.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/SwiftWebDriver/API/APIClient.swift b/Sources/SwiftWebDriver/API/APIClient.swift index 21f28b5..4d246b2 100644 --- a/Sources/SwiftWebDriver/API/APIClient.swift +++ b/Sources/SwiftWebDriver/API/APIClient.swift @@ -10,7 +10,7 @@ import AsyncHTTPClient import Foundation import NIO import NIOFoundationCompat -@preconcurrency import NIOHTTP1 +import NIOHTTP1 enum APIResponseError: Error, Codable { case massage