Exemplo n.º 1
0
        // TODO - move Search into a Generic Gallery Parent Class (and others that use this standard layout)
        public static void SearchPartsByName(string name)
        {
            try
            {
                // Added another waitclick to allow time for page to load
                BaseComponent.WaitClick("//div[contains(@id,'tabExplorerTabs_div0') and contains(@style,'block')]//span[text()='Site Content']", 160);
                BBISHomePageCustom.GetEnabledElement("//div[contains(@class,'ExplorerTabs')]//td[./text()='Search']", 160);
                BBISHomePageCustom.WaitClick("//div[contains(@class,'ExplorerTabs')]//td[./text()='Search']", 160);
            }
            catch
            {
                // Added another waitclick to allow time for page to load
                BaseComponent.WaitClick("//div[contains(@id,'tabExplorerTabs_div0') and contains(@style,'block')]//span[text()='Site Content']", 160);
                BBISHomePageCustom.GetEnabledElement("//div[contains(@class,'ExplorerTabs')]//td[./text()='Search']", 160);
                BBISHomePageCustom.WaitClick("//div[contains(@class,'ExplorerTabs')]//td[./text()='Search']", 160);
            }

            const string getXfilterByNameField = "//input[contains(@id,'_txtName')]";

            BBISHomePageCustom.SetTextField(getXfilterByNameField, name);

            WaitClick("//input[contains(@class,'SearchButton')]");

            GetDisplayedElement("//div[contains(@class,'ExplorerPath')]//span[text()[contains(.,'Search Results:')]]");
        }
Exemplo n.º 2
0
        // TODO - move Search into a Generic Gallery Parent Class (and others that use this standard layout)
        public static void SearchPartsByName(string name)
        {
            BBISHomePageCustom.WaitClick("//div[contains(@class,'ExplorerTabs')]//td[./text()='Search']", 15);

            const string getXfilterByNameField = "//input[contains(@id,'_txtName')]";

            BBISHomePageCustom.SetTextField(getXfilterByNameField, name);

            WaitClick("//input[contains(@class,'SearchButton')]");

            GetDisplayedElement("//div[contains(@class,'ExplorerPath')]//span[text()[contains(.,'Search Results:')]]");
        }
Exemplo n.º 3
0
        public static void NewPage(string name)
        {
            var    waiter   = new WebDriverWait(Driver, TimeSpan.FromSeconds(10));
            string handle   = Driver.CurrentWindowHandle;
            string template = "QA template";

            WaitClick(getXNewPageButton);
            waiter.Until(d => d.WindowHandles.Count == 2);
            Driver.SwitchTo().Window(Driver.WindowHandles.Last());
            BBISHomePageCustom.SetTextField("//input[contains(@id,'_PageName')]", name);

            WaitClick(string.Format("//option[text()='{0}']", template));

            WaitClick("//*[contains(@class,'BBAdminButtonLabel') and ./text()='Next']");
            Driver.SwitchTo().Window(handle);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Creates a new User Login part with default mandatory values and table of optional field values.
        /// </summary>
        /// <param name="name"></param>
        /// <param name="fields"></param>
        public static void NewUserLoginPart(string name, List <dynamic> fields)
        {
            var    waiter = new WebDriverWait(Driver, TimeSpan.FromSeconds(10));
            string handle = Driver.CurrentWindowHandle;

            WaitClick(getXNewPartButton);
            waiter.Until(d => d.WindowHandles.Count == 2);
            Driver.SwitchTo().Window(Driver.WindowHandles.Last());
            WaitClick("//*[contains(@class,'PartDropDownHit')]");
            WaitClick("//a[contains(@id,'_ContentTypeSelector') and ./text()='User Login']");
            BBISHomePageCustom.SetTextField("//*[contains(@class,'FieldPartName')]", name);
            WaitClick("//*[contains(@class,'BBAdminButtonLabel') and ./text()='Next']");

            WaitClick("//span[contains(@class,'BBAdminButtonLabel') and ./text()='Forgotten Password/Username Email']");
            waiter.Until(d => d.WindowHandles.Count == 3);
            Driver.SwitchTo().Window(Driver.WindowHandles.Last());
            BBISHomePageCustom.SetTextField("//input[contains(@id,'FromAddress')]", "*****@*****.**");
            BBISHomePageCustom.SetTextField("//input[contains(@id,'DisplayName')]", "gherkin");

            WaitClick("//*[contains(@class,'BBAdminButtonLabel') and ./text()='Save']");
            waiter.Until(d => d.WindowHandles.Count == 2);
            Driver.SwitchTo().Window(Driver.WindowHandles.Last());

            WaitClick("//span[contains(@class,'BBAdminButtonLabel') and ./text()='New User Registration Email']");
            waiter.Until(d => d.WindowHandles.Count == 3);
            Driver.SwitchTo().Window(Driver.WindowHandles.Last());
            BBISHomePageCustom.SetTextField("//input[contains(@id,'FromAddress')]", "*****@*****.**");
            BBISHomePageCustom.SetTextField("//input[contains(@id,'DisplayName')]", "gherkin");

            WaitClick("//*[contains(@class,'BBAdminButtonLabel') and ./text()='Save']");
            waiter.Until(d => d.WindowHandles.Count == 2);
            Driver.SwitchTo().Window(Driver.WindowHandles.Last());

            foreach (var f in fields)
            {
                WaitClick("//tr[td[text()='" + f.AdditionalField + "']]//input[contains(@type,'checkbox') and contains(@id,'chkFieldInclude')]");
            }

            WaitClick("//*[contains(@class,'BBAdminButtonLabel') and ./text()='Save']");
            Driver.SwitchTo().Window(handle);
        }