Package jp.vmi.selenium.selenese

Examples of jp.vmi.selenium.selenese.TestCase


        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);
View Full Code Here


        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

        Runner runner = new Runner();
        WebDriverManager wdm = WebDriverManager.getInstance();
        wdm.setWebDriverFactory(WebDriverManager.HTMLUNIT);
        wdm.setDriverOptions(new DriverOptions());
        runner.setDriver(wdm.get());
        TestCase testCase = Binder.newTestCase("dummy", "dummy", runner, wsr.getBaseURL());
        CommandFactory commandFactory = runner.getCommandFactory();
        commandFactory.setProc(testCase.getProc());
        testCase.addCommand(commandFactory.newCommand(0, "open", "/assertion.html"));
        testCase.addCommand(commandFactory.newCommand(1, commandName, argument));
        Result result = testCase.execute(null, runner);
        assertThat(result, is(instanceOf(resultClass)));
    }
View Full Code Here

        wdm.setWebDriverFactory(WebDriverManager.HTMLUNIT);
        wdm.setDriverOptions(new DriverOptions());
        Runner runner = new Runner();
        runner.setDriver(wdm.get());
        CommandFactory cf = runner.getCommandFactory();
        TestCase testCase = Binder.newTestCase("dummy", "dummy", wsr.getBaseURL());
        testCase.addCommand(cf, "open", "/assertion.html");
        testCase.addCommand(cf, commandName, argument);
        Result result = runner.execute(testCase);
        assertThat(result, is(instanceOf(resultClass)));
    }
View Full Code Here

        wdm.setDriverOptions(new DriverOptions());
        Runner runner = new Runner();
        runner.setDriver(wdm.get());
        runner.setOverridingBaseURL(wsr.getBaseURL());
        CommandFactory cf = runner.getCommandFactory();
        TestCase testCase = Binder.newTestCase("dummy", "dummy", wsr.getBaseURL());
        testCase.addCommand(cf, "open", "/index.html");
        testCase.addCommand(cf, "click", "link=linktext");
        Result result = runner.execute(testCase);
        assertThat(result.getMessage(), is("Failure: Element link=linktext not found"));
    }
View Full Code Here

        Runner runner = new Runner();
        runner.setDriver(wdm.get());
        runner.setOverridingBaseURL(wsr.getBaseURL());
        CommandFactory cf = runner.getCommandFactory();

        TestCase testCase = Binder.newTestCase("dummy", "dummy", wsr.getBaseURL());
        testCase.addCommand(cf, "open", "/assertion.html");
        testCase.addCommand(cf, "assertTitle", "title", "title");
        Result result = runner.execute(testCase);
        assertThat(result.getMessage(), is("Failure: Assertion failed (Result: [assertion test] / Expected: [title])"));
    }
View Full Code Here

                } else {
                    return null;
                }
            }
        });
        TestCase testCase = Binder.newTestCase("dummy", "dummy", "http://localhost/");
        testCase.addCommand(cf, "test");
        testCase.addCommand(cf, "echo", "test");
        CommandList commandList = testCase.getCommandList();
        assertThat(commandList.toArray(), is(array(instanceOf(TestCommandNew.class), instanceOf(Echo.class))));
    }
View Full Code Here

        Runner runner = new Runner();
        runner.setDriver(wdm.get());
        CommandFactory cf = runner.getCommandFactory();

        File selenesefile = File.createTempFile("selenese", ".html");
        TestCase testCase = Binder.newTestCase(selenesefile.getPath(), "test", "http://example.co.jp");
        testCase.addCommand(cf, "store", wsr.getBaseURL(), "url");
        testCase.addCommand(cf, "open", "${url}");
        testCase.addCommand(cf, "pause", "1000");
        runner.execute(testCase);
        assertThat(runner.getWrappedDriver().getCurrentUrl(), is(wsr.getBaseURL()));
    }
View Full Code Here

     * @param baseURL base URL in script.
     * @return TestCase instance.
     */
    @Deprecated
    public static TestCase newTestCase(String filename, String name, Runner runner, String baseURL) {
        TestCase testCase = injector.getInstance(TestCase.class);
        return testCase.initialize(filename, name, runner, baseURL);
    }
View Full Code Here

    }

    @Override
    public final Result execute(Context context, String... curArgs) {
        Runner runner = (Runner) context;
        TestCase testCase = runner.getCurrentTestCase();
        try {
            result = doCommandImpl(testCase, runner);
        } catch (RuntimeException e) {
            result = new Error(e);
        }
View Full Code Here

TOP

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

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.