-
-
Notifications
You must be signed in to change notification settings - Fork 761
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7b3ffc6
commit e2c20ee
Showing
6 changed files
with
160 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
src/e2eIosTest/java/io/appium/java_client/ios/IOSBiDiTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* See the NOTICE file distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.appium.java_client.ios; | ||
|
||
import org.junit.jupiter.api.Disabled; | ||
import org.junit.jupiter.api.Test; | ||
import org.openqa.selenium.bidi.log.LogEntry; | ||
import org.openqa.selenium.bidi.module.LogInspector; | ||
|
||
import java.util.concurrent.CopyOnWriteArrayList; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertFalse; | ||
|
||
public class IOSBiDiTest extends AppIOSTest { | ||
|
||
@Test | ||
@Disabled("Need to resolve compatibility issues") | ||
public void listenForIosLogs() { | ||
var logs = new CopyOnWriteArrayList<LogEntry>(); | ||
try (var logInspector = new LogInspector(driver)) { | ||
logInspector.onLog(logs::add); | ||
driver.getPageSource(); | ||
} | ||
assertFalse(logs.isEmpty()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
src/main/java/io/appium/java_client/remote/options/SupportsWebSocketUrlOption.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* See the NOTICE file distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.appium.java_client.remote.options; | ||
|
||
import org.openqa.selenium.Capabilities; | ||
|
||
import java.util.Optional; | ||
|
||
public interface SupportsWebSocketUrlOption<T extends BaseOptions<T>> extends | ||
Capabilities, CanSetCapability<T> { | ||
String WEB_SOCKET_URL = "webSocketUrl"; | ||
|
||
/** | ||
* Enable BiDi session support. | ||
* | ||
* @return self instance for chaining. | ||
*/ | ||
default T enableBiDi() { | ||
return amend(WEB_SOCKET_URL, true); | ||
} | ||
|
||
/** | ||
* Whether to enable BiDi session support. | ||
* | ||
* @return self instance for chaining. | ||
*/ | ||
default T setWebSocketUrl(boolean value) { | ||
return amend(WEB_SOCKET_URL, value); | ||
} | ||
|
||
/** | ||
* For input capabilities: whether enable BiDi session support is enabled. | ||
* For session creation response capabilities: BiDi web socket URL. | ||
* | ||
* @return If called on request capabilities if BiDi support is enabled for the driver session | ||
*/ | ||
default Optional<Object> getWebSocketUrl() { | ||
return Optional.ofNullable(getCapability(WEB_SOCKET_URL)); | ||
} | ||
} |