Beispiel #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!UserValidationFacade.IsLoggedIn())
        {
            Response.Redirect("/Composite/Login.aspx?ReturnUrl=" + Request.Url.PathAndQuery);
            return;
        }
        ScriptLoader.Render("sub");


        rptCountryList.DataSource = DataFacade.GetData <Country>().Take(10)
                                    .ToArray()
                                    .Select(x =>
        {
            var editLink = new EditLink()
            {
                Label = x.Name
            };

            if (DataScopeManager.CurrentDataScope != DataScopeIdentifier.Administrated)
            {
                editLink.Link = String.Empty;
                return(editLink);
            }

            var teaser = x;

            //var editWorkflowAttribute = teaser.DataSourceId.InterfaceType.GetCustomAttributes(true).OfType<EditWorkflowAttribute>().FirstOrDefault();
            //if (editWorkflowAttribute == null)
            //{
            //    editLink.Link = string.Empty;
            //    return editLink;
            //}


            var page                  = PageManager.GetPageById(Guid.Parse("63ec1a73-b1ed-4ec8-923f-2840448c43ce"));
            var entityToken           = new PageTeaserInstanceEntityToken(page, teaser);
            var serializedEntityToken = EntityTokenSerializer.Serialize(entityToken, true);

            var editActionToken       = new WorkflowActionToken(typeof(EditWorkflowAttribute));
            var serializedActionToken = ActionTokenSerializer.Serialize(editActionToken, true);

            var html = String.Format("<a href=\"#\" data-providername='{0}' data-entitytoken='{1}' data-actiontoken=\"{2}\" data-piggybag='{3}' data-piggybaghash='{4}' onclick=\"executeAction(this)\">{5}</a>",
                                     teaser.DataSourceId.ProviderName,
                                     serializedEntityToken,
                                     serializedActionToken,
                                     String.Empty,
                                     HashSigner.GetSignedHash(string.Empty).Serialize(),
                                     "edit");

            editLink.Link = html;
            return(editLink);
        });


        rptCountryList.DataBind();
    }
 public void ClickOnEditLink()
 {
     if (EditLink.Displayed)
     {
         EditLink.Click();
     }
     else
     {
         throw new Exception("Element is not found or not clickable");
     }
 }
Beispiel #3
0
 public void ClickOnEditLink()
 {
     if (EditLink.Displayed)
     {
         EditLink.Click();
     }
     else
     {
         Exception e;
     }
 }
        private void FindDeleteLink()
        {
            var parent = EditLink.GetParentElement();

            DeleteLink = null;
            foreach (var e in parent.FindElements(OpenQA.Selenium.By.ClassName("NavLeft_Item")))
            {
                if (!e.Text.Contains("Delete"))
                {
                    continue;
                }
                DeleteLink = e;
                break;
            }
        }
 /// <summary>
 /// select actions, then select edit
 /// </summary>
 public void SelectEdit()
 {
     SelectActions();
     EditLink.Wait(3).Click();
     DriverCommands.WaitAndMeasurePageLoadTime(90, 30);
 }
 /// <summary>
 /// edit
 /// </summary>
 public void SelectEdit()
 {
     EditLink.Click();
 }
Beispiel #7
0
 /// <summary>
 /// click the edit link
 /// </summary>
 public void SelectEdit()
 {
     EditLink.Click();
     //on passage type, returns /Assess/Items/EditPassage.aspx
     //on item type, returns /Assess/Items/EditTestItem.aspx
 }
        public void FeeList_Submission_SPP()
        {
            AJAXCall.WaitForAjax();
            Thread.Sleep(900);

            CommonUtils cookiesScreen = new CommonUtils(driver);

            cookiesScreen.RejectAll_Cookies();

            Thread.Sleep(900);
            SignIn_Page.Click();


            Excel_Suite userEmail = new Excel_Suite(Env.EXCEL_TEST_URL);

            userEmail.getCellData("SPP_TestData", true);
            UserEmail.SendKeys(Env.Email_Id);
            Password.SendKeys("Test@123");



            WebDriverWait wait = new WebDriverWait(driver, System.TimeSpan.FromSeconds(800));

            Thread.Sleep(800);
            SubmitButton.Click();

            MyAccount_Toggle.Click();

            AJAXCall.WaitForAjax();
            FeesList_Link.Click();

            AJAXCall.WaitForAjax();
            Thread.Sleep(1000);
            EditLink.Click();
            EditButton.Click();

            createBox.Click();
            Thread.Sleep(800);

            driver.SwitchTo().Frame(1);

            Eyp_name.SendKeys("TestAutomation");

            Eyp_agerange.SendKeys("5-10");

            SelectElement option = new SelectElement(Eyp_ecceavailable);

            option.SelectByText("Yes");

            Eyp_fullpriceperweek_Text.SendKeys("100.00");

            Thread.Sleep(800);
            Eyp_daysperweek.SendKeys("5");
            Eyp_hoursperweek.SendKeys("40");


            Effective_Date.SendKeys("01/11/2020");

            InsertButton.Click();
            AJAXCall.WaitForAjax();
            driver.SwitchTo().DefaultContent();
        }
 public EditPage edit()
 {
     EditLink.Click();
     return(new EditPage(_driver));
 }
        public void SearchThroughAccountName(IWebDriver driver)
        {
            SignIn_Page.Click();

            UserEmail.SendKeys("*****@*****.**");
            Password.SendKeys("Test@123");

            WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(800));

            Thread.Sleep(800);
            SubmitButton.Click();

            MyAccount_Toggle.Click();

            BankAccount_Page.Click();

            AJAXCall.WaitForAjax();
            Thread.Sleep(1000);
            downArrow.Click();

            wait = new WebDriverWait(driver, TimeSpan.FromSeconds(900));

            Thread.Sleep(1000);
            EditLink.Click();

            Actions action = new Actions(driver);

            action.KeyDown(Keys.Control).SendKeys(Keys.End).Perform();

            NextButton.Click();
            AJAXCall.WaitForAjax();
            Thread.Sleep(2000);

            if (AJAXCall.IsElementPresent(By.PartialLinkText("Upload Document")))
            {
                action.KeyDown(Keys.Control).SendKeys(Keys.End).Perform();
                NextButton.Click();
            }
            else
            {
                Thread.Sleep(1000);
            }

            AJAXCall.WaitForAjax();
            Thread.Sleep(1000);

            Thread.Sleep(2000);

            wait = new WebDriverWait(driver, TimeSpan.FromSeconds(100));

            if (AJAXCall.IsElementPresent(By.Id("eyp_validationcode")))
            {
                Excel_Suite read_BankCode = new Excel_Suite(@"C:\Pobal_AutomationProject\Pobal_Test_Project\Automation_Suite\TestData_Repository\BankCode.xlsx");
                read_BankCode.getCellData("Bank_Sheet", false);

                IWebElement value_Code = driver.FindElement(By.XPath("//*[@id='eyp_validationcode']"));
                value_Code.Click();
                value_Code.Clear();
                Thread.Sleep(2000);

                value_Code.SendKeys(Keys.Tab);
                value_Code.SendKeys(Env.Data_Retrieve);
            }
            NextButton.Click();
        }