private void HomePageButton_Click(object sender, EventArgs e) { MainPanel.Controls.Clear(); PreviousList.Clear(); BackButton.Visible = false; // SetTitle(Nazwy.strGlowna); var homepage = new Homepage(); homepage.SetUC(this); MainPanel.Controls.Add(homepage); }
private static void SaveHomepageImages(Homepage homepage, IEnumerable <BinaryFile> imageList) { var count = 0; var size = new Size(168, 124); foreach (BinaryFile image in imageList) { count++; HomepageImageManager.SaveHomepageImage(homepage, count, image, size); } }
public ActionResult HomeEdit([Bind(Include = "HomepageID,Hotline,Address,Email,FacebookLink,YoutubeLink,GoogleLink")] Homepage homepage) { if (ModelState.IsValid) { db.Entry(homepage).State = EntityState.Modified; db.SaveChanges(); var noti = "Cập Nhật Thành Công!"; return(RedirectToAction("Header", "Admin", new { Noti = noti })); } return(View(homepage)); }
public void CreateAccount() { var homePage = new Homepage(Driver); homePage.GoTo(); var loginPage = homePage.GoToAccountPage(); var registrationPage = loginPage.CreateNewAccount(); var accountPage = registrationPage.CreateAccount("Mahi", "Kumar", "*****@*****.**", "password", "password"); Assert.IsTrue(Driver.Title.Equals("My Account")); }
public ActionResult HomeEdit(string noti) { Homepage homepage = db.Homepage.Find(1); if (homepage == null) { return(HttpNotFound()); } ViewBag.Noti = noti; return(View(homepage)); }
public void SetUp() { //Initialize first chat driver and accompanying page models firstDriver = new ChromeDriver(); drivers.Add(firstDriver); firstUserChat = new ChatRoom(firstDriver); firstHomePage = new Homepage(firstDriver); firstDriver.Navigate().GoToUrl(applicationPath); }
public void GivenUserIsLoggedIn() { Homepage hp = new Homepage(Driver); ut.ClickOnElement(hp.loginBtn); LoginPage lp = new LoginPage(Driver); ut.EnterTextInElement(lp.email, TestConstants.Email); ut.EnterTextInElement(lp.password, TestConstants.Password); ut.ClickOnElement(lp.submit); }
public ActionResult Create([Bind(Include = "IDlich,Picture1,Picture2,Picture3,Picture4,Picture5,ForeignFollower,StudentsEnrolled,ClassesComplete,CertifiedTeachers,PictureGV,TenGV,MotaGV,PictureGV1,TenGV1,MotaGV1,PictureGV2,TenGV2,MotaGV2,PictureHV,TenHV,DiemHV,PictureHV1,TenHV1,DiemHV1,PictureHV2,TenHV2,DiemHV2,PictureHV3,TenHV3,DiemHV3,PictureHV4,TenHV4,DiemHV4,PictureHV5,TenHV5,DiemHV5,Khoahoc,Makhoahoc,Khaigiang,Thoigian,lichhoc,sobuoi,Khoahoc1,Makhoahoc1,Khaigiang1,Thoigian1,lichhoc1,sobuoi1,Khoahoc2,Makhoahoc2,Khaigiang2,Thoigian2,lichhoc2,sobuoi2,Khoahoc3,Makhoahoc3,Khaigiang3,Thoigian3,lichhoc3,sobuoi3,Khoahoc4,Makhoahoc4,Khaigiang4,Thoigian4,lichhoc4,sobuoi4")] Homepage homepage) { if (ModelState.IsValid) { db.homepages.Add(homepage); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(homepage)); }
// GET: Home public ActionResult Index() { Blog blog = db.blogs.Where(b => b.Published == true).OrderByDescending(b => b.PublishDate).First(); Testimonial test = db.Testimonials.Where(t => t.Approval == true).First(); Homepage homepage = new Homepage() { blog = blog, testimonial = test }; return(View(homepage)); }
public void VerifyCost() { var homePage = new Homepage(Driver); homePage.GoTo(); var mobilePage = homePage.OpenMobilePage(Driver); var priceOnMobilePage = mobilePage.GetXperiaPrice(); var experiaPage = mobilePage.OpenXperiaPage(Driver); var priceOnProductPage = experiaPage.GetPrice(); Assert.AreEqual(priceOnMobilePage, priceOnProductPage, "Some thing is different.. Look into it"); }
public void SearchText() { BingScriptsBase.BingTestContext.WriteLine("Test Start"); BrowserWindow.Launch(AppConfig.GetValue("URL")); Homepage.EnterSearchText("Bill Gates"); //Not recommended to Hardcode values in scripts Homepage.SubmitSearch(); //Not recommended to use Static Wait Statements as given below Playback.Wait(5000); //Not recommended to Hardcode values in scripts Verify.WaitForControlPropertyEqual(BING.SearchResultsUI.searchText, "Text", "Bill Gates", 15000); BingScriptsBase.BingTestContext.WriteLine("Test Stop"); }
public void NoMoreProduct() { var homePage = new Homepage(Driver); homePage.GoTo(); var mobilePage = homePage.OpenMobilePage(Driver); var shoppingCart = mobilePage.AddXperiaToCart(Driver); shoppingCart.UpdateQuantity("1000"); Assert.IsTrue(shoppingCart.ErrorMessageDisplayed, "Update error"); shoppingCart.EmptyCart(); Assert.IsTrue(Driver.PageSource.Contains("Shopping Cart is Empty")); }
public ActionResult HomePage() { AuthenticationClient authentication = new AuthenticationClient(); var homepage = new Homepage() { notification = authentication.FriendRequest(Convert.ToInt32(Session["UserId"].ToString())).ToList() }; Session["NotificationCount"] = homepage.notification.Count(); Session["Notifications"] = homepage.notification; return(View(homepage)); }
//[TestCategory(Verify user can create new article with valid information)] public void TestCase1() { Article article = new Article(driver); Homepage homepage = new Homepage(driver); title = "Article " + randdatetime + rand.Next(10000); commonaction.ClickElement(homepage.btnArticle); commonaction.ClickElement(article.btnNew); article.EnterArticleInfo(title, "Sample Data-Articles", "Unpublished", articlecontent); commonaction.ClickElement(article.btnSaveandClose); commonaction.CheckMessageDisplayed(messagearticlesaved); article.CheckArticleSaved(title, "Sample Data-Articles", "Unpublished", articlecontent); }
protected void btnView5_Click(object sender, EventArgs e) { MultiView1.ActiveViewIndex = 4; blRotatorAddImageErr.Items.Clear(); blRotatorAddImageErr.Visible = false; plRotatorImgAddSucc.Visible = false; plRotatorAddImage.Visible = true; gvRotatorImgs.DataSource = Methods.GetImages(Server.MapPath("~/Images/Rotator")); gvRotatorImgs.DataBind(); Homepage hp = decerealizer.GetHomepageContent(); txtHomeContent.Text = hp.content.Replace(" ", "").Replace("<br />", Environment.NewLine); }
public void WhenILaunchTrustBankPage(string browserType) { if (pageObjectHomePage == null) { pageObjectHomePage = new Homepage(baseUrl, seleniumPort, browserType); } else { pageObjectHomePage.NavigateHome(); } // Take screenshot upon page launch pageObjectHomePage.TakeScreenShot(testContext, screenShotDir); }
// GET: Homepages/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Homepage homepage = db.homepages.Find(id); if (homepage == null) { return(HttpNotFound()); } return(View(homepage)); }
public void DemoQATest() { Driver.Manage().Window.Maximize(); Driver.Navigate().GoToUrl("https://demoqa.com/automation-practice-form"); // Arrange Homepage homePage = new Homepage(Driver); // Act homePage.FillDemoQAForm(); //Assert Assert.IsTrue(homePage.thanksForm.Displayed); }
public void UntoldPage() { Driver.Manage().Window.Maximize(); Driver.Navigate().GoToUrl("https://untold.com/"); // Arrange Homepage homePage = new Homepage(Driver); // Act homePage.UntoldPage(); // Assert Assert.IsTrue(Driver.FindElement(By.XPath("//*[@id='untold-wrap']/div[3]/div[1]")).Displayed); }
public void WarsawResults() { Homepage home = new Homepage(driver); home.goToHomePage(); home.goToRoles(); RolesAndLocations roles = new RolesAndLocations(driver); roles.SelectPoland(); PolishCareers careers = new PolishCareers(driver); careers.InputCity("Warsaw"); careers.VerifyWarsawResults(); }
public void setup() { //defining driver CommerDriver.driver = new ChromeDriver(); //login object and logging into turnup Loginpage loginpage = new Loginpage(); loginpage.loginsteps(); //homepage object and navigates to TM page Homepage homepage = new Homepage(); homepage.navigatesTM(); }
public ActionResult Register(Homepage emp) { { if (ModelState.IsValid) { DatabaseHandler ItemHandler = new DatabaseHandler(); if (ItemHandler.createdata(emp)) { ViewBag.Message = "Item Added Successfully"; ModelState.Clear(); } } return(View()); } }
public void Submit(MovieEntry entry, int seats) { Reservation res = new Reservation(entry, seats); if (Validate(res, out string msg)) { msg += _dbConn.Save(res); } _form.Display(msg); _form.Close(); Homepage homepage = new Homepage(_token); homepage.Show(); }
public void FindShow() { Driver.Manage().Window.Maximize(); Driver.Navigate().GoToUrl("https://www.teatrulsicaalexandrescu.ro/?lang=en"); // Arrange Homepage homePage = new Homepage(Driver); // Act homePage.TheatreShow(); //Assert ((IJavaScriptExecutor)Driver).ExecuteScript("window.scrollTo(0, 500)"); Assert.IsTrue(homePage.showNameText.Displayed); }
public void SeattleResults() { Homepage home = new Homepage(driver); home.goToHomePage(); home.goToRoles(); RolesAndLocations roles = new RolesAndLocations(driver); roles.SelectUsa(); UsaCareers careers = new UsaCareers(driver); careers.InputCity("Seattle"); careers.InputCategory(); careers.VerifySeattleResults("Strong time management skills"); }
public void Testsetup() { //define driver driver = new ChromeDriver(); //loginpage object Loginpage loginobj = new Loginpage(); loginobj.loginsteps(driver); //homepage object Homepage homeobj = new Homepage(); homeobj.Navigatetocustomerpage(driver); }
public JsonResult Notification() { AuthenticationClient authentication = new AuthenticationClient(); var homepage = new Homepage(); if (Session["UserId"].ToString() != null) { homepage.notification = authentication.FriendRequest(Convert.ToInt32(Session["UserId"].ToString())).ToList(); homepage.UserProfile = authentication.GetUserProfile(Convert.ToInt32(Session["UserId"].ToString())).ToList(); Session["Profile"] = homepage.UserProfile; Session["NotificationCount"] = homepage.notification.Count(); Session["Notifications"] = homepage.notification; } //Response.AddHeader("Refresh", "5"); return(JsonResponse(homepage)); }
public void DemoQAForm() { Driver.Manage().Window.Maximize(); Driver.Navigate().GoToUrl("https://demoqa.com/text-box"); //Arrange Homepage homePage = new Homepage(Driver); //Act homePage.DemoQATextBox(); //Assert var element = Driver.FindElement(By.XPath("//*[@id='name']")); Assert.IsTrue(element.Displayed); }
//[TestCategory(Verify user can unpublish a published article)] public void TestCase4() { Article article = new Article(driver); Homepage homepage = new Homepage(driver); string unpublishmessage = CommonValue.ARTICLE_UNPUBLISH_MESSAGE; title = "Article " + randdatetime + rand.Next(10000); commonaction.ClickElement(homepage.btnArticle); commonaction.ClickElement(article.btnNew); article.EnterArticleInfo(title, "Sample Data-Articles", "Published", articlecontent); commonaction.ClickElement(article.btnSaveandClose); commonaction.CheckOnRecentlyAddedAticle(); commonaction.ClickElement(article.btnUnpublish); commonaction.CheckMessageDisplayed(unpublishmessage); commonaction.CheckStatusArticleIconDisplayed(title, "unpublish"); }
public ActionResult Index() { Homepage homepage = new Homepage(); homepage.OncelikliOteller = _unitOfWork.Oteller.Where(x => x.OtelOncelik).Take(8).Select(s => new OncelikliOteller { Adi = s.OtelAdi, KisaAciklama = s.OtelKisaBilgi.Length >= 100 ? s.OtelKisaBilgi.Substring(0, 99) + ".." : s.OtelKisaBilgi, Konumu = s.Otelil + "," + s.Otelilce + "," + s.OtelBolgesi, KonaklamaTipi = s.KonaklamaTipi, Link = s.OtelLink, Resim = s.OtelAnasayfaResmi }).ToList(); homepage.sliderList = _unitOfWork.AnasayfaSlider.ToList(); return(View(homepage)); }