Browse Source
Merge pull request #8130 from smatvienko-tb/fix/ui-tests-stability-improvements
[3.5] UI tests stability improvements
pull/8139/head
Andrew Shvayka
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
10 additions and
6 deletions
-
msa/black-box-tests/src/test/java/org/thingsboard/server/msa/TestProperties.java
-
msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/base/AbstractBasePage.java
-
msa/black-box-tests/src/test/resources/docker-selenium.yml
|
|
|
@ -16,6 +16,7 @@ |
|
|
|
package org.thingsboard.server.msa; |
|
|
|
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.testcontainers.DockerClientFactory; |
|
|
|
|
|
|
|
import java.io.IOException; |
|
|
|
import java.io.InputStream; |
|
|
|
@ -41,7 +42,9 @@ public class TestProperties { |
|
|
|
|
|
|
|
public static String getBaseUiUrl() { |
|
|
|
if (instance.isActive()) { |
|
|
|
return "https://host.docker.internal"; |
|
|
|
//return "https://host.docker.internal" // this alternative requires docker-selenium.yml extra_hosts: - "host.docker.internal:host-gateway"
|
|
|
|
//return "https://" + DockerClientFactory.instance().dockerHostIpAddress(); //this alternative will get Docker IP from testcontainers
|
|
|
|
return "https://haproxy"; //communicate inside current docker-compose network to the load balancer container
|
|
|
|
} |
|
|
|
return getProperties().getProperty("tb.baseUiUrl"); |
|
|
|
} |
|
|
|
|
|
|
|
@ -32,9 +32,11 @@ import java.util.List; |
|
|
|
import java.util.Random; |
|
|
|
import java.util.UUID; |
|
|
|
import java.util.concurrent.ThreadLocalRandom; |
|
|
|
import java.util.concurrent.TimeUnit; |
|
|
|
|
|
|
|
@Slf4j |
|
|
|
abstract public class AbstractBasePage { |
|
|
|
public static final long WAIT_TIMEOUT = TimeUnit.SECONDS.toMillis(30); |
|
|
|
protected WebDriver driver; |
|
|
|
protected WebDriverWait wait; |
|
|
|
protected Actions actions; |
|
|
|
@ -43,7 +45,7 @@ abstract public class AbstractBasePage { |
|
|
|
|
|
|
|
public AbstractBasePage(WebDriver driver) { |
|
|
|
this.driver = driver; |
|
|
|
this.wait = new WebDriverWait(driver, Duration.ofMillis(8000)); |
|
|
|
this.wait = new WebDriverWait(driver, Duration.ofMillis(WAIT_TIMEOUT)); |
|
|
|
this.actions = new Actions(driver); |
|
|
|
this.js = (JavascriptExecutor) driver; |
|
|
|
} |
|
|
|
|
|
|
|
@ -31,7 +31,6 @@ services: |
|
|
|
SE_SCREEN_HEIGHT: 1080 |
|
|
|
SE_SCREEN_DEPTH: 24 |
|
|
|
SE_SCREEN_DPI: 74 |
|
|
|
extra_hosts: |
|
|
|
- "host.docker.internal:172.17.0.1" |
|
|
|
|
|
|
|
|
|
|
|
# Alternative way how to connect to the host address |
|
|
|
# extra_hosts: |
|
|
|
# - "host.docker.internal:host-gateway" |
|
|
|
|