Package net.mindengine.galen.runner

Examples of net.mindengine.galen.runner.JsTestCollector.execute()


            tests.addAll(reader.read(file));
        }
       
        JsTestCollector testCollector = new JsTestCollector(tests);
        for (File jsFile: jsTestFiles) {
            testCollector.execute(jsFile);
        }
       
        testCollector.getEventHandler().invokeBeforeTestSuiteEvents();
       
        runTests(testCollector.getEventHandler(), arguments, tests, listener);
View Full Code Here


    @Test
    public void shouldExecuteJavascript_andCollectTests() throws Exception {
        JsTestCollector testCollector = new JsTestCollector();
       
        JsTestRegistry.get().clear();
        testCollector.execute(new File(getClass().getResource("/js-tests/simple.test.js").getFile()));
       
        List<GalenTest> tests = testCollector.getCollectedTests();
       
        assertThat("Amount of tests should be", tests.size(), is(3));
        assertThat("Name of #1 test should be", tests.get(0).getName(), is("Test number 1"));
View Full Code Here

    @Test
    public void shouldAllow_toUse_testFilter() throws IOException {
        JsTestCollector testCollector = new JsTestCollector();
        JsTestRegistry.get().clear();
        testCollector.execute(new File(getClass().getResource("/js-tests/testfilter.test.js").getFile()));

        List<GalenTest> tests = testCollector.getCollectedTests();
        assertThat(tests.get(0).getName(), is("Test A"));
        assertThat(tests.get(1).getName(), is("Test B"));
        assertThat(tests.get(2).getName(), is("Test C"));
View Full Code Here

    @Test
    public void shouldLoadOtherScripts_onlyOnce() throws IOException {
        JsTestCollector testCollector = new JsTestCollector();
        JsTestRegistry.get().clear();
        testCollector.execute(new File(getClass().getResource("/js-tests/multilevel/main.test.js").getFile()));
        testCollector.execute(new File(getClass().getResource("/js-tests/multilevel/folder/second.test.js").getFile()));


        List<String> events = JsTestRegistry.get().getEvents();
        assertThat("Events amount should be", events.size(), is(3));
View Full Code Here

    @Test
    public void shouldLoadOtherScripts_onlyOnce() throws IOException {
        JsTestCollector testCollector = new JsTestCollector();
        JsTestRegistry.get().clear();
        testCollector.execute(new File(getClass().getResource("/js-tests/multilevel/main.test.js").getFile()));
        testCollector.execute(new File(getClass().getResource("/js-tests/multilevel/folder/second.test.js").getFile()));


        List<String> events = JsTestRegistry.get().getEvents();
        assertThat("Events amount should be", events.size(), is(3));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.