public void Test_2() { DateTime Today = DateTime.Today; driver.Navigate().GoToUrl("https://uk.wikipedia.org"); Thread.Sleep(2000); Test_2_info pageHome = new Test_2_info(); PageFactory.InitElements(driver, pageHome); string WikiYear = pageHome.WikiYear.Text; string WikiDayMonth = pageHome.WikiDayMonth.Text; string WikiDate = WikiDayMonth + " " + WikiYear; string RealDate = DateTime.Now.ToString("d MMMM yyyy", CultureInfo.GetCultureInfo("uk-UA")); Assert.AreEqual(RealDate, WikiDate); Thread.Sleep(2000); File.WriteAllText(igWorkDir + "TestsReports/Test2.txt", "Тест_2 пройден. \r\nВремя: " + CurentMoment); }
public void Test_2() {//correct file object creation in cloud check Test_2_info pageHome = new Test_2_info(); PageFactory.InitElements(driver, pageHome); Test_1(); pageHome.MenuUploadButton.Click(); Thread.Sleep(2000); pageHome.ObjectNameField.Clear(); pageHome.ObjectNameField.SendKeys("Test " + CurentMoment.ToShortDateString()); Thread.Sleep(2000); string CodeOfCreatedFile = pageHome.ObjectNumber.Text; pageHome.LogoIcon.Click(); Thread.Sleep(2000); pageHome.MenuGetObjectButton.Click(); Thread.Sleep(2000); pageHome.GetingObjectNumberField.Clear(); pageHome.GetingObjectNumberField.SendKeys(CodeOfCreatedFile); Thread.Sleep(2000); Assert.AreEqual(pageHome.OpenedObjectName.Text, "Test " + CurentMoment.ToShortDateString()); }