Skip to content

Commit

Permalink
1. add MobileEmulationDeviceName configurable
Browse files Browse the repository at this point in the history
2. force DockerWebDriverTestCase to run one at a time.
  • Loading branch information
jumperchen committed Aug 24, 2023
1 parent 32a6469 commit 0b8e54e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@ test {
}
```

### How to specify MobileEmulationDeviceName in System Property
For example in Gradle,
```gradle
test {
systemProperty "MobileEmulationDeviceName", "iPad"
}
```
**Note:** The device name is `Nexus 7` by default, because `iPad` doesn't work since ChromeDriver 115+


**Note:** By default, it's Docker compose v2 since 1.0.10.2.
### How to release
1. Update the project `version` in `gradle.properties`
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version=1.0.11.1
version=1.0.11.2

# dependencies
junitVersion=5.10.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@
import com.palantir.docker.compose.DockerComposeExtension;
import com.palantir.docker.compose.connection.waiting.HealthChecks;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.junit.jupiter.api.parallel.ResourceLock;

/**
* A local Docker container to support a linux based remote WebDriver for
* Chrome. (Optional Edge and Firefox)
* @author jumperchen
*/
@ResourceLock("dockerResource")
public abstract class DockerWebDriverTestCase extends WebDriverTestCase {

// enable to use docker env.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ public abstract class TouchWebDriverTestCase extends DockerWebDriverTestCase {
@Override
protected final ChromeOptions getWebDriverOptions() {
return super.getWebDriverOptions()
.setExperimentalOption("mobileEmulation", Collections.singletonMap("deviceName", "iPad"));
.setExperimentalOption("mobileEmulation", Collections.singletonMap("deviceName",
System.getProperty("MobileEmulationDeviceName", "Nexus 7"))); // iPad not working for ChromeDriver 115+
}

protected PointerInput FINGER = new PointerInput(
Expand Down

0 comments on commit 0b8e54e

Please sign in to comment.