adding default params to e2e checks (#603)
* adding default params to e2e checks * adding ci defaults as .env.ci Co-authored-by: marat <ttx013@gmail.com>
This commit is contained in:
parent
aa46749778
commit
551b99702e
6 changed files with 22 additions and 9 deletions
2
.github/workflows/backend.yml
vendored
2
.github/workflows/backend.yml
vendored
|
@ -20,7 +20,7 @@ jobs:
|
|||
- name: Set the values
|
||||
id: step_one
|
||||
run: |
|
||||
cat "./kafka-ui-e2e-checks/.env.example" >> "./kafka-ui-e2e-checks/.env"
|
||||
cat "./kafka-ui-e2e-checks/.env.ci" >> "./kafka-ui-e2e-checks/.env"
|
||||
- name: pull docker
|
||||
id: step_four
|
||||
run: |
|
||||
|
|
3
kafka-ui-e2e-checks/.env.ci
Normal file
3
kafka-ui-e2e-checks/.env.ci
Normal file
|
@ -0,0 +1,3 @@
|
|||
USE_LOCAL_BROWSER=false
|
||||
SHOULD_START_SELENOID=true
|
||||
TURN_OFF_SCREENSHOTS=true
|
|
@ -1,3 +1,3 @@
|
|||
USE_LOCAL_BROWSER=false
|
||||
SHOULD_START_SELENOID=true
|
||||
USE_LOCAL_BROWSER=true
|
||||
SHOULD_START_SELENOID=false
|
||||
TURN_OFF_SCREENSHOTS=true
|
||||
|
|
|
@ -9,6 +9,7 @@ import io.github.cdimascio.dotenv.Dotenv;
|
|||
import io.qameta.allure.selenide.AllureSelenide;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.DisplayNameGeneration;
|
||||
import org.openqa.selenium.remote.DesiredCapabilities;
|
||||
|
@ -17,6 +18,7 @@ import org.testcontainers.containers.GenericContainer;
|
|||
import org.testcontainers.utility.DockerImageName;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
|
||||
@Slf4j
|
||||
|
@ -48,9 +50,15 @@ public class BaseTest {
|
|||
"-conf", "/etc/selenoid/browsers.json", "-log-output-dir", "/opt/selenoid/logs");
|
||||
|
||||
static {
|
||||
if (new File("./.env").exists()) {
|
||||
Dotenv.load().entries().forEach(env -> System.setProperty(env.getKey(), env.getValue()));
|
||||
if (!new File("./.env").exists()) {
|
||||
try {
|
||||
FileUtils.copyFile(new File(".env.example"), new File(".env"));
|
||||
} catch (IOException e) {
|
||||
log.error("couldn't copy .env.example to .env. Please add .env");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
Dotenv.load().entries().forEach(env -> System.setProperty(env.getKey(), env.getValue()));
|
||||
if (TestConfiguration.CLEAR_REPORTS_DIR) {
|
||||
clearReports();
|
||||
}
|
||||
|
|
|
@ -38,6 +38,8 @@ public class Screenshooter {
|
|||
Boolean.parseBoolean(System.getProperty("SHOULD_SAVE_SCREENSHOTS_IF_NOT_EXIST", "true"));
|
||||
private static boolean TURN_OFF_SCREENSHOTS =
|
||||
Boolean.parseBoolean(System.getProperty("TURN_OFF_SCREENSHOTS", "false"));
|
||||
private static boolean USE_LOCAL_BROWSER =
|
||||
Boolean.parseBoolean(System.getProperty("USE_LOCAL_BROWSER", "false"));
|
||||
|
||||
private File newFile(String name) {
|
||||
var file = new File(name);
|
||||
|
@ -58,7 +60,9 @@ public class Screenshooter {
|
|||
|
||||
@SneakyThrows
|
||||
public void compareScreenshots(String name, boolean shouldUpdateScreenshotIfDiffer) {
|
||||
if (TURN_OFF_SCREENSHOTS) {
|
||||
if (TURN_OFF_SCREENSHOTS || USE_LOCAL_BROWSER) {
|
||||
log.warn("compareScreenshots turned off due TURN_OFF_SCREENSHOTS || USE_LOCAL_BROWSER: %b || %b"
|
||||
.formatted(TURN_OFF_SCREENSHOTS,USE_LOCAL_BROWSER));
|
||||
return;
|
||||
}
|
||||
if (!doesScreenshotExist(name)) {
|
||||
|
|
|
@ -4,9 +4,7 @@ import com.provectus.kafka.ui.base.BaseTest;
|
|||
import com.provectus.kafka.ui.pages.MainPage;
|
||||
import com.provectus.kafka.ui.steps.kafka.KafkaSteps;
|
||||
import lombok.SneakyThrows;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.*;
|
||||
|
||||
public class TopicTests extends BaseTest {
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue