Package jp.vmi.selenium.selenese

Examples of jp.vmi.selenium.selenese.TestSuite


        File root = getTmpRoot();
        Runner runner = new Runner();
        CommandFactory cf = runner.getCommandFactory();
        runner.setDriver(new HtmlUnitDriver(true));
        String s1name = "suite1";
        TestSuite s1 = Binder.newTestSuite(filename(root, s1name), s1name, runner);
        String s2name = "suite2";
        TestSuite s2 = Binder.newTestSuite(filename(root, s2name), s2name, runner);
        String c1name = "case1";
        TestCase c1 = Binder.newTestCase(filename(root, c1name), c1name, runner, "http://localhost");
        c1.addCommand(cf.newCommand(0, "echo", "c1"));
        String c2name = "case2";
        TestCase c2 = Binder.newTestCase(filename(root, c2name), c2name, runner, "http://localhost");
        c2.addCommand(cf.newCommand(0, "echo", "c2"));
        s2.addSelenese(c2);
        s1.addSelenese(c1);
        s1.addSelenese(s2);
        runner.setHtmlResultDir(root.getPath());
        s1.execute(null, runner);
        runner.finish();
View Full Code Here


        runner.setDriver(driver);
        runner.setHtmlResultDir(new File(root, "html").getPath());
        runner.setScreenshotAllDir(new File(root, "img").getPath());
        CommandFactory cf = runner.getCommandFactory();
        String s1name = "suite1";
        TestSuite s1 = Binder.newTestSuite(filename(root, s1name), s1name);
        String s2name = "suite2";
        TestSuite s2 = Binder.newTestSuite(filename(root, s2name), s2name);
        String c1name = "case1";
        TestCase c1 = Binder.newTestCase(filename(root, c1name), c1name, "http://localhost");
        c1.addCommand(cf, "store", "3", "index");
        c1.addCommand(cf, "while", "${index} > 0");
        c1.addCommand(cf, "open", "/form.html");
        c1.addCommand(cf, "storeEval", "${index} - 1", "index");
        c1.addCommand(cf, "endWhile");
        String c2name = "case2";
        TestCase c2 = Binder.newTestCase(filename(root, c2name), c2name, "http://localhost");
        c2.addCommand(cf, "open", "/form2.html");
        s2.addSelenese(c2);
        s1.addSelenese(c1);
        s1.addSelenese(s2);
        runner.execute(s1);
        runner.finish();
    }
View Full Code Here

        jUnitResult.addProperty(testSuite, "selenium.webDriver.name", testSuite.getWebDriverName());
    }

    @Override
    public Object invoke(MethodInvocation invocation) throws Throwable {
        TestSuite testSuite = (TestSuite) invocation.getThis();
        Context context = (Context) invocation.getArguments()[CONTEXT];
        testSuite.setWebDriverName(context.getWrappedDriver().getClass().getSimpleName());
        JUnitResult jUnitResult = (context instanceof JUnitResultHolder) ? ((JUnitResultHolder) context).getJUnitResult() : null;
        HtmlResult htmlResult = (context instanceof HtmlResultHolder) ? ((HtmlResultHolder) context).getHtmlResult() : null;
        StopWatch sw = testSuite.getStopWatch();
        LogRecorder slr = new LogRecorder(context.getPrintStream());
        sw.start();
        if (!testSuite.isError()) {
            String msg = "Start: " + testSuite;
            log.info(msg);
            slr.info(msg);
        }
        initTestSuiteResult(jUnitResult, testSuite);
        try {
            return invocation.proceed();
        } catch (Throwable t) {
            String msg = t.getMessage();
            log.error(msg);
            slr.error(msg);
            throw t;
        } finally {
            if (!testSuite.isError()) {
                String msg = "End(" + sw.getDurationString() + "): " + testSuite;
                log.info(msg);
                slr.info(msg);
            }
            sw.end();
View Full Code Here

     * @param runner Runner instance.
     * @return TestSuite instance.
     */
    @Deprecated
    public static TestSuite newTestSuite(String filename, String name, Runner runner) {
        TestSuite testSuite = injector.getInstance(TestSuite.class);
        return testSuite.initialize(filename, name);
    }
View Full Code Here

TOP

Related Classes of jp.vmi.selenium.selenese.TestSuite

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.