Skip to content

Commit

Permalink
fix: Failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Squidonomics committed Nov 29, 2023
1 parent 53b0029 commit 150162f
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions Tests/UnitTests/APIToRequestMappingTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -174,16 +174,25 @@ class APIToRequestMappingTests: XCTestCase {
let mockWebDriver = MockWebDriver()
let session = Session(webDriver: mockWebDriver, existingId: "mySession")
mockWebDriver.expect(path: "session/mySession/execute", method: .post)
try session.execute(javascript: "return document.body", args: [], async: false) {
XCTAssertEqual($0.javascript, "return document.body")
XCTAssertEqual($0.args, [])
XCTAssertEqual($0.async, true)
return CodableNone()
}
try session.execute(javascript: "return document.body", args: [], async: false)
XCTAssert(try session.execute(javascript: "return document.body", args: [], async: false) == (javascript: "return document.body", args: [], async: false))
}

func testSessionScriptAsync() throws {
let mockWebDriver = MockWebDriver()
let session = Session(webDriver: mockWebDriver, existingId: "mySession")
mockWebDriver.expect(path: "session/mySession/execute_async", method: .post)
mockWebDriver.expect(path: "session/mySession/execute_async", method: .post) {
XCTAssertEqual($0.javascript, "return document.body")
XCTAssertEqual($0.args, [])
XCTAssertEqual($0.async, true)
return CodableNone()
}
try session.execute(javascript: "return document.body", args: [], async: true)
XCTAssert(try session.execute(javascript: "return document.body", args: [], async: true) == (javascript: "return document.body", args: [], async: true))
}

func testWindow() throws {
Expand Down

0 comments on commit 150162f

Please sign in to comment.