/// <summary>
        /// Calls <see cref="FillWith(string,FinishInputWithAction,IWebTestActionOptions)"/> by joining the given lines with new line
        /// characters.
        /// </summary>
        public UnspecifiedPageObject FillWith(
            [NotNull] string[] lines,
            FinishInputWithAction finishInputWith,
            IWebTestActionOptions actionOptions = null)
        {
            ArgumentUtility.CheckNotNull("lines", lines);

            return(FillWith(string.Join(Environment.NewLine, lines), finishInputWith, actionOptions));
        }
Example #2
0
        /// <inheritdoc/>
        public UnspecifiedPageObject FillWith(string text, FinishInputWithAction finishInputWith, IWebTestActionOptions actionOptions = null)
        {
            ArgumentUtility.CheckNotNull("text", text);
            ArgumentUtility.CheckNotNull("finishInputWith", finishInputWith);

            var actualActionOptions = MergeWithDefaultActionOptions(actionOptions, finishInputWith);

            new FillWithAction(this, Scope.FindChild("Value"), text, finishInputWith).Execute(actualActionOptions);
            return(UnspecifiedPage());
        }
Example #3
0
        private IWebTestActionOptions MergeWithDefaultActionOptions(
            IWebTestActionOptions userDefinedActionOptions,
            FinishInputWithAction finishInputWith)
        {
            if (finishInputWith == FinishInput.Promptly)
            {
                userDefinedActionOptions = userDefinedActionOptions ?? new WebTestActionOptions();
                userDefinedActionOptions.CompletionDetectionStrategy = Continue.Immediately;
            }

            return(MergeWithDefaultActionOptions(Scope, userDefinedActionOptions));
        }
Example #4
0
        /// <summary>
        /// ASP.NET WebForms-ready &amp; IE-compatible version for Coypu's <see cref="ElementScope.FillInWith"/> method.
        /// </summary>
        /// <param name="scope">The <see cref="ElementScope"/> on which the action is performed.</param>
        /// <param name="value">The value to fill in.</param>
        /// <param name="finishInputWithAction"><see cref="FinishInputWithAction"/> for this action.</param>
        public static void FillInWithFixed(
            [NotNull] this ElementScope scope,
            [NotNull] string value,
            [NotNull] FinishInputWithAction finishInputWithAction)
        {
            ArgumentUtility.CheckNotNull("scope", scope);
            ArgumentUtility.CheckNotNull("value", value);
            ArgumentUtility.CheckNotNull("finishInputWithAction", finishInputWithAction);

            const bool clearValue = true;

            scope.FillInWithFixed(value, finishInputWithAction, clearValue);
        }
        public FillWithAction(
            [NotNull] ControlObject control,
            [NotNull] ElementScope scope,
            [NotNull] string value,
            [NotNull] FinishInputWithAction finishInputWithAction)
            : base(control, scope)
        {
            ArgumentUtility.CheckNotNull("value", value);
            ArgumentUtility.CheckNotNull("finishInputWithAction", finishInputWithAction);

            _value = value;
            _finishInputWithAction = finishInputWithAction;
        }
Example #6
0
        /// <summary>
        /// ASP.NET WebForms-ready &amp; IE-compatible version for Coypu's <see cref="ElementScope.FillInWith"/> method.
        /// </summary>
        /// <param name="scope">The <see cref="ElementScope"/> on which the action is performed.</param>
        /// <param name="value">The value to fill in.</param>
        /// <param name="finishInputWithAction"><see cref="FinishInputWithAction"/> for this action.</param>
        /// <param name="clearValue">Determines whether the old content should be cleared before filling in the new value.</param>
        private static void FillInWithFixed(
            [NotNull] this ElementScope scope,
            [NotNull] string value,
            [NotNull] FinishInputWithAction finishInputWithAction,
            bool clearValue)
        {
            ArgumentUtility.CheckNotNull("scope", scope);
            ArgumentUtility.CheckNotNull("value", value);
            ArgumentUtility.CheckNotNull("finishInputWithAction", finishInputWithAction);

            if (!WebTestingConfiguration.Current.BrowserIsInternetExplorer())
            {
                scope.FillInWithFixedForNormalBrowsers(value, clearValue);
            }
            else
            {
                scope.FillInWithFixedForInternetExplorer(value, clearValue);
            }

            finishInputWithAction(scope);
        }