Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
67a55a1
feat: implemented firefox driver, tests are failing somehow
vimscientist69 Jul 6, 2026
a555313
fix: fixed tests not working by fixing container networking configura…
vimscientist69 Jul 7, 2026
9d37fa7
fix: fixed firefox tests not passing by fixing types and firefox argu…
vimscientist69 Jul 8, 2026
8079608
refactor: refactored all tests to unified test suites, initiate for b…
vimscientist69 Jul 9, 2026
a301ef2
fix: fixed some linting issues, hopefully fixed all-tests workflow by…
vimscientist69 Jul 9, 2026
9d2b76a
fix: firefox driver fixed
vimscientist69 Jul 9, 2026
3234f15
refactor: standardize driver session methods, update FirefoxOptions v…
vimscientist69 Jul 9, 2026
116f680
refactor: update visibility of internal types and methods and add dei…
vimscientist69 Jul 9, 2026
2828ae0
dotfiles changes
vimscientist69 Jul 9, 2026
fbc5b09
fix: skip tests arg added, added test as compose service
vimscientist69 Jul 9, 2026
9fd885c
fixup! fix: skip tests arg added, added test as compose service
vimscientist69 Jul 9, 2026
e454ce1
feat: added se node max sessions env var
vimscientist69 Jul 9, 2026
b70880d
fixup! feat: added se node max sessions env var
vimscientist69 Jul 9, 2026
8f9080e
fixup! fixup! feat: added se node max sessions env var
vimscientist69 Jul 10, 2026
39795a4
fixup! fixup! fixup! feat: added se node max sessions env var
vimscientist69 Jul 10, 2026
a4f7836
fixup! fixup! fixup! fixup! feat: added se node max sessions env var
vimscientist69 Jul 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .dotfiles
Submodule .dotfiles updated 1 files
+3 −2 .swiftlint.yml
19 changes: 12 additions & 7 deletions .github/workflows/run-all-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,17 @@ name: Run All Tests
on:
pull_request:
paths:
- '**.swift'
- "**.swift"

jobs:
all-tests:
runs-on: ubuntu-latest

env:
PATH: "/usr/local/bin:/usr/bin:/bin"
SELENIUM_MAX_SESSIONS: "2"
SWIFT_TEST_WORKERS: "2"

steps:
- uses: actions/checkout@v4

Expand All @@ -19,15 +25,14 @@ jobs:
id: cache-build
uses: actions/cache@v3
with:
key: tests-build-cache-${{ hashFiles('Package.resolved') }}-${{ github.ref_name }}
path: ./.build
key: tests-build-cache-${{ hashFiles('Package.resolved') }}-${{ github.ref_name }}
path: ./.build

- name: Run All Tests
uses: GetAutomaApp/opensource-actions/swifttesting@main
with:
compose: "true"
required_healthy_services_docker_compose: '["selenium", "httpd"]'
compose_services_to_startup: '["selenium", "httpd"]'
required_healthy_services_docker_compose: '["selenium_chrome", "selenium_firefox", "httpd"]'
compose_services_to_startup: '["selenium_chrome", "selenium_firefox", "httpd"]'
tests-as-compose-service-name: "test"

env:
PATH: "/usr/local/bin:/usr/bin:/bin"
8 changes: 4 additions & 4 deletions Example/Sources/SeleniumSwiftExample/main.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Main.swift
// Copyright (c) 2025 GetAutomaApp
// main.swift
// Copyright (c) 2026 GetAutomaApp
// All source code and related assets are the property of GetAutomaApp.
// All rights reserved.

Expand All @@ -10,12 +10,12 @@ internal enum Main {
public static func main() async throws {
let chromeOption = ChromeOptions(
args: [
Args(.headless),
ChromeArgs(.headless),
]
)

let chromeDriver = try ChromeDriver(
driverURLString: "http://localhost:4444",
driverURLString: "http://selenium_chrome:4444",
browserObject: chromeOption
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
// SeleniumSwiftExampleTests.swift
// Copyright (c) 2025 GetAutomaApp
// Copyright (c) 2026 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 class Foundation.Bundle
import XCTest

internal enum SeleniumSwiftExample {}

public final class SeleniumSwiftExampleTests: XCTestCase {
public func testExample() throws {
// This is an example of a functional test case.
Expand Down
1 change: 0 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

import PackageDescription

/// A
public let package = Package(

Check warning on line 5 in Package.swift

View workflow job for this annotation

GitHub Actions / swiftlint

public declarations should be documented (missing_docs)

Check warning on line 5 in Package.swift

View workflow job for this annotation

GitHub Actions / swiftlint

public declarations should be documented (missing_docs)
name: "swift-webdriver",
platforms: [
.macOS(.v10_15),
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ docker-compose run test // Run Tests in Docker

# Testing on Host Machine
```bash
docker compose up selenium httpd -d
docker compose up selenium_chrome httpd -d
```
2. Run tests via test runner / `swift test`

Expand All @@ -47,7 +47,7 @@ docker compose up selenium httpd -d
```Swift
let chromeOption = ChromeOptions(
args: [
Args(.headless),
ChromeArgs(.headless),
]
)

Expand Down
6 changes: 3 additions & 3 deletions Sources/SwiftWebDriver/API/APIClient.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// APIClient.swift
// Copyright (c) 2025 GetAutomaApp
// Copyright (c) 2026 GetAutomaApp
// All source code and related assets are the property of GetAutomaApp.
// All rights reserved.

Expand Down Expand Up @@ -47,7 +47,7 @@ internal struct APIClient {
/// - `APIError.responseStatsFailed` if the status code indicates failure.
/// - `APIError.responseBodyIsNil` if no response body is returned.
/// - Any `DecodingError` if the response cannot be decoded.
public func request<R>(_ request: R) -> EventLoopFuture<R.Response> where R: RequestType {
public func request<R: RequestType>(_ request: R) -> EventLoopFuture<R.Response> {
httpClient.execute(request: request).flatMapResult { response -> Result<R.Response, Error> in
guard response.status == .ok else {
if
Expand Down Expand Up @@ -89,7 +89,7 @@ internal struct APIClient {
/// - `APIError.responseBodyIsNil` if no response body is returned.
/// - Any `DecodingError` if the response cannot be decoded.
@discardableResult
public func request<R>(_ request: R) async throws -> R.Response where R: RequestType {
public func request<R: RequestType>(_ request: R) async throws -> R.Response {
try await self.request(request).get()
}
}
2 changes: 1 addition & 1 deletion Sources/SwiftWebDriver/API/Request/ActionsPayload.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// ActionsPayload.swift
// Copyright (c) 2025 GetAutomaApp
// Copyright (c) 2026 GetAutomaApp
// All source code and related assets are the property of GetAutomaApp.
// All rights reserved.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// AnyEncodable.swift
// Copyright (c) 2025 GetAutomaApp
// Copyright (c) 2026 GetAutomaApp
// All source code and related assets are the property of GetAutomaApp.
// All rights reserved.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// DevToolTypes.swift
// Copyright (c) 2025 GetAutomaApp
// Copyright (c) 2026 GetAutomaApp
// All source code and related assets are the property of GetAutomaApp.
// All rights reserved.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// PostExecuteRequest.swift
// Copyright (c) 2025 GetAutomaApp
// Copyright (c) 2026 GetAutomaApp
// All source code and related assets are the property of GetAutomaApp.
// All rights reserved.

Expand Down
53 changes: 20 additions & 33 deletions Sources/SwiftWebDriver/API/Request/Elements/ElementsTypes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,45 +14,32 @@ public enum ElementsTypes {
/// such as `Enter`, `Return`, and `Tab`. They can be sent along with regular
/// text input to simulate keyboard events in browser automation.
public enum SendValueActionKeyTypes: String {
/// The **Enter** key (Unicode: `\u{E007}`).
///
/// Typically used to submit forms or trigger button actions in web pages.
case ENTER1 = "\u{E007}"

/// The **Return** key (Unicode: `\u{E006}`).
///
/// Often treated similarly to `Enter`, but provided as a separate code
/// for systems that distinguish between them.
case RETURN1 = "\u{E006}"

/// The **Tab** key (Unicode: `\u{E004}`).
///
/// Used to move focus between interactive elements (e.g., form fields) in a web page.
case TAB = "\u{E004}"

case NULL = "\u{E000}"
case CANCEL = "\u{E001}"
case HELP = "\u{E002}"
case ALT = "\u{E00A}"
case BACKSPACE = "\u{E003}"
case CANCEL = "\u{E001}"
case CLEAR = "\u{E005}"
case SHIFT = "\u{E008}"
case CONTROL = "\u{E009}"
case ALT = "\u{E00A}"
case PAUSE = "\u{E00B}"
case ESCAPE = "\u{E00C}"
case SPACE = "\u{E00D}"
case PAGE_UP = "\u{E00E}"
case PAGE_DOWN = "\u{E00F}"
case DELETE = "\u{E017}"
case DOWNARROW = "\u{E015}"
case END = "\u{E010}"
case ENTER1 = "\u{E007}"
case ESCAPE = "\u{E00C}"
case FKEY1 = "\u{E031}"
case FKEY2 = "\u{E032}"
case HELP = "\u{E002}"
case HOME = "\u{E011}"
case LEFT_ARROW = "\u{E012}"
case UP_ARROW = "\u{E013}"
case RIGHT_ARROW = "\u{E014}"
case DOWN_ARROW = "\u{E015}"
case INSERT = "\u{E016}"
case DELETE = "\u{E017}"
case F1 = "\u{E031}"
case F2 = "\u{E032}"
case LEFTARROW = "\u{E012}"
case NULL = "\u{E000}"
case PAGEDOWN = "\u{E00F}"
case PAGEUP = "\u{E00E}"
case PAUSE = "\u{E00B}"
case RETURN1 = "\u{E006}"
case RIGHTARROW = "\u{E014}"
case SHIFT = "\u{E008}"
case SPACE = "\u{E00D}"
case TAB = "\u{E004}"
case UPARROW = "\u{E013}"

/// The raw Unicode representation of the key.
///
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
// GetElementAttributeRequest.swift
// Copyright (c) 2025 GetAutomaApp
// Copyright (c) 2026 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 AsyncHTTPClient
import Foundation
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
// GetElementNamePropertyRequest.swift
// Copyright (c) 2025 GetAutomaApp
// Copyright (c) 2026 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 AsyncHTTPClient
import Foundation
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
// GetElementNameRequest.swift
// Copyright (c) 2025 GetAutomaApp
// Copyright (c) 2026 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 AsyncHTTPClient
import Foundation
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
// GetElementPropertyNameRequest.swift
// Copyright (c) 2025 GetAutomaApp
// Copyright (c) 2026 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 AsyncHTTPClient
import Foundation
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// GetElementRectRequest.swift
// Copyright (c) 2025 GetAutomaApp
// Copyright (c) 2026 GetAutomaApp
// All source code and related assets are the property of GetAutomaApp.
// All rights reserved.

Expand All @@ -25,7 +25,9 @@ internal struct GetElementRectRequest: RequestType {
public var elementId: String

/// Endpoint path for retrieving the element rectangle.
public var path: String { "session/\(sessionId)/element/\(elementId)/rect" }
public var path: String {
"session/\(sessionId)/element/\(elementId)/rect"
}

/// HTTP method used for this request (`GET`).
public var method: HTTPMethod = .GET
Expand All @@ -34,5 +36,7 @@ internal struct GetElementRectRequest: RequestType {
public var headers: HTTPHeaders = [:]

/// HTTP request body (none required for this request).
public var body: HTTPClient.Body? { nil }
public var body: HTTPClient.Body? {
nil
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
// GetElementScreenShotRequest.swift
// Copyright (c) 2025 GetAutomaApp
// Copyright (c) 2026 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 AsyncHTTPClient
import Foundation
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
// GetElementSelectedRequest.swift
// Copyright (c) 2025 GetAutomaApp
// Copyright (c) 2026 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 AsyncHTTPClient
import Foundation
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
// GetElementTextRequest.swift
// Copyright (c) 2025 GetAutomaApp
// Copyright (c) 2026 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 AsyncHTTPClient
import Foundation
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
// GetScreenShotRequest.swift
// Copyright (c) 2025 GetAutomaApp
// Copyright (c) 2026 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 AsyncHTTPClient
import Foundation
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
// GetSessionActiveElementRequest.swift
// Copyright (c) 2025 GetAutomaApp
// Copyright (c) 2026 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 Foundation

import AsyncHTTPClient
import Foundation
import NIO
import NIOHTTP1

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
// PostElementByIdRequest.swift
// Copyright (c) 2025 GetAutomaApp
// Copyright (c) 2026 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 AsyncHTTPClient
import Foundation
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
// PostElementClearRequest.swift
// Copyright (c) 2025 GetAutomaApp
// Copyright (c) 2026 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 AsyncHTTPClient
import Foundation
Expand Down
Loading
Loading