Ejemplo n.º 1
0
        public void NavigateToMenu(string topLevelMenuName, string subMenuName)
        {
            string response;

            //Control topLevelMenu = new Control() { controlName = topLevelMenuName, controlType = "NavigationMenu", identificationType = "xpath", identificationValue = "/span[@class='navbar-item' and text()='" + topLevelMenuName + "']/../../" };
            //Control subMenu = new Control() { controlName = subMenuName, controlType = "NavigationMenu", identificationType = "xpath", identificationValue = "/a[@class='dropdown-toggle menu-top' and text()='" + subMenuName + "']" };

            Control topLevelMenu = new Control()
            {
                controlName = topLevelMenuName, controlType = "NavigationMenu", identificationType = "linkText", identificationValue = topLevelMenuName
            };
            Control subMenu = new Control()
            {
                controlName = subMenuName, controlType = "NavigationMenu", identificationType = "linkText", identificationValue = subMenuName
            };


            NavigateMenuActionParams navigateMenuActionParam = new NavigateMenuActionParams()
            {
                topLevelMenuLocatorJSON = JsonConvert.SerializeObject(topLevelMenu),
                childMenuLocatorJSON    = JsonConvert.SerializeObject(subMenu)
            };

            ProtractorConnect.command(new Action()
            {
                action = "Navigate", controlName = "Main Menu", actionParamsJSON = JsonConvert.SerializeObject(navigateMenuActionParam)
            });

            response = ProtractorConnect.getResponse(true);
        }
Ejemplo n.º 2
0
        public DashboardPage()
        {
            ProtractorConnect.command(new Control()
            {
                controlName = "Active Breadcrumb", controlType = "Label", identificationType = "class", identificationValue = "breadcrumb-item active"
            });

            ProtractorConnect.command(new Control()
            {
                controlName = "Main Menu", controlType = "NavigationMenu", identificationType = "class", identificationValue = "nav navbar-nav"
            });
        }
Ejemplo n.º 3
0
        public void Initiate()
        {
            ProtractorConnect.connect();

            string connectResponse = ProtractorConnect.getResponse();

            Assert.AreEqual("You are connected !", connectResponse);

            ProtractorConnect.command(new Launch()
            {
                browser = "chrome", applicationUrl = "https://localdev.riteq.com.au:8000/web/"
            });
            //ProtractorConnect.command(new Launch() { browser = "chrome", applicationUrl = "http://future.riteq.com.au:8011/Web/" });

            string browsertitle = ProtractorConnect.getResponse();

            Assert.AreEqual("Wfm Identity Provider Login", browsertitle);
        }
Ejemplo n.º 4
0
        public void LoginToWeb(string username, string password, Boolean immediateExecution = true)
        {
            ProtractorConnect.ImmediateExecution = immediateExecution;
            EnterTextActionParams enterTextActionParams;

            string response;

            enterTextActionParams = new EnterTextActionParams()
            {
                text = username
            };
            ProtractorConnect.command(new Action()
            {
                action = "EnterText", controlName = "User Name Textbox", actionParamsJSON = Newtonsoft.Json.JsonConvert.SerializeObject(enterTextActionParams)
            });

            response = ProtractorConnect.getResponse(immediateExecution);

            enterTextActionParams = new EnterTextActionParams()
            {
                text = password
            };
            ProtractorConnect.command(new Action()
            {
                action = "EnterText", controlName = "Password Textbox", actionParamsJSON = Newtonsoft.Json.JsonConvert.SerializeObject(enterTextActionParams)
            });

            response = ProtractorConnect.getResponse(immediateExecution);

            ProtractorConnect.command(new Action()
            {
                action = "Click", controlName = "Login Button"
            });

            response = ProtractorConnect.getResponse(immediateExecution);

            if (immediateExecution == false)
            {
                ProtractorConnect.sendCommands();
                response = ProtractorConnect.getResponse();
            }
        }
Ejemplo n.º 5
0
        public string obtainActivePageHeading(Boolean immediateExecution = true)
        {
            string headerText = "";

            ProtractorConnect.ImmediateExecution = immediateExecution;

            ProtractorConnect.command(new Action()
            {
                action = "Read", controlName = "Active Breadcrumb"
            });

            headerText = ProtractorConnect.getResponse(immediateExecution);

            if (immediateExecution == false)
            {
                ProtractorConnect.sendCommands();
                headerText = ProtractorConnect.getResponse();
            }

            return(headerText);
        }
Ejemplo n.º 6
0
        public LoginPage()
        {
            //Initiating Controls

            ProtractorConnect.command(new Control()
            {
                controlName = "User Name Textbox", controlType = "InputField", identificationType = "id", identificationValue = "UserName"
            });
            ProtractorConnect.command(new Control()
            {
                controlName = "Password Textbox", controlType = "InputField", identificationType = "id", identificationValue = "Password"
            });
            ProtractorConnect.command(new Control()
            {
                controlName = "Login Button", controlType = "Button", identificationType = "class", identificationValue = "btn-lg"
            });

            // ProtractorConnect.command(new Control(){ controlName = "User Name Textbox", controlType = "InputField", identificationType = "id", identificationValue = "inputUserName" });
            // ProtractorConnect.command(new Control() { controlName = "Password Textbox", controlType = "InputField", identificationType = "id", identificationValue = "inputPassword" });
            // ProtractorConnect.command(new Control() { controlName = "Login Button", controlType = "Button", identificationType = "class", identificationValue = "login-form__button" });
        }