Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 2.9.5

- Feat: handle sms: schema in WKWebView

# 2.9.4

- Feat: use `Locale.current` as default value for `locale` param in `HCaptcha` constructor
Expand Down
10 changes: 10 additions & 0 deletions Example/HCaptcha.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
objects = {

/* Begin PBXBuildFile section */
43C25BC32E3FC51600AB0A36 /* TestTimeouts.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43C25BC22E3FC51600AB0A36 /* TestTimeouts.swift */; };
43C25BC42E3FC51600AB0A36 /* TestTimeouts.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43C25BC22E3FC51600AB0A36 /* TestTimeouts.swift */; };
50AC78913CD85915C922C6E7 /* Pods_HCaptcha_RxSwift_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 81A23EFF913417B4D093248E /* Pods_HCaptcha_RxSwift_Example.framework */; };
607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD51AFB9204008FA782 /* AppDelegate.swift */; };
607FACD81AFB9204008FA782 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD71AFB9204008FA782 /* ViewController.swift */; };
Expand All @@ -29,6 +31,7 @@
E651460F277A09C20079668A /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E65146042779E5380079668A /* Main.storyboard */; };
E6514610277A09C60079668A /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 607FACD91AFB9204008FA782 /* Main.storyboard */; };
E6586CCF2893DBCA0051EFE7 /* HCaptcha in Frameworks */ = {isa = PBXBuildFile; productRef = E6586CCE2893DBCA0051EFE7 /* HCaptcha */; };
E68790E12DF8C60900F2A70F /* TestURLOpener.swift in Sources */ = {isa = PBXBuildFile; fileRef = E68790E02DF8C60900F2A70F /* TestURLOpener.swift */; };
E6A23A0E2CEA1AC50071D531 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6A23A0C2CEA1AC50071D531 /* ViewController.swift */; };
E6A23A192CEA22190071D531 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD51AFB9204008FA782 /* AppDelegate.swift */; };
E6A23A1A2CEA29F40071D531 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDC1AFB9204008FA782 /* Assets.xcassets */; };
Expand Down Expand Up @@ -94,6 +97,7 @@
15BC45B776D109210F2FC581 /* Pods-HCaptcha_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HCaptcha_Tests.release.xcconfig"; path = "Target Support Files/Pods-HCaptcha_Tests/Pods-HCaptcha_Tests.release.xcconfig"; sourceTree = "<group>"; };
15CF87684AC2F129E32CC71E /* Pods-HCaptcha_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HCaptcha_Example.debug.xcconfig"; path = "Target Support Files/Pods-HCaptcha_Example/Pods-HCaptcha_Example.debug.xcconfig"; sourceTree = "<group>"; };
1CF662E463D56A0421D8A84A /* Pods-HCaptcha_RxSwift_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HCaptcha_RxSwift_Example.debug.xcconfig"; path = "Target Support Files/Pods-HCaptcha_RxSwift_Example/Pods-HCaptcha_RxSwift_Example.debug.xcconfig"; sourceTree = "<group>"; };
43C25BC22E3FC51600AB0A36 /* TestTimeouts.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestTimeouts.swift; sourceTree = "<group>"; };
4D10E8098B5018907486C310 /* Pods_HCaptcha_UIKit_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_HCaptcha_UIKit_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
607FACD01AFB9204008FA782 /* HCaptcha_RxSwift_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HCaptcha_RxSwift_Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
607FACD51AFB9204008FA782 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -128,6 +132,7 @@
E65145F12779AE830079668A /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
E65145FC2779AE850079668A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
E65146042779E5380079668A /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = "<group>"; };
E68790E02DF8C60900F2A70F /* TestURLOpener.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestURLOpener.swift; sourceTree = "<group>"; };
E6A239E62CEA15E50071D531 /* HCaptcha_UIKit_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HCaptcha_UIKit_Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
E6A23A0C2CEA1AC50071D531 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
E6A23A392CEA6D480071D531 /* HCaptcha_PassiveExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HCaptcha_PassiveExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
Expand Down Expand Up @@ -416,6 +421,8 @@
F2ECCF941EA00A4A0097B199 /* Helpers */ = {
isa = PBXGroup;
children = (
43C25BC22E3FC51600AB0A36 /* TestTimeouts.swift */,
E68790E02DF8C60900F2A70F /* TestURLOpener.swift */,
F2ECCF951EA00A5B0097B199 /* HCaptchaWebViewManager+Helpers.swift */,
9C766C7826CB814A00E0A592 /* HCaptchaConfig+Helpers.swift */,
F288E9441F9537760018688D /* HCaptchaError+Equatable.swift */,
Expand Down Expand Up @@ -978,6 +985,7 @@
buildActionMask = 2147483647;
files = (
F28FAC9F200E425600E14987 /* HCaptcha_UITests.swift in Sources */,
43C25BC32E3FC51600AB0A36 /* TestTimeouts.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -987,6 +995,7 @@
files = (
F2AE8612204F3430002E28D7 /* HCaptchaResult__Tests.swift in Sources */,
F2ECCF961EA00A5B0097B199 /* HCaptchaWebViewManager+Helpers.swift in Sources */,
43C25BC42E3FC51600AB0A36 /* TestTimeouts.swift in Sources */,
F2ECCF8E1E9FE68C0097B199 /* HCaptchaWebViewManager__Tests.swift in Sources */,
F231B3971FEC325A00F82943 /* DispatchQueue__Tests.swift in Sources */,
E64F97912895CD250044257C /* HCaptcha__Bench.swift in Sources */,
Expand All @@ -997,6 +1006,7 @@
F2ECCF8A1E9FCEFE0097B199 /* HCaptchaDecoder__Tests.swift in Sources */,
9C766C7926CB814A00E0A592 /* HCaptchaConfig+Helpers.swift in Sources */,
E62A74212771290A00973B5E /* HCaptcha__Config__Tests.swift in Sources */,
E68790E12DF8C60900F2A70F /* TestURLOpener.swift in Sources */,
9C5125BE26CB9A3A0094B023 /* HCaptchaWebViewManager__HTML__Tests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
16 changes: 8 additions & 8 deletions Example/HCaptcha_Tests/Core/DispatchQueue__Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class DispatchQueue__Tests: XCTestCase {
exp0.fulfill()
}

waitForExpectations(timeout: 1)
waitForExpectations(timeout: TestTimeouts.short)

// Does not execute first closure
let exp1 = expectation(description: "did call last closure")
Expand All @@ -43,7 +43,7 @@ class DispatchQueue__Tests: XCTestCase {
action: exp1.fulfill
)

waitForExpectations(timeout: 1)
waitForExpectations(timeout: TestTimeouts.short)
}

func test__Throttle_Context() {
Expand All @@ -57,7 +57,7 @@ class DispatchQueue__Tests: XCTestCase {
action: exp0.fulfill
)

waitForExpectations(timeout: 1)
waitForExpectations(timeout: TestTimeouts.short)

// Does not execute first closure
let exp1 = expectation(description: "execute on valid context")
Expand All @@ -81,7 +81,7 @@ class DispatchQueue__Tests: XCTestCase {
action: exp2.fulfill
)

waitForExpectations(timeout: 1)
waitForExpectations(timeout: TestTimeouts.short)
}

// MARK: Debounce
Expand All @@ -99,7 +99,7 @@ class DispatchQueue__Tests: XCTestCase {
XCTFail("Shouldn't be called")
}

waitForExpectations(timeout: 1)
waitForExpectations(timeout: TestTimeouts.short)

// Executes closure after previous has timed out
let exp1 = expectation(description: "did call closure")
Expand All @@ -110,7 +110,7 @@ class DispatchQueue__Tests: XCTestCase {
)
}

waitForExpectations(timeout: 3)
waitForExpectations(timeout: TestTimeouts.standard)
}

func test__Debounce_Context() {
Expand All @@ -137,7 +137,7 @@ class DispatchQueue__Tests: XCTestCase {
action: exp1.fulfill
)

waitForExpectations(timeout: 1)
waitForExpectations(timeout: TestTimeouts.short)

// Executes closure after previous has timed out
let exp2 = expectation(description: "did call closure")
Expand All @@ -149,7 +149,7 @@ class DispatchQueue__Tests: XCTestCase {
)
}

waitForExpectations(timeout: 5)
waitForExpectations(timeout: TestTimeouts.standard)
}

// MARK: Once
Expand Down
20 changes: 10 additions & 10 deletions Example/HCaptcha_Tests/Core/HCaptchaDecoder__Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class HCaptchaDecoder__Tests: XCTestCase {
let err = HCaptchaError.random()
decoder.send(error: err)

waitForExpectations(timeout: 1)
waitForExpectations(timeout: TestTimeouts.short)


// Check
Expand All @@ -69,7 +69,7 @@ class HCaptchaDecoder__Tests: XCTestCase {
let message = MockMessage(message: "foobar")
decoder.send(message: message)

waitForExpectations(timeout: 1)
waitForExpectations(timeout: TestTimeouts.short)


// Check
Expand All @@ -91,7 +91,7 @@ class HCaptchaDecoder__Tests: XCTestCase {
let message = MockMessage(message: ["action": "bar"])
decoder.send(message: message)

waitForExpectations(timeout: 1)
waitForExpectations(timeout: TestTimeouts.short)


// Check
Expand All @@ -113,7 +113,7 @@ class HCaptchaDecoder__Tests: XCTestCase {
let message = MockMessage(message: ["action": "showHCaptcha"])
decoder.send(message: message)

waitForExpectations(timeout: 1)
waitForExpectations(timeout: TestTimeouts.short)


// Check
Expand All @@ -136,7 +136,7 @@ class HCaptchaDecoder__Tests: XCTestCase {
let message = MockMessage(message: ["token": token])
decoder.send(message: message)

waitForExpectations(timeout: 1)
waitForExpectations(timeout: TestTimeouts.short)


// Check
Expand All @@ -158,7 +158,7 @@ class HCaptchaDecoder__Tests: XCTestCase {
let message = MockMessage(message: ["action": "didLoad"])
decoder.send(message: message)

waitForExpectations(timeout: 1)
waitForExpectations(timeout: TestTimeouts.short)


// Check
Expand All @@ -178,7 +178,7 @@ class HCaptchaDecoder__Tests: XCTestCase {
let message = MockMessage(message: ["error": 29])
decoder.send(message: message)

waitForExpectations(timeout: 1)
waitForExpectations(timeout: TestTimeouts.short)

// Check
XCTAssertEqual(result, .error(.failedSetup))
Expand All @@ -197,7 +197,7 @@ class HCaptchaDecoder__Tests: XCTestCase {
let message = MockMessage(message: ["error": 15])
decoder.send(message: message)

waitForExpectations(timeout: 1)
waitForExpectations(timeout: TestTimeouts.short)

// Check
XCTAssertEqual(result, .error(.sessionTimeout))
Expand All @@ -216,7 +216,7 @@ class HCaptchaDecoder__Tests: XCTestCase {
let message = MockMessage(message: ["error": 31])
decoder.send(message: message)

waitForExpectations(timeout: 1)
waitForExpectations(timeout: TestTimeouts.short)

// Check
XCTAssertEqual(result, .error(.rateLimit))
Expand All @@ -235,7 +235,7 @@ class HCaptchaDecoder__Tests: XCTestCase {
let message = MockMessage(message: ["error": 26])
decoder.send(message: message)

waitForExpectations(timeout: 1)
waitForExpectations(timeout: TestTimeouts.short)

// Check
XCTAssertEqual(result, .error(.wrongMessageFormat))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ extension HCaptchaWebViewManager__HTML__Tests: WKNavigationDelegate {
extension HCaptchaWebViewManager__HTML__Tests {
func waitForWebViewContent(manager: HCaptchaWebViewManager) {
manager.webView.navigationDelegate = self
wait(for: [webViewContentIsAvailable], timeout: 5)
wait(for: [webViewContentIsAvailable], timeout: TestTimeouts.standard)
}
}
Loading
Loading