Package com.canoo.webtest.extension.dialogs

Source Code of com.canoo.webtest.extension.dialogs.AlertDialogStep

// Copyright � 2004-2005 ASERT. Released under the Canoo Webtest license.
package com.canoo.webtest.extension.dialogs;

import com.canoo.webtest.engine.Context;
import org.apache.log4j.Logger;

/**
* Stores away properties related to a JavaScript dialog response in preparation for subsequent click.<p>
*
* @author Paul King, ASERT
* @webtest.step category="Extension"
* name="alert"
* description="Provides the ability to set expectations in relation to user responses to <key>javascript</key> Alert Dialog boxes. Must be nested within the <stepref name='expectDialogs'/> step."
*/
public class AlertDialogStep extends AbstractDialogStep
{
    private static final Logger LOG = Logger.getLogger(AlertDialogStep.class);

    {
        setOptionalText(true);
    }

    // used when nesting this step
    public AlertDialogStep() {
        super();
    }

    // used by prepareDialogResponse legacy step
    public AlertDialogStep(final String text, final String regex,
                           final String saveProperty, final String savePropertyType) {
        super(null, text, regex, saveProperty, savePropertyType);
    }

    public void doExecute() {
        final Context context = getContext();
        LOG.debug("Dialog expectation saved - Number of expected dialogs now = "
                + DialogHelper.getExpectedDialogsCount(context));

    }
}
TOP

Related Classes of com.canoo.webtest.extension.dialogs.AlertDialogStep

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.