Package jp.vmi.selenium.selenese.result

Examples of jp.vmi.selenium.selenese.result.Result


        TestCase testCase = Binder.newTestCase("dummy", "dummy", baseURL);
        testCase.addCommand(cf, "open", "/");
        testCase.addCommand(cf, "storeEval", script, "var01");
        testCase.addCommand(cf, "setBoolean", "false", "logoutpresent");
        testCase.addCommand(cf, "storeEval", script, "var02");
        Result result = runner.execute(testCase);
        assertThat(result, is(instanceOf(Success.class)));
        assertThat((String) varsMap.get("var01"), is("result01"));
        assertThat((String) varsMap.get("var02"), is("result02"));
    }
View Full Code Here


    @Test
    public void emptyFile() throws IOException {
        File tmp = File.createTempFile("aaa", "test.html");
        Runner runner = new Runner();
        runner.setDriver(new HtmlUnitDriver());
        Result result = runner.run(tmp.getCanonicalPath());
        assertThat(result, is(instanceOf(Error.class)));
        assertThat(result.getMessage(), containsString("Not selenese script."));
    }
View Full Code Here

    @Test
    public void noSuchFile() throws IOException {
        Runner runner = new Runner();
        runner.setDriver(new HtmlUnitDriver());
        Result result = runner.run("nosuchfile.html");
        assertTrue(result.isFailed());
    }
View Full Code Here

        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

        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

        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

        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

            int speed = NumberUtils.toInt(cli.getOptionValue("set-speed", "0"));
            if (speed < 0)
                throw new IllegalArgumentException("Invalid speed value. (" + cli.getOptionValue("set-speed") + ")");
            runner.setInitialSpeed(speed);
            runner.setPrintStream(System.out);
            Result totalResult = runner.run(filenames);
            runner.finish();
            exitCode = totalResult.getLevel().exitCode;
        } catch (IllegalArgumentException e) {
            help("Error: " + e.getMessage());
        } catch (Throwable t) {
            t.printStackTrace();
        }
View Full Code Here

    public Result execute(Selenese parent, Context context) {
        context.prepareWebDriver();
        context.setLatestPageInformation(PageInformation.EMPTY);
        context.resetSpeed();
        for (Selenese selenese : seleneseList) {
            Result r;
            try {
                r = selenese.execute(this, context);
            } catch (RuntimeException e) {
                String msg = e.getMessage();
                result = new Error(msg);
View Full Code Here

    @Override
    public Object invoke(MethodInvocation invocation) throws Throwable {
        Object[] args = invocation.getArguments();
        Context context = (Context) args[CONTEXT];
        ICommand command = (ICommand) args[COMMAND];
        Result result = (Result) invocation.proceed();
        if (context instanceof ScreenshotHandler && command.mayUpdateScreen()) {
            ScreenshotHandler handler = (ScreenshotHandler) context;
            String baseName = context.getCurrentTestCase().getBaseName();
            try {
                command.addScreenshot(handler.takeScreenshotAll(baseName, command.getIndex()), "all");
                if (!result.isSuccess())
                    command.addScreenshot(handler.takeScreenshotOnFail(baseName, command.getIndex()), "fail");
            } catch (WebDriverException e) {
                // ignore if failed to capturing.
            }
        }
View Full Code Here

TOP

Related Classes of jp.vmi.selenium.selenese.result.Result

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.