<commit_before>package io.enmasse.systemtest;

import com.paulhammant.ngwebdriver.ByAngular;
import com.paulhammant.ngwebdriver.NgWebDriver;
import org.apache.commons.io.FileUtils;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.rules.TestWatcher;
import org.junit.runner.Description;
import org.openqa.selenium.*;

import java.io.File;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;

import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;

public abstract class SeleniumTestBase extends TestBaseWithDefault {
    private WebDriver driver;
    private NgWebDriver angularDriver;
    private List<File> browserScreenshots = new ArrayList<>();
    private String webconsoleFolder = "selenium_tests";
    @Rule
    public TestWatcher watchman = new TestWatcher() {
        @Override
        protected void failed(Throwable e, Description description) {
            try {
                Path path = Paths.get(String.format("%s/%s/%s/%s/",
                        environment.testLogDir(),
                        webconsoleFolder,
                        description.getClassName(),
                        description.getMethodName()));
                Files.createDirectories(path);
                for (int i = 0; i < browserScreenshots.size(); i++) {
                    FileUtils.copyFile(browserScreenshots.get(i), new File(Paths.get(path.toString(),
                            String.format("%s_%d.png", description.getDisplayName(), i)).toString()));
                }
            } catch (Exception ex) {
                Logging.log.warn("Cannot save screenshots: " + ex.getMessage());
            }
        }
    };

    protected abstract WebDriver buildDriver();

    @Before
    public void setupDriver() throws Exception {
        driver = buildDriver();
        angularDriver = new NgWebDriver((JavascriptExecutor) driver);<commit_msg>Fix use path.get instead of formating string<commit_after>package io.enmasse.systemtest;

import com.paulhammant.ngwebdriver.ByAngular;
import com.paulhammant.ngwebdriver.NgWebDriver;
import org.apache.commons.io.FileUtils;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.rules.TestWatcher;
import org.junit.runner.Description;
import org.openqa.selenium.*;

import java.io.File;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;

import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;

public abstract class SeleniumTestBase extends TestBaseWithDefault {
    private WebDriver driver;
    private NgWebDriver angularDriver;
    private List<File> browserScreenshots = new ArrayList<>();
    private String webconsoleFolder = "selenium_tests";
    @Rule
    public TestWatcher watchman = new TestWatcher() {
        @Override
        protected void failed(Throwable e, Description description) {
            try {
                Path path = Paths.get(
                        environment.testLogDir(),
                        webconsoleFolder,
                        description.getClassName(),
                        description.getMethodName());
                Files.createDirectories(path);
                for (int i = 0; i < browserScreenshots.size(); i++) {
                    FileUtils.copyFile(browserScreenshots.get(i), new File(Paths.get(path.toString(),
                            String.format("%s_%d.png", description.getDisplayName(), i)).toString()));
                }
            } catch (Exception ex) {
                Logging.log.warn("Cannot save screenshots: " + ex.getMessage());
            }
        }
    };

    protected abstract WebDriver buildDriver();

    @Before
    public void setupDriver() throws Exception {
        driver = buildDriver();
        angularDriver = new NgWebDriver((JavascriptExecutor) driver);
{'fraction_non_alphanumeric': 0.10324627776421771, 'fraction_numerical': 0.000488162069807176, 'mean_word_length': 2.655664585191793, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5937377', 'n_tokens_mistral': 1123, 'n_tokens_neox': 1076, 'n_words': 243}