01: // Copyright © 2004-2005 ASERT. Released under the Canoo Webtest license.
02: package com.canoo.webtest.extension.dialogs;
03:
04: import org.apache.log4j.Logger;
05:
06: /**
07: * Stores away properties related to a JavaScript dialog response in preparation for subsequent click.<p>
08: *
09: * @author Paul King, ASERT
10: * @webtest.step category="Extension"
11: * name="prompt"
12: * description="Provides the ability to set expectations in relation to user responses to <key>javascript</key> Prompt Dialog boxes. Must be nested within the <stepref name='expectDialogs'/> step."
13: */
14: public class PromptDialogStep extends AbstractDialogStep {
15: private static final Logger LOG = Logger
16: .getLogger(PromptDialogStep.class);
17:
18: {
19: setOptionalText(true);
20: }
21:
22: // used when nesting this step
23: public PromptDialogStep() {
24: super ();
25: }
26:
27: // used by prepareDialogResponse legacy step
28: public PromptDialogStep(final String response, final String text,
29: final String regex, final String saveProperty,
30: final String savePropertyType) {
31: super (response, text, regex, saveProperty, savePropertyType);
32: }
33:
34: public void doExecute() {
35: LOG
36: .debug("Dialog expectation saved - Number of expected dialogs now = "
37: + DialogHelper
38: .getExpectedDialogsCount(getContext()));
39:
40: }
41: }
|