Package jp.vmi.selenium.selenese

Examples of jp.vmi.selenium.selenese.Context


    }

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


     * @return command result.
     */
    @Deprecated
    public Object execute(String commandName, String... args) {
        ISubCommand<?> command = subCommandMap.get(commandName);
        Context context = subCommandMap.getContext();
        return command.execute(context, args);
    }
View Full Code Here

     * Result doCommand(Context context, ICommand command, String... curArgs)
     */
    @Override
    public Object invoke(MethodInvocation invocation) throws Throwable {
        Object[] args = invocation.getArguments();
        Context context = (Context) args[CONTEXT];
        ICommand command = (ICommand) args[COMMAND];
        String[] curArgs = (String[]) args[CUR_ARGS];
        if (context instanceof HighlightHandler) {
            HighlightHandler handler = (HighlightHandler) context;
            handler.unhighlight();
View Full Code Here

     * Result doCommand(Context context, ICommand command, String... curArgs)
     */
    @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) {
View Full Code Here

     */
    @Override
    public Object invoke(MethodInvocation invocation) throws Throwable {
        LogIndentLevelHolder holder = (LogIndentLevelHolder) invocation.getThis();
        Object[] args = invocation.getArguments();
        Context context = (Context) args[CONTEXT];
        ICommand command = (ICommand) args[COMMAND];
        LogRecorder clr = context.getCurrentTestCase().getLogRecorder();
        String indent = StringUtils.repeat("  ", holder.getLogIndentLevel());
        String cmdStr = command.toString();
        log.info(indent + cmdStr);
        clr.info(indent + cmdStr);
        try {
            Result result = (Result) invocation.proceed();
            logResult(clr, indent, cmdStr, result, context);
            return result;
        } catch (Exception e) {
            String msg = cmdStr + " => " + e.getMessage();
            log.error(indent + msg);
            clr.error(indent + msg);
            if (context instanceof JUnitResultHolder)
                ((JUnitResultHolder) context).getJUnitResult().setError(context.getCurrentTestCase(), e.getMessage(), e.toString());
            throw e;
        }
    }
View Full Code Here

    @Override
    public Object invoke(MethodInvocation invocation) throws Throwable {
        ITestCase testCase = (ITestCase) invocation.getThis();
        Object[] args = invocation.getArguments();
        Context context = (Context) args[CONTEXT];
        JUnitResult jUnitResult;
        if (context instanceof JUnitResultHolder) {
            jUnitResult = ((JUnitResultHolder) context).getJUnitResult();
            jUnitResult.startTestCase((ITestSuite) args[PARENT], testCase);
        } else {
            jUnitResult = null;
        }
        StopWatch sw = testCase.getStopWatch();
        LogRecorder clr = new LogRecorder(context.getPrintStream());
        testCase.setLogRecorder(clr);
        sw.start();
        if (!testCase.isError()) {
            log.info("Start: {}", testCase);
            clr.info("Start: " + testCase);
        }
        if (testCase instanceof TestCase) {
            String baseURL = StringUtils.defaultString(context.getOverridingBaseURL(), ((TestCase) testCase).getBaseURL());
            log.info("baseURL: {}", baseURL);
            clr.info("baseURL: " + baseURL);
        }
        try {
            Result result = (Result) invocation.proceed();
View Full Code Here

TOP

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

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.