public void ThenThePropertyShouldBeDeleted()
        {
            var ScreenshotPath = Global.SaveScreenShot.SaveScreenshot(Global.GlobalDriver.driver, "Deleting is successful", Global.CommonFeatures.ScreenshotPath);

            Thread.Sleep(1500);
            CommonFeatures.Teardown();
        }
Beispiel #2
0
        public void ThenANewPropertyGetsAdded()
        {
            var ScreenshotPath = Global.SaveScreenShot.SaveScreenshot(Global.GlobalDriver.driver, "Adding is successful", Global.CommonFeatures.ScreenshotPath);

            Thread.Sleep(1500);
            CommonFeatures.Teardown();
        }
Beispiel #3
0
 public void GivenIHaveLoggedIn()
 {
     CommonFeatures.Initialize();
     CommonFeatures.test = CommonFeatures.extent.StartTest("Test - Add New Property");
     Pages.Login.LoginSteps();
     Assert.AreEqual("Dashboard", GlobalDriver.driver.Title);
     CommonFeatures.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Successful Login");
 }
Beispiel #4
0
        public void SetUpEnvironment()
        {
            string clientSecret = TestContext.Parameters["CLIENT_SECRET"].ToString();
            int    env1         = Convert.ToInt32(clientSecret);

            // Initializing Environment Configuration
            xmlReader = new XmlReader();
            xmlReader.LoadXML(GlobalVariables.EnvConfigurationPath);
            string         execution = xmlReader.ReadTagValue("Execution");
            CommonFeatures cf        = new CommonFeatures();

            //cf.ExtractPDF();
            if (execution.Equals("Server"))
            {
                //select environment as per env value
                switch (env1)
                {
                case 1:
                    cf.Environment01();
                    break;

                case 2:
                    cf.Environment02();
                    break;

                case 3:
                    cf.Environment03();
                    break;

                default:
                    cf.Environment01();
                    break;
                }
            }
            else
            {
                cf.Environment01();
            }

            GlobalVariables.Environment        = xmlReader.ReadTagValue("Environment");
            GlobalVariables.Browser            = xmlReader.ReadTagValue("Browser");
            GlobalVariables.ReportType         = xmlReader.ReadTagValue("ReportType", "ReportConfiguration");
            GlobalVariables.ScreenshotType     = xmlReader.ReadTagValue("ScreenshotType", "ReportConfiguration");
            GlobalVariables.VideoRecordingFlag = xmlReader.ReadTagValue("VideoRecording", "ReportConfiguration");

            //Initializing extent Report
            extentReport.StartReport();

            //Start video recording
            //if (GlobalVariables.VideoRecordingFlag.Equals("Yes"))
            //{
            //    // rec = new Recorder(new VideoRecorder(GlobalVariables.logReportFolder + "/VideoReport.mp4", 2, SharpAvi.KnownFourCCs.Codecs.MotionJpeg, 30));
            //}
            //Process.Start(GlobalVariables.CaffeinFile);
        }
Beispiel #5
0
        public void ThenISuccesfullyLoginToHomePage()
        {
            //verification assertion
            Assert.AreEqual("Dashboard", GlobalDriver.driver.Title);
            CommonFeatures.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Successful Login");

            //To skip the alert
            GenericMethods.ButtonClick(Global.GlobalDriver.driver, "XPath", "/html/body/div[5]/div/div[5]/a[1]");
            //closing the browser
            CommonFeatures.Teardown();
        }
Beispiel #6
0
        public void GivenIHaveLoggedIntoTheHomepageByUsernameAndPassword()
        {
            CommonFeatures.Initialize();
            CommonFeatures.test = CommonFeatures.extent.StartTest("Test - Property Owner Dashboard");
            Pages.Login.LoginSteps();

            //To skip the alert
            Thread.Sleep(1000);
            GenericMethods.ButtonClick(Global.GlobalDriver.driver, "XPath", "//body/div[5]/div//div[5]/a[1]");
            Thread.Sleep(2500);

            // login validation
            Assert.AreEqual("Dashboard", GlobalDriver.driver.Title);
            CommonFeatures.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Successful Login");
        }
Beispiel #7
0
 public void GivenIHaveLoggedIntoTheHomepage()
 {
     CommonFeatures.Initialize();
     CommonFeatures.test = CommonFeatures.extent.StartTest("Test - Search, Sort by Name and Edit");
     Pages.Login.LoginSteps();
 }
Beispiel #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string metaText = string.Empty, currentUrl;

            if (!string.IsNullOrEmpty(this.MetaTitle))
            {
                Page.Title = this.MetaTitle;
            }

            if (!string.IsNullOrEmpty(this.MetaDescription))
            {
                metaText += "<meta name=\"description\" content=\"" + this.MetaDescription + "\" />";
            }
            if (!string.IsNullOrEmpty(this.MetaKeywords))
            {
                metaText += "<meta name=\"keywords\" content=\"" + this.MetaKeywords + "\" />";
            }

            metadata.Text = metaText;

            currentUrl = HttpContext.Current.Request.RawUrl;

            if (currentUrl.IndexOf("utm_") != -1)
            {
                if (Session["utm"] == null)
                {
                    Session["utm"] = "y";
                }
            }

            if (Session["utm"] != null || !string.IsNullOrEmpty(CommonFeatures.ReadCookie("utmc")))
            {
                string connectionString = string.Empty, utmSessionId = string.Empty;
                int    index;

                // A returning utm visitor will have the utmc cookie
                utmSessionId = CommonFeatures.ReadCookie("utmc");

                // if its NOT a returning utm visitor
                if (string.IsNullOrEmpty(utmSessionId))
                {
                    utmSessionId = Session.SessionID;
                    CommonFeatures.WriteCookie("utmc", utmSessionId);
                }

                index = currentUrl.IndexOf("?");

                if (index != -1)
                {
                    currentUrl = currentUrl.Replace("?", "?spg=1&");
                }

                NameValueCollection queryString = HttpUtility.ParseQueryString(currentUrl);

                if (Request.IsLocal)
                {
                    connectionString = "Server=localhost;Database=almacantar;Uid=root;Pwd=jhp5uck5;Allow Zero Datetime=True;";
                }
                else
                {
                    connectionString = "Server=mysql.surgesolutions.co.uk;Database=almacantar;Uid=almacantar_user;Pwd=*d3v3!0pm3nt5*;Allow Zero Datetime=True;";
                }

                CommonFeatures commonFeatures = new CommonFeatures(connectionString);

                UTMItem utmItem = new UTMItem();
                utmItem.Campaign   = queryString["utm_campaign"];
                utmItem.Content    = queryString["utm_content"];
                utmItem.Department = queryString["utm_department"];

                if (index == -1)
                {
                    utmItem.PageUrl = "https://www.lyonsplace.co.uk" + currentUrl;
                }
                else
                {
                    utmItem.PageUrl = "https://www.lyonsplace.co.uk" + currentUrl.Substring(0, index);
                }

                utmItem.PageName      = this.MetaTitle;
                utmItem.MEID          = string.Empty;
                utmItem.SessionID     = utmSessionId;
                utmItem.Source        = queryString["utm_source"];
                utmItem.Medium        = queryString["utm_medium"];
                utmItem.QS            = currentUrl;
                utmItem.DevelopmentID = "3";
                commonFeatures.RecordUTM(utmItem);
            }
        }
 public void ThenTheResultShouldBeOnTheScreen(int p0)
 {
     // var ScreenshotPath = Global.SaveScreenShot.SaveScreenshot(Global.GlobalDriver.driver, "Adding is successful", Global.CommonFeatures.ScreenshotPath);
     // Thread.Sleep(1500);
     CommonFeatures.Teardown();
 }
 public void GivenILoginToHomePage()
 {
     CommonFeatures.Initialize();
     CommonFeatures.test = CommonFeatures.extent.StartTest("Test - Arrow Key");
     Login.LoginSteps();
 }
Beispiel #11
0
 public void ThenIAmSuccessfulToSignoutAndReachLoginPage()
 {
     CommonFeatures.Teardown();
 }
Beispiel #12
0
 public void ThenMyNavigationIsUninterrupted()
 {
     CommonFeatures.Teardown();
 }
 public void ThenMyNavigationShouldBeWorkingUninterrupted()
 {
     CommonFeatures.Teardown();
 }
Beispiel #14
0
 public void ThenPropertyIsSortedByName()
 {
     CommonFeatures.Teardown();
 }
Beispiel #15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string referer, subject;

            referer = Request.ServerVariables["http_referer"];
            subject = Request.Form["fsubject"];

            if (Request.IsLocal || (referer.IndexOf("lyons") > 0 && subject != null))
            {
                string         body, outcome, fromName, logText = string.Empty, connectionString = string.Empty, notes;
                string         title_id = string.Empty, source_id = string.Empty, country_id = string.Empty;
                string         reason_id = string.Empty, applicantId, utmSessionId, utmSource = string.Empty, utmCampaign = string.Empty;
                CommonFeatures commonFeatures;

                if (Request.IsLocal)
                {
                    connectionString = "Server=localhost;Database=almacantar;Uid=root;Pwd=jhp5uck5;Allow Zero Datetime=True;";
                }
                else
                {
                    connectionString = "Server=mysql.surgesolutions.co.uk;Database=almacantar;Uid=almacantar_user;Pwd=*d3v3!0pm3nt5*;Allow Zero Datetime=True;";
                }

                if (string.IsNullOrEmpty(Request.Form["ftitle"]))
                {
                    title_id = "0";
                }
                else
                {
                    title_id = Request.Form["ftitle"].ToString().Split('|')[0];
                }

                if (string.IsNullOrEmpty(Request.Form["fenquiry-source"]))
                {
                    source_id = "0";
                }
                else
                {
                    source_id = Request.Form["fenquiry-source"].ToString().Split('|')[0];
                }

                if (string.IsNullOrEmpty(Request.Form["fcountry"]))
                {
                    country_id = "0";
                }
                else
                {
                    country_id = Request.Form["fcountry"].ToString().Split('|')[0];
                }

                if (string.IsNullOrEmpty(Request.Form["freason-for-purchase"]))
                {
                    reason_id = "0";
                }
                else
                {
                    reason_id = Request.Form["freason-for-purchase"].ToString().Split('|')[0];
                }

                SiteVariables vars = new SiteVariables();

                fromName = Request.Form["ffirst-name"] + " " + Request.Form["flast-name"];

                body = "<p>A User has sent the following " + subject + " Request From Lyons Place Website.</p>";

                foreach (String sItem in Request.Form)
                {
                    if (!string.IsNullOrEmpty(sItem))
                    {
                        body += "<p>" + sItem.Substring(1).ToUpper() + ": " + Request.Form[sItem] + "</p>";
                    }
                    logText += "\"" + Request.Form[sItem] + "\",";
                }

                commonFeatures = new CommonFeatures(connectionString);

                utmSessionId = CommonFeatures.ReadCookie("utmc");

                if (!string.IsNullOrEmpty(utmSessionId))
                {
                    UTMItem utmItem = commonFeatures.GetUTMForExport(utmSessionId);

                    if (!string.IsNullOrEmpty(utmItem.ID))
                    {
                        body    += "<p>UTM Campaign: " + utmItem.Campaign + "</p>";
                        logText += "\"" + utmItem.Campaign + "\",";

                        // save utm
                        utmItem.PageUrl       = "ProcessForm.aspx";
                        utmItem.PageName      = "REGD";
                        utmItem.SessionID     = utmSessionId;
                        utmItem.DevelopmentID = "3";
                        commonFeatures.RecordUTM(utmItem);

                        source_id   = "38";
                        utmSource   = utmItem.Source;
                        utmCampaign = utmItem.Campaign;
                    }
                }

                LogFile logFile = new LogFile();
                logFile.LogFileName = "contact-us-" + DateTime.Now.ToString("dd-MM-yyyy") + ".txt";
                logFile.AddLine(logText + "\"" + DateTime.Now.ToString("dd-MM-yyyy HH:mm:ss") + "\"");

                notes = "Interested in " + Request.Form["interested"] + Environment.NewLine + Environment.NewLine
                        + Request.Form["fcomments"];

                List <string> applicant = new List <string>();
                applicant.Add(title_id);
                applicant.Add(Request.Form["ffirst-name"]);
                applicant.Add(Request.Form["flast-name"]);
                applicant.Add(Request.Form["fmobile"]);
                applicant.Add(Request.Form["femail"]);
                applicant.Add(source_id);
                applicant.Add(country_id);
                applicant.Add(reason_id);
                applicant.Add(notes);
                applicant.Add("3");                 // development Id
                applicant.Add(utmSessionId);
                applicant.Add(utmSource);
                applicant.Add(utmCampaign);
                applicantId = commonFeatures.RecordApplicantInCRM(applicant);

                if (!Request.IsLocal)
                {
                    GenFolders(fromName + "-" + applicantId);
                }

                Email oEmail = new Email();
                oEmail.SMTPServer         = "smtp.socketlabs.com";
                oEmail.CredentialUsername = "******";
                oEmail.CredentialPassword = "******";
                oEmail.EnableSsl          = false;

                oEmail.FromName    = fromName;
                oEmail.EmailFrom   = vars["emailfrom"];
                oEmail.ReplyToName = fromName;
                oEmail.ReplyTo     = Request.Form["femail"];
                oEmail.ToName      = vars["toname"];
                oEmail.EmailTo     = vars["emailto"];
                oEmail.Subject     = subject + " Request From Lyons Place website";
                oEmail.IsBodyHtml  = true;
                oEmail.Body        = body;

                outcome = oEmail.SendEmail();

                body = "Hi James Guilfoyle,"
                       + "<br /><br />"
                       + "Please see the new lead below."
                       + "<br /><br />"
                       + "<strong>" + fromName + "</strong>: https://www.almacantar.surgesolutions.co.uk/applicant-profile/" + applicantId;

                oEmail.ToName  = "James Guilfoyle";
                oEmail.EmailTo = "*****@*****.**";
                oEmail.Subject = "Lyons Place - New Lead";
                oEmail.Body    = body;

                outcome = oEmail.SendEmail();

                Response.Write("OK");
            }
        }
Beispiel #16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            short  siteId;
            string ddHtml;

            if (Session["utm"] != null || !string.IsNullOrEmpty(CommonFeatures.ReadCookie("utmc")))
            {
                this.UTMSession = true;
            }
            else
            {
                this.UTMSession = false;
            }

            SiteVariables vars = new SiteVariables();

            siteId = short.Parse(vars["siteid"]);

            NavPopulator navPopulator;

            navPopulator = new NavPopulator(ref footernav, siteId, 0, "", "", "", 2);

            currentyear.Text = DateTime.Now.Year.ToString();


            //country of residence

            ListBox listBox = new ListBox(new SiteData().ConnectionString);

            listBox.LoadCountryOfResidence();

            ddHtml = "<select onchange=\"LabelAnimationSelect('fcountry')\" id=\"fcountry\"><option></option>";

            foreach (ListBoxItem itemlb in listBox.ListBoxItems)
            {
                ddHtml += "<option value=\"" + itemlb.ItemID + "|" + itemlb.Title + "\">" + itemlb.Title + "</option>";
            }

            ddHtml += "</select>";

            this.CountryDropDown = ddHtml;

            //Reason of purchase

            listBox.ListBoxItems.Clear();
            listBox.LoadReasonOfPurchase();

            ddHtml = "<select onchange=\"LabelAnimationSelect('freason-for-purchase')\" id=\"freason-for-purchase\"><option></option>";

            foreach (ListBoxItem itemlb in listBox.ListBoxItems)
            {
                ddHtml += "<option value=\"" + itemlb.ItemID + "|" + itemlb.Title + "\">" + itemlb.Title + "</option>";
            }

            ddHtml += "</select>";

            this.ReasonPurchaseDropDown = ddHtml;

            //enquiry Source

            listBox.ListBoxItems.Clear();
            listBox.LoadEnquirySource();

            ddHtml = "<select onchange=\"LabelAnimationSelect('fenquiry-source')\" id=\"fenquiry-source\"><option></option>";

            foreach (ListBoxItem itemlb in listBox.ListBoxItems)
            {
                ddHtml += "<option value=\"" + itemlb.ItemID + "|" + itemlb.Title + "\">" + itemlb.Title + "</option>";
            }

            ddHtml += "</select>";

            this.EnquirySourceDropDown = ddHtml;

            //title dropdown

            listBox.ListBoxItems.Clear();
            listBox.LoadTitles();

            ddHtml = "<select onchange=\"LabelAnimationSelect('ftitle')\" id=\"ftitle\"><option></option>";

            foreach (ListBoxItem itemlb in listBox.ListBoxItems)
            {
                ddHtml += "<option value=\"" + itemlb.ItemID + "|" + itemlb.Title + "\">" + itemlb.Title + "</option>";
            }

            ddHtml += "</select>";

            this.TitleDropDown = ddHtml;



            /*****  Footer nav content *****/

            PageTextPopulator pageTextPopulator;

            pageTextPopulator   = new PageTextPopulator(1129, 1, siteId);
            this.CoockieContent = "<h1 class=\"footetputitle\">" + pageTextPopulator.PageTitle + "</h1>" + pageTextPopulator.Body;

            pageTextPopulator     = new PageTextPopulator(1130, 1, siteId);
            this.DisclaimerContet = "<h1 class=\"footetputitle\">" + pageTextPopulator.PageTitle + "</h1>" + pageTextPopulator.Body;

            pageTextPopulator   = new PageTextPopulator(1131, 1, siteId);
            this.PrivacyContent = "<h1 class=\"footetputitle\">" + pageTextPopulator.PageTitle + "</h1>" + pageTextPopulator.Body;


            /*********** session cookie policy ******/

            //string aaaa = Context.Session["lp-cookie"].ToString();
        }
Beispiel #17
0
 public void ThenICanSeeMyHomepage()
 {
     CommonFeatures.Teardown();
 }
Beispiel #18
0
 public void GivenIHaveNavigatedToFacebook_Com()
 {
     CommonFeatures.Initialize();
     LogIn.Navigation();
 }