public void NullLoginVerify()
 {
     CommonActions.WaitForPageLoad();
     Report.LogInfo("Null login message is displayed");
     Report.TakeScreenshot();
     Waits.WaitForElementToBeVisible(txterror, Core.WaitType.Small);
 }
 public void VerifyDonorSuite(string donorid, string grade)
 {
     if (donorid != "NONE")
     {
         Waits.WaitForElementToBeVisible(GetDNRRadioBtnLocator(donorid), Core.WaitType.Small);
     }
     else
     {
         Waits.WaitForElementToBeVisible(btnnew, Core.WaitType.Small);
     }
     CommonActions.WaitForPageLoad();
     Report.LogInfo("Donor: DGM" + donorid + " is returned with grade " + grade);
     Report.TakeScreenshot();
     if (donorid != "NONE")
     {
         Verify.ExactTextInElementIs(strrtndnid, "DGM" + donorid);
         Verify.ExactTextInElementIs(strrtngrade, grade);
     }
     else
     {
         Verify.ElementIsNotPresent(rtndata);
     }
     //clear the screen
     Actions.Click(btnclear);
     CommonActions.WaitForPageLoad();
 }
 public void InvalidLoginVerify()
 {
     CommonActions.WaitForPageLoad();
     Waits.WaitForAlertToBePresent(Core.WaitType.Small);
     Report.LogInfo("Invalid login message is displayed");
     Report.TakeScreenshot();
     Verify.VerifyBrowserAlertMsg("Invalid Login", Core.WaitType.Small);
 }
 public void LoginVerify()
 {
     CommonActions.WaitForPageLoad();
     Waits.WaitForElementToBeInvisible(By.Id("loading-dialog"), Core.WaitType.Small);
     Verify.ExactPageTitle(ONSITEMODULEMAINMENU);
     Report.LogInfo("User is logged in and Onsite Menu is displayed.");
     Report.TakeScreenshot();
 }
 //Sample Method using Actions, Waits, Verify :)
 public void OpenActivateDriveScreen()
 {
     if (Actions.IsDisplayed(btngotoactivatedrive))
     {
         Actions.Click(btngotoactivatedrive);
     }
     else
     {
         Actions.Click(lnkactivatedrive);
     }
     CommonActions.WaitForPageLoad();
     Verify.ExactPageTitle(ONSITEACTIVATEDRIVE);
 }
        //#region Getters/Setters
        //public string LastName
        //{
        //    get => Actions.GetAttributeValue(txtlastname, "value");
        //    set
        //    {
        //        if (!string.IsNullOrEmpty(value.Trim()))
        //        {
        //            CommonActions.SetText(txtlastname, value);
        //            GlobalData.Set("LastName", value);
        //        }
        //    }
        //}

        //public string FirstName
        //{
        //    get => Actions.GetAttributeValue(txtfirstname, "value");
        //    set
        //    {
        //        if (!string.IsNullOrEmpty(value.Trim()))
        //        {
        //            CommonActions.SetText(txtfirstname, value);
        //            GlobalData.Set("FirstName", value);
        //        }
        //    }
        //}

        //public string DateOfBirth
        //{
        //    get => Actions.GetAttributeValue(txtdob, "value");
        //    set
        //    {
        //        if (!string.IsNullOrEmpty(value.Trim()))
        //        {
        //            CommonActions.SetText(txtdob, value);
        //            GlobalData.Set("DateOfBirth", value);
        //        }
        //    }
        //}
        //public string Gender
        //{
        //    get => Actions.GetAttributeValue(selectsex, "value");
        //    set
        //    {
        //        if (!string.IsNullOrEmpty(value.Trim()))
        //        {
        //            CommonActions.SetText(selectsex, value);
        //            GlobalData.Set("Gender", value);
        //        }
        //    }
        //}
        //public string SSN
        //{
        //    get => Actions.GetAttributeValue(txtssn, "value");
        //    set
        //    {
        //        if (!string.IsNullOrEmpty(value.Trim()))
        //        {
        //            CommonActions.SetText(txtssn, value);
        //            GlobalData.Set("SSN", value);
        //        }
        //    }
        //}

        //#endregion

        public void FindDonorSuite(string ssn, string lastname, string firstname, string dob, string gender)
        {
            if (Actions.IsEnabled(txtlastname))
            {
                CommonActions.SetText(txtlastname, lastname);
                if (Actions.IsTextboxEmpty(txtlastname))
                {
                    CommonActions.SetText(txtlastname, lastname);
                }
            }
            if (Actions.IsEnabled(txtfirstname))
            {
                CommonActions.SetText(txtfirstname, firstname);
                if (Actions.IsTextboxEmpty(txtfirstname))
                {
                    CommonActions.SetText(txtfirstname, firstname);
                }
            }
            if (Actions.IsEnabled(txtdob))
            {
                CommonActions.SetText(txtdob, dob);
                if (Actions.IsTextboxEmpty(txtdob))
                {
                    CommonActions.SetText(txtdob, dob);
                }
            }
            if (Actions.IsEnabled(txtdob))
            {
                Actions.Click(selectsex);
                CommonActions.SetText(selectsex, gender);
                if (Actions.IsTextboxEmpty(selectsex))
                {
                    CommonActions.SetText(selectsex, gender);
                }
            }
            if (Actions.IsEnabled(txtssn))
            {
                CommonActions.SetText(txtssn, ssn);
                if (Actions.IsTextboxEmpty(txtssn))
                {
                    CommonActions.SetText(txtssn, ssn);
                }
            }
            Report.LogInfo("Enter Donor: " + firstname + " " + lastname);
            Report.LogInfo("SSN: " + ssn);

            Actions.Click(btnsearch);
            CommonActions.WaitForPageLoad();
        }
        //Sample Method using Actions, Waits, Verify :)
        public void LoginAsAdmin(string username, string password)
        {
            string url = WebEnvironment.AppSettings["AppUrl"];

            Console.WriteLine(url, " this is url attempted to hit");
            Log.Info(url);
            Actions.NavigateToUrl(url);
            CommonActions.WaitForPageLoad();
            Verify.ExactPageTitle(ONSITELOGIN);
            CommonActions.SetText(txtUsername, username);
            CommonActions.SetText(txtPassword, password);
            Report.LogInfo("Enter Username and Password");
            Waits.WaitForElementToBeInvisible(By.Id("loading-dialog"), Core.WaitType.Small);
            Report.TakeScreenshot();
            Actions.Click(btnLogin);
            CommonActions.WaitForPageLoad();
        }
 public void EnterDriveDate()
 {
     Verify.ExactPageTitle("BC-Onsite (Activate Drive)");
     Actions.SendKeys(txtdrivedate, Keys.Control + "a");
     Actions.SendKeys(txtdrivedate, Keys.Delete);
     CommonActions.SetText(txtdrivedate, "03/02/2019");
     Actions.SendKeys(txtdrivedate, Keys.Enter);
     Waits.WaitForElementToBeVisible(gridresults, WaitType.Small);
     CommonActions.WaitForPageLoad();
     Waits.WaitForElementToBeClickable(rdodrive, WaitType.Small);
     Actions.Click(rdodrive);
     Report.TakeScreenshot();
     Actions.Click(btnselectdrive);
     Report.TakeScreenshot();
     CommonActions.SetText(txtconfirmdrive, "DRV0166701");
     Report.TakeScreenshot();
     //Actions.Click(btnok);
     //Waits.WaitForPageLoad();
     //Verify.ExactPageTitle("BC-Onsite (Onsite Menu)");
     //Verify.ElementContainsText(txtdriveidfooter, "DRV0166698");
 }