Package net.thucydides.core.util

Examples of net.thucydides.core.util.MockEnvironmentVariables


    @Test
    public void the_test_runner_executes_the_steps_in_batches() throws InitializationError, InterruptedException {

        List<List<Integer>> executedTestResults = new ArrayList<List<Integer>>();
        for(int i = 1; i <= 10; i++) {
            MockEnvironmentVariables threadVariables = new MockEnvironmentVariables();
            threadVariables.setProperty("thucydides.batch.count", "10");
            threadVariables.setProperty("thucydides.batch.number", Integer.toString(i));
            SystemVariableBasedBatchManager batchManager = new SystemVariableBasedBatchManager(threadVariables);
            List<Integer> executedTests = new ArrayList<Integer>();
            executedTestResults.add(executedTests);
            runFiftyTestCases(batchManager, executedTests);
        }
View Full Code Here


    public void the_test_runner_executes_the_steps_in_batches_when_tests_are_run_in_parallel() throws InitializationError, InterruptedException {

        List<TestRunnerThread> threads = new ArrayList<TestRunnerThread>();

        for(int i = 1; i <= 10; i++) {
            MockEnvironmentVariables threadVariables = new MockEnvironmentVariables();
            threadVariables.setProperty("thucydides.batch.count", "10");
            threadVariables.setProperty("thucydides.batch.number", Integer.toString(i));
            SystemVariableBasedBatchManager batchManager = new SystemVariableBasedBatchManager(threadVariables);
            threads.add(new TestRunnerThread(batchManager));
        }

        for(TestRunnerThread thread : threads) {
View Full Code Here

        indexPage.setWaitForTimeout(100);
    }

    @Before
    public void initConfiguration() {
        environmentVariables = new MockEnvironmentVariables();
        configuration = new SystemPropertiesConfiguration(environmentVariables);
    }
View Full Code Here

    @Before
    public void createStepListenerAndFactory() throws IOException {
        MockitoAnnotations.initMocks(this);
        outputDirectory = temporaryFolder.newFolder("thucydides");

        environmentVariables = new MockEnvironmentVariables();
        configuration = new SystemPropertiesConfiguration(environmentVariables);

        stepFactory = new StepFactory();
        stepListener = new BaseStepListener(null, outputDirectory, configuration);
View Full Code Here

    private String previousChromeDriverPath;

    @Before
    public void createATestableDriverFactory() throws Exception {
        previousChromeDriverPath = System.getProperty("webdriver.chrome.driver");
        environmentVariables = new MockEnvironmentVariables();
    }
View Full Code Here

    Configuration configuration;

    @Before
    public void initMocks() {
        MockitoAnnotations.initMocks(this);
        environmentVariables = new MockEnvironmentVariables();
        configuration = new SystemPropertiesConfiguration(environmentVariables);
    }
View Full Code Here

    @Before
    public void createScreenshotDir() throws IOException {

        screenshotDirectory = temporaryDirectory.newFolder("screenshots");
        MockitoAnnotations.initMocks(this);
        environmentVariables = new MockEnvironmentVariables();

        testSite = new StaticTestSite();
    }
View Full Code Here

    }

    private void initWendriverManager() throws IllegalAccessException, InstantiationException, NoSuchMethodException, InvocationTargetException {
        when(webdriverInstanceFactory.newFirefoxDriver(any(Capabilities.class))).thenReturn(firefoxDriver);

        MockEnvironmentVariables environmentVariables = new MockEnvironmentVariables();
        factory = new WebDriverFactory(webdriverInstanceFactory, environmentVariables);

        webdriverManager = new ThucydidesWebdriverManager(factory, new SystemPropertiesConfiguration(environmentVariables));

    }
View Full Code Here

public class WhenObtainingADataDrivenTestSource {

    @Test
    public void should_convert_data_file_path_to_operating_system_localized_path() {
        EnvironmentVariables environmentVariables = new MockEnvironmentVariables();
        environmentVariables.setProperty("thucydides.data.dir","C:\\some\\dir");

        FilePathParser testDataSourcePath = new FilePathParser(environmentVariables) {
            @Override
            protected String getFileSeparator() {
                return "\\";
View Full Code Here

        assertThat(testDataSourcePath.getInstanciatedPath("${DATADIR}/simple-semicolon-data.csv"), is("C:\\some\\dir\\simple-semicolon-data.csv"));
    }

    @Test
    public void should_convert_data_file_path_to_operating_system_localized_path_in_unix() {
        EnvironmentVariables environmentVariables = new MockEnvironmentVariables();
        environmentVariables.setProperty("thucydides.data.dir","/some/dir");

        FilePathParser testDataSourcePath = new FilePathParser(environmentVariables) {
            @Override
            protected String getFileSeparator() {
                return "/";
View Full Code Here

TOP

Related Classes of net.thucydides.core.util.MockEnvironmentVariables

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.