Package net.thucydides.junit.runners

Examples of net.thucydides.junit.runners.ThucydidesRunner


    @Test
    public void html_test_results_are_written_to_the_output_directory()  throws Exception {

        File outputDirectory = temporaryFolder.newFolder("output");

        ThucydidesRunner runner = new TestableThucydidesRunnerSample(SamplePassingNonWebScenario.class,outputDirectory);
        runner.run(new RunNotifier());

        List<String> generatedHtmlReports = Arrays.asList(outputDirectory.list(new HTMLFileFilter()));
        assertThat(generatedHtmlReports.size(), is(3));
    }
View Full Code Here


    @Test
    public void json_test_results_are_written_to_the_output_directory()  throws Exception {

        File outputDirectory = temporaryFolder.newFolder("output");

        ThucydidesRunner runner = new TestableThucydidesRunnerSample(SamplePassingNonWebScenario.class,
                outputDirectory);
        runner.run(new RunNotifier());

        List<String> generatedHtmlReports = Arrays.asList(outputDirectory.list(new JSONFileFilter()));
        assertThat(generatedHtmlReports.size(), is(3));
    }
View Full Code Here


    @Test
    public void the_driver_should_be_initialized_before_the_tests() throws InitializationError  {

        ThucydidesRunner runner = new ThucydidesRunner(SamplePassingScenario.class, webDriverFactory);

        runner.run(new RunNotifier());

        assertThat(firefoxDriver, is(notNullValue()));
    }
View Full Code Here

    ThucydidesWebdriverManager manager;

    @Test
    public void the_driver_should_be_reset_after_each_test() throws InitializationError {

        ThucydidesRunner runner = new ThucydidesRunner(MultipleTestScenario.class, webDriverFactory);

        runner.run(new RunNotifier());

        verify(firefoxDriver,times(3)).quit();
    }
View Full Code Here

    }

    @Test
    public void the_driver_should_only_be_reset_once_at_the_start_for_unique_session_tests() throws InitializationError {

        ThucydidesRunner runner = new ThucydidesRunner(MultipleTestScenarioWithUniqueSession.class, webDriverFactory);

        runner.run(new RunNotifier());

        verify(firefoxDriver,times(1)).quit();
    }
View Full Code Here


    @Test
    public void the_driver_should_be_quit_after_the_tests() throws InitializationError {

        ThucydidesRunner runner = new ThucydidesRunner(SingleTestScenario.class, webDriverFactory);
       
        runner.run(new RunNotifier());
        verify(firefoxDriver).quit();
    }
View Full Code Here

    @Test
    public void when_an_unsupported_driver_is_used_an_error_is_raised() throws InitializationError {

        environmentVariables.setProperty("webdriver.driver", "netscape");
        try {
            ThucydidesRunner runner = getTestRunnerUsing(SingleTestScenario.class);
            runner.run(new RunNotifier());
            fail();
        } catch (UnsupportedDriverException e) {
            assertThat(e.getMessage(), containsString("Unsupported browser type: netscape"));
        }
    }
View Full Code Here

    @Test
    public void a_system_provided_url_should_override_the_default_url() throws InitializationError {

        environmentVariables.setProperty("webdriver.base.url", "http://www.wikipedia.com");
        ThucydidesRunner runner = getTestRunnerUsing(SingleWikipediaTestScenario.class);

        runner.run(new RunNotifier());

        verify(firefoxDriver).get("http://www.wikipedia.com");
    }
View Full Code Here

    }

    @Override
    protected ThucydidesRunner getTestRunnerUsing(Class<?> testClass) throws InitializationError {
        Configuration configuration = new SystemPropertiesConfiguration(environmentVariables);
        return new ThucydidesRunner(testClass, webDriverFactory, configuration);
    }
View Full Code Here

TOP

Related Classes of net.thucydides.junit.runners.ThucydidesRunner

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.