Ejemplo n.º 1
0
        /// <summary>
        /// Selects the open in new window option.
        /// </summary>
        /// <param name="isSelected">The is selected.</param>
        public void SelectOpenInNewWindowOption(bool isSelected = true)
        {
            HtmlInputCheckBox checkbox = this.EM.Selectors
                                         .SelectorsScreen
                                         .OpenExternalUrlsInNewTabCheckbox
                                         .AssertIsPresent("open in new window");

            if (isSelected && !checkbox.Checked)
            {
                checkbox.Click();
            }
            else if (!isSelected && checkbox.Checked)
            {
                checkbox.Click();
            }
        }
        /// <summary>
        /// Clicks open in new window option
        /// </summary>
        /// <param name="tabIndex">The index of the current tab.</param>
        /// <param name="isSelected">true or false depending on the option state.</param>
        public void SelectOpenInNewWindowOption(int tabIndex, bool isSelected = true)
        {
            HtmlInputCheckBox checkbox = EM.GenericContent
                                         .ContentBlockLinkSelector
                                         .OpenInNewWindow(tabIndex)
                                         .AssertIsPresent("open in new window");

            if (isSelected && !checkbox.Checked)
            {
                checkbox.Click();
            }
            else if (!isSelected && checkbox.Checked)
            {
                checkbox.Click();
            }
        }
        /// <summary>
        /// Check required field checkbox.
        /// </summary>
        public void CheckRequiredFieldCheckbox()
        {
            HtmlInputCheckBox checkbox = this.EM.Forms.FormsBackend.RequiredFieldCheckBox.AssertIsPresent("Required field");

            checkbox.Click();
            checkbox.AssertIsPresent("checked");
        }
        /// <summary>
        /// Check Calendar check box
        /// </summary>
        public void SelectFilterByCalendar()
        {
            HtmlInputCheckBox calendarCheckBox = this.EM.Widgets.WidgetDesignerCalendarScreen.CalendarCheckBox;

            calendarCheckBox.AssertIsPresent("Calendar checkbox");
            calendarCheckBox.Click();
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Click option Allow users to step backward.
        /// </summary>
        public void ClickAllowUsersToStepBackwardCheckBox()
        {
            HtmlInputCheckBox checkbox = this.EM.Forms.FormsBackend.AllowUsersToStepBackwardCheckBox.AssertIsPresent("Next step button");

            checkbox.AssertIsPresent("checked");
            checkbox.Click();
        }
Ejemplo n.º 6
0
        public void MarkSysAdminAsOpportunityOwner_CodedStep()
        {
            int rownum = Convert.ToInt32(GetExtractedValue("Table"));

            //HtmlTable table = Find.ByXPath<HtmlTable>("//div[@id=\"grid-primaryUser\"]//table");
            //List<HtmlTableRow> tr = table.AllRows;
            for (int i = 1; i <= rownum; i++)
            {
                var    tabledata    = Find.ByXPath("//div[@id=\"grid-primaryUser\"]//table//tbody//tr[" + i + "]//td[4]");
                string resourceName = (tabledata.InnerText.ToString());
                if (resourceName.Equals("TestSysAdmin"))
                {
                    HtmlInputCheckBox opApprover1 = Find.ByXPath <HtmlInputCheckBox>("//div[@id=\"grid-primaryUser\"]//table//tbody//tr[" + i + "]//td[2]/input");
                    if (!opApprover1.Checked)
                    {
                        //ActiveBrowser.Actions.Click(opApprover1);
                        opApprover1.Click();
                    }
                    HtmlInputCheckBox opApprover2 = Find.ByXPath <HtmlInputCheckBox>("//div[@id=\"grid-primaryUser\"]//table//tbody//tr[" + i + "]//td[3]/input");
                    if (!opApprover2.Checked)
                    {
                        //ActiveBrowser.Actions.Click(opApprover2);
                        opApprover2.Click();
                    }
                }
            }
        }
        /// <summary>
        /// Check Allow users to sort results checkbox
        /// </summary>
        public void AllowUsersToSortResults()
        {
            this.EM.Search.SearchResultsWidgetEditScreen.AllowSortingLabel.AssertIsPresent("Allow sorting label");
            HtmlInputCheckBox allowUsersToSortResultCheckbox = this.EM.Search.SearchResultsWidgetEditScreen.AllowUsersToSortResultsCheckbox.AssertIsPresent("Frontend sorting checkbox");

            allowUsersToSortResultCheckbox.Click();
        }
        /// <summary>
        /// Selects the taxonomy.
        /// </summary>
        /// <param name="taxonomy">The taxonomy.</param>
        public void SelectCheckBox(string taxonomy)
        {
            HtmlInputCheckBox optionButton = ActiveBrowser.Find
                                             .ByExpression <HtmlInputCheckBox>("id=" + taxonomy)
                                             .AssertIsPresent("Taxonomy option");

            optionButton.Click();
        }
        /// <summary>
        /// Uns the select allow users to siwtch views CheckBox in calendar widget.
        /// </summary>
        public void UnSelectAllowUsersToSiwtchViewsCheckBoxInCalendarWidget()
        {
            HtmlInputCheckBox optionCheckbox = this.EM.Widgets.WidgetDesignerCalendarScreen.AllowUsersToSwitchViewsCheckBox
                                               .AssertIsPresent("Allow users to switch views");

            Assert.IsTrue(optionCheckbox.Checked);
            optionCheckbox.Click();
            Assert.IsFalse(optionCheckbox.Checked);
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Check Show Empty Categories checkbox.
        /// </summary>
        public void CheckShowEmptyCategories()
        {
            HtmlInputCheckBox emptyCategories = this.EM.Classifications.CategoriesWidgetEditScreen.ShowEmptyCategories
                                                .AssertIsPresent("Show empty categories");

            emptyCategories.Click();
            ActiveBrowser.WaitForAsyncRequests();
            ActiveBrowser.RefreshDomTree();
        }
        public void EditYesNoControlOfDynamicContentViaInlineEditing(string controlName)
        {
            this.EditField(controlName);

            HtmlAnchor editButton = ActiveBrowser.Find.ByCustom <HtmlAnchor>(e => e.IsVisible() && e.CssClass.Equals("sfShowInlineEditDlgLnk"));

            editButton.Click();

            HtmlDiv           workArea = ActiveBrowser.Find.ByCustom <HtmlDiv>(e => e.IsVisible() && e.ID.Equals("contentPlaceHolder"));
            HtmlInputCheckBox checkbox = workArea.Find.ByCustom <HtmlInputCheckBox>(i => i.IsVisible() && i.TagName.Equals("input"));

            checkbox.Click();
            BAT.Wrappers().Frontend().InlineEditing().DynamicTypes().SelectDoneButtongWhenEditingChoices();
        }
Ejemplo n.º 12
0
        /// <summary>
        /// Selects the item.
        /// </summary>
        /// <param name="itemName">Name of the item.</param>
        public void SelectSocialShareOptions(params string[] itemNames)
        {
            foreach (var itemName in itemNames)
            {
                HtmlDiv           div   = this.GetSocialShareOptionDivByName(itemName);
                HtmlInputCheckBox input = div.Find.ByExpression <HtmlInputCheckBox>("ng-model=group.IsChecked");

                if (!input.Checked)
                {
                    input.Click();
                }

                ActiveBrowser.RefreshDomTree();
            }
        }
Ejemplo n.º 13
0
        /// <summary>
        /// Selects checkbox from checkboxes field
        /// </summary>
        public void SelectCheckbox(string choice)
        {
            HtmlInputCheckBox checkbox = ActiveBrowser.Find.ByExpression <HtmlInputCheckBox>("tagname=input", "data-sf-role=checkboxes-field-input", "value=" + choice);

            checkbox.Click();
        }
        /// <summary>
        /// Clicks the this image is A link.
        /// </summary>
        public void ClickThisImageIsALink()
        {
            HtmlInputCheckBox link = this.EM.Media.ImagePropertiesScreen.ThisImageIsALinkCheckBox.AssertIsPresent("this image is a link");

            link.Click();
        }
        public void HtmlAssertTests()
        {
            // Attribute checks
            HtmlSpan span = Find.ById <HtmlSpan>("Warning");

            span.AssertAttribute().Exists("style");
            span.AssertAttribute().Value("style", ArtOfTest.Common.StringCompareType.Contains, "color");

            // Checkbox checks
            HtmlInputCheckBox cbx = Find.ById <HtmlInputCheckBox>("Checkbox1");

            cbx.AssertCheck().IsTrue();
            cbx.Click();
            cbx.AssertCheck().IsFalse();

            // Content checks
            span.AssertContent().InnerText(StringCompareType.Contains, "Warning");
            span.AssertContent().InnerText(StringCompareType.NotContain, "Error");
            span.AssertContent().StartTagContent(StringCompareType.StartsWith, "<span");

            HtmlDiv topdiv = Find.ById <HtmlDiv>("topmost");

            topdiv.AssertContent().TextContent(StringCompareType.Exact, "Top most text");
            topdiv.AssertContent().InnerText(StringCompareType.Exact,
                                             "Top most textMiddle level textInnermost text");
            topdiv.AssertContent().OuterMarkup(StringCompareType.EndsWith,
                                               "Innermost text</DIV></DIV></DIV>");
            topdiv.AssertContent().InnerMarkup(StringCompareType.EndsWith,
                                               "Innermost text</DIV></DIV>");

            // Select checks
            HtmlSelect select = Find.ById <HtmlSelect>("color_product");

            select.AssertSelect().ItemsCountIs(NumberCompareType.Equals, 5);
            select.AssertSelect().SelectedIndex(NumberCompareType.Equals, 0);
            select.AssertSelect().SelectedText(StringCompareType.Exact, "Color : Blue");
            select.AssertSelect().SelectedValue(StringCompareType.Exact, "Blue");

            select.SelectByIndex(3);
            select.AssertSelect().SelectedIndex(NumberCompareType.Equals, 3);
            select.AssertSelect().SelectedText(StringCompareType.Exact, "Color : Orange");
            select.AssertSelect().SelectedValue(StringCompareType.Exact, "Orange");

            select.AssertSelect().TextExists("Color : Black");
            select.AssertSelect().TextExistsNot("Color : Magenta");
            select.AssertSelect().ValueExists("Black");
            select.AssertSelect().ValueExistsNot("Magenta");

            // Style checks
            NameValueCollection styles = span.Styles;

            span.AssertStyle().Font(ArtOfTest.WebAii.Controls.HtmlControls.HtmlAsserts.HtmlStyleFont.Style, "italic");
            span.AssertStyle().Text(ArtOfTest.WebAii.Controls.HtmlControls.HtmlAsserts.HtmlStyleText.TextAlign, "right");
            span.AssertStyle().ColorAndBackground(ArtOfTest.WebAii.Controls.HtmlControls.HtmlAsserts.HtmlStyleColorAndBackground.Color, "red",
                                                  ArtOfTest.WebAii.Controls.HtmlControls.HtmlAsserts.HtmlStyleType.Computed,
                                                  StringCompareType.Exact);

            // Table checks
            HtmlTable table = Find.ById <HtmlTable>("outertable1");

            table.AssertTable().ColumnCount(NumberCompareType.Equals, 3);
            table.AssertTable().ColumnRange(NumberRangeCompareType.InRange, 2, 5);
            table.AssertTable().RowCount(NumberCompareType.Equals, 3);
            table.AssertTable().RowRange(NumberRangeCompareType.OutsideRange, 1, 2);
            table.AssertTable().Contains(StringCompareType.Contains, "TD5");
            table.AssertTable().Contains(StringCompareType.NotContain, "TD37");
        }