Package net.mindengine.galen

Examples of net.mindengine.galen.GalenMain


        GalenConfig config = GalenConfig.getConfig();
        System.setProperty("galen.reporting.listeners", "net.mindengine.galen.components.DummyCompleteListener");
        config.reset();
       
       
        List<CompleteListener> listeners = new GalenMain().getConfiguredListeners();
        assertThat(listeners, is(notNullValue()));
        assertThat(listeners.size(), is(1));
        assertThat(listeners.get(0), is(instanceOf(DummyCompleteListener.class)));
       
        deleteSystemProperty("galen.reporting.listeners");
View Full Code Here


    @Test public void shouldRun_singleTestSuccessfully() throws Exception {
        String testUrl = "file://" + getClass().getResource("/html/page-nice.html").getFile();
        System.setProperty("url", testUrl);
        System.setProperty("spec.path", getClass().getResource("/html/page.spec").getFile());
       
        GalenMain galen = new GalenMain();
       
        File reportsDir = Files.createTempDir();
        String htmlReportPath = reportsDir.getAbsolutePath();
        String testngReportPath = reportsDir.getAbsolutePath() + "/testng-report.html";
       
        galen.execute(new GalenArguments()
            .withAction("test")
            .withPaths(asList(getClass().getResource("/suites/to-run/suite-single.test").getFile()))
            .withHtmlReport(htmlReportPath)
            .withTestngReport(testngReportPath)
            );
View Full Code Here

    @Test public void shouldFindAndRun_allTestsRecursivelly() throws Exception {
        String testUrl = "file://" + getClass().getResource("/html/page-nice.html").getFile();
        System.setProperty("url", testUrl);
        System.setProperty("spec.path", getClass().getResource("/html/page.spec").getFile());
       
        GalenMain galen = new GalenMain();
       
        File reportsDir = Files.createTempDir();
        String testngReportPath = reportsDir.getAbsolutePath() + "/testng-report.xml";
       
        galen.execute(new GalenArguments()
            .withAction("test")
            .withPaths(asList(getClass().getResource("/suites/to-run/recursive-check").getFile()))
            .withRecursive(true)
            .withTestngReport(testngReportPath)
            );
View Full Code Here

        String htmlReportPath = reportsDir.getAbsolutePath();
        String testngReportPath = reportsDir.getAbsolutePath() + "/testng-report.html";
       
        JsTestRegistry.get().clear();
       
        new GalenMain().execute(new GalenArguments()
            .withAction("test")
            .withPaths(asList(getClass().getResource("/js-tests/simple-with-error.test.js").getFile()))
            .withHtmlReport(htmlReportPath)
            .withTestngReport(testngReportPath)
        );
View Full Code Here

    }
   
    @Test public void shouldRun_javascriptTestWithEvents() throws Exception {
        JsTestRegistry.get().clear();
       
        new GalenMain().execute(new GalenArguments()
            .withAction("test")
            .withPaths(asList(getClass().getResource("/js-tests/with-events.test.js").getFile()))
        );
       
        assertThat(JsTestRegistry.get().getEvents(), contains(
View Full Code Here

    }

    @Test public void shouldRunJavascriptTests_andFilterThem() throws Exception {
        JsTestRegistry.get().clear();

        new GalenMain().execute(new GalenArguments()
                        .withAction("test")
                        .withPaths(asList(getClass().getResource("/js-tests/testfilter.test.js").getFile()))
        );

        assertThat(JsTestRegistry.get().getEvents(), contains(
View Full Code Here

    @Test public void shouldFindAndRun_allTestsRecursivelly_inParallel() throws Exception {
        String testUrl = "file://" + getClass().getResource("/html/page-nice.html").getFile();
        System.setProperty("url", testUrl);
        System.setProperty("spec.path", getClass().getResource("/html/page.spec").getFile());
       
        GalenMain galen = new GalenMain();
       
        File reportsDir = Files.createTempDir();
        String testngReportPath = reportsDir.getAbsolutePath() + "/testng-report.html";
       
        galen.execute(new GalenArguments()
            .withAction("test")
            .withPaths(asList(getClass().getResource("/suites/to-run/recursive-check").getFile()))
            .withRecursive(true)
            .withTestngReport(testngReportPath)
            .withParallelSuites(5)
View Full Code Here

        String pageSpec = getClass().getResource("/html/page.spec").getFile();
        File reportsDir = Files.createTempDir();
        String htmlReportPath = reportsDir.getAbsolutePath();
        String testngReportPath = reportsDir.getAbsolutePath() + "/testng-report.html";
       
        new GalenMain().execute(new GalenArguments()
            .withAction("check")
            .withUrl(testUrl)
            .withPaths(Arrays.asList(pageSpec))
            .withScreenSize(new Dimension(450, 500))
            .withHtmlReport(htmlReportPath)
View Full Code Here

        String testUrl = "file://" + getClass().getResource("/html/page-nice.html").getFile();
        String pageSpec = getClass().getResource("/negative-specs/invalid-spec.spec").getFile();
        File reportsDir = Files.createTempDir();
        String testngReportPath = reportsDir.getAbsolutePath() + "/testng-report.html";
       
        new GalenMain().execute(new GalenArguments()
            .withAction("check")
            .withUrl(testUrl)
            .withPaths(Arrays.asList(pageSpec))
            .withScreenSize(new Dimension(450, 500))
            .withTestngReport(testngReportPath)
View Full Code Here

        assertThat(testngReportContent, containsString("<test-method status=\"FAIL\""));
    }
   
    @Test public void shouldGenerate_configFile() throws IOException {
        new GalenMain().performConfig();
        assertThat("config file should exist", new File("config").exists(), is(true));
        new File("config").delete();
    }
View Full Code Here

TOP

Related Classes of net.mindengine.galen.GalenMain

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.