public void AllEmpyFieldValidation() { LandingPage.Open(); LandingPage.SignIn(); LoginPage.LogIn("*****@*****.**", "123456789"); QuotePage.Open().ClickOnSelectCarrier(); String messageH = QuotePage.HandingUnit.GetDimensionsHValidationMessage(); String messageL = QuotePage.HandingUnit.GetDimensionsLValidationMessage(); String messageW = QuotePage.HandingUnit.GetDimensionsWValidationMessage(); String messageClass = QuotePage.HandingUnit.Commodity.GetClassValidationMessage(); String totalWeight = QuotePage.HandingUnit.Commodity.GetTotalWeightValidationMessage(); AssertsAccumulator.Accumulate(() => Assert.AreEqual(QuoteConstants.VALIDATION_MESSAGE, messageClass)); AssertsAccumulator.Accumulate(() => Assert.AreEqual(QuoteConstants.VALIDATION_MESSAGE, totalWeight)); AssertsAccumulator.Accumulate(() => Assert.AreEqual(QuoteConstants.VALIDATION_MESSAGE, messageH)); AssertsAccumulator.Accumulate(() => Assert.AreEqual(QuoteConstants.VALIDATION_MESSAGE, messageL)); AssertsAccumulator.Accumulate(() => Assert.AreEqual(QuoteConstants.VALIDATION_MESSAGE, messageW)); AssertsAccumulator.Accumulate(() => Assert.AreEqual(QuoteConstants.ORIGINAL_VALIDATION_MESSAGE, QuotePage.GetOriginValidationMessage())); AssertsAccumulator.Accumulate(() => Assert.AreEqual(QuoteConstants.DESTINATION_VALIDATION_MESSAGE, QuotePage.GetDestinationValidationMessage())); }
public void OneTimeSetUp() { Test = new AssertsAccumulator(); //calc = calc ?? new Calculator(); calc = new Calculator(); ToConsole("-----------------------------"); ToConsole("Started testing new operation"); }
public void PopugSite_RadioGender_Enabled() { driver.Navigate().GoToUrl(testUrl); var assertsAccumulator = new AssertsAccumulator(); assertsAccumulator.Accumulate(() => Assert.IsTrue(driver.FindElement(radioBoyLocator).Enabled, "Радиокнопка мальчика отключена")); assertsAccumulator.Accumulate(() => Assert.IsTrue(driver.FindElement(radioGirlLocator).Enabled, "Радиокнопка девочки отключена")); assertsAccumulator.Release(); }
public void PopugSite_RadioGender_Preselected() { driver.Navigate().GoToUrl(testUrl); SendForm(); var assertsAccumulator = new AssertsAccumulator(); assertsAccumulator.Accumulate(() => Assert.IsTrue(driver.FindElement(radioBoyLocator).Selected, "Мальчик не выбран по умолчанию")); assertsAccumulator.Accumulate(() => Assert.IsTrue(driver.FindElement(resulttextLocator).Text.Contains(boycall), "Предварительное радио не влияет на пол")); assertsAccumulator.Release(); }
public void PopugSite_EmptyFormEmail_Error() { driver.Navigate().GoToUrl(testUrl); driver.FindElement(buttonLocator).Click(); var assertsAccumulator = new AssertsAccumulator(); assertsAccumulator.Accumulate(() => Assert.AreEqual("error", driver.FindElement(emailInputLocator).GetAttribute("class"), "поле не подсвечивается")); assertsAccumulator.Accumulate(() => Assert.IsTrue(driver.FindElement(formError).Displayed, "Текст ошибки не отображается")); assertsAccumulator.Accumulate(() => Assert.AreEqual("Введите email", driver.FindElement(formError).Text, "Неверный текст ошибки")); assertsAccumulator.Release(); }
public void PopugSite_AnotherEmailLink_FreeFormEmail() { driver.Navigate().GoToUrl(testUrl); SendForm(); driver.FindElement(anotherEmailLinkLocator).Click(); var assertsAccumulator = new AssertsAccumulator(); assertsAccumulator.Accumulate(() => Assert.AreEqual(string.Empty, driver.FindElement(emailInputLocator).Text, "строка емейла не отчистилась")); assertsAccumulator.Accumulate(() => Assert.IsEmpty(driver.FindElements(resultblock), "Поле с сообщением осталось")); assertsAccumulator.Accumulate(() => Assert.IsFalse(driver.FindElement(anotherEmailLinkLocator).Displayed, "Не исчезла ссылка")); assertsAccumulator.Release(); }
public void PopugSite_FillFormEmail_Success(string TextMail) { driver.Navigate().GoToUrl(testUrl); driver.FindElement(emailInputLocator).SendKeys(TextMail); driver.FindElement(buttonLocator).Click(); var assertsAccumulator = new AssertsAccumulator(); assertsAccumulator.Accumulate(() => Assert.AreEqual(TextMail, driver.FindElement(emailResultLocator).Text, "Емейлы не совпали")); assertsAccumulator.Accumulate(() => Assert.IsTrue(driver.FindElement(resulttextLocator).Displayed, "Текст результата отображается")); assertsAccumulator.Accumulate(() => Assert.IsTrue(driver.FindElement(anotherEmailLinkLocator).Displayed, "Ссылка для другого емейла не отображается")); assertsAccumulator.Release(); }
public void ThirdPartyOff() { LandingPage.Open(); LandingPage.SignIn(); LoginPage.LogIn("*****@*****.**", "123456789"); QuotePage.Open().CheckOnThirdParty(); AssertsAccumulator.Accumulate(() => Assert.IsTrue(QuotePage.IsAccessSettingDisplayed())); AssertsAccumulator.Accumulate(() => Assert.AreEqual(QuoteConstants.ACCESS_SETTING_MESSAGE, QuotePage.GetMessageFromAccessSettingDisplayed())); }
public void PopugSite_F5afterSubmit_EmptyForm() { driver.Navigate().GoToUrl(testUrl); SendForm(); driver.Navigate().Refresh(); var assertsAccumulator = new AssertsAccumulator(); assertsAccumulator.Accumulate(() => Assert.IsTrue(driver.FindElement(radioBoyLocator).Selected, "Радиокнопка не предвыбрана по умолчанию")); assertsAccumulator.Accumulate(() => Assert.AreEqual(string.Empty, driver.FindElement(emailInputLocator).Text, "строка емейла не отчистилась")); assertsAccumulator.Accumulate(() => Assert.IsEmpty(driver.FindElements(resultblock), "Поле с сообщением осталось")); assertsAccumulator.Accumulate(() => Assert.IsFalse(driver.FindElement(anotherEmailLinkLocator).Displayed, "Не исчезла ссылка")); assertsAccumulator.Release(); }
public void GetBillingAddress(String email, String password) { TokenApi tokenApi = new TokenApi(); String token = tokenApi.GetToken(email, password).Token; tokenApi.SetToken(token); GetCustomerBillingAddressApi getCustomerBillingAddressApi = new GetCustomerBillingAddressApi(); List <Client> client = new ClientRepository().GetClient(); BilingAddressTemp apiResultBillingAddress = getCustomerBillingAddressApi.Request(); Address billingAddressFromBD = _billingAdressService.GetBillingAddress("*****@*****.**"); AssertsAccumulator.Accumulate(() => Assert.AreEqual(billingAddressFromBD.AddressAccessorials, apiResultBillingAddress.BillingAddress.AddressAccessorials, "Assesorials are not equel")); AssertsAccumulator.Accumulate(() => Assert.AreEqual(billingAddressFromBD.AddressId, apiResultBillingAddress.BillingAddress.AddressId, "AddressId are not equel")); AssertsAccumulator.Accumulate(() => Assert.AreEqual(billingAddressFromBD.City, apiResultBillingAddress.BillingAddress.City, "Citys are not equel")); AssertsAccumulator.Accumulate(() => Assert.AreEqual(billingAddressFromBD.CommercialType, apiResultBillingAddress.BillingAddress.CommercialType, "CommercialType are not equel")); AssertsAccumulator.Accumulate(() => Assert.AreEqual(billingAddressFromBD.CompanyName, apiResultBillingAddress.BillingAddress.CompanyName, "CompanyName are not equel")); AssertsAccumulator.Accumulate(() => Assert.AreEqual(billingAddressFromBD.Country, apiResultBillingAddress.BillingAddress.Country, "Country are not equel")); AssertsAccumulator.Accumulate(() => Assert.AreEqual(billingAddressFromBD.DeliveryFromTime, apiResultBillingAddress.BillingAddress.DeliveryFromTime, "DeliveryFromTime are not equel")); AssertsAccumulator.Accumulate(() => Assert.AreEqual(billingAddressFromBD.DeliveryInstructions, apiResultBillingAddress.BillingAddress.DeliveryInstructions, "DeliveryInstructions are not equel")); AssertsAccumulator.Accumulate(() => Assert.AreEqual(billingAddressFromBD.DeliveryToTime, apiResultBillingAddress.BillingAddress.DeliveryToTime, "DeliveryToTime are not equel")); AssertsAccumulator.Accumulate(() => Assert.AreEqual(billingAddressFromBD.IsCanada, apiResultBillingAddress.BillingAddress.IsCanada, "IsCanada are not equel")); AssertsAccumulator.Accumulate(() => Assert.AreEqual(billingAddressFromBD.Lat, apiResultBillingAddress.BillingAddress.Lat, "Lat are not equel")); AssertsAccumulator.Accumulate(() => Assert.AreEqual(billingAddressFromBD.Long, apiResultBillingAddress.BillingAddress.Long, "Long are not equel")); AssertsAccumulator.Accumulate(() => Assert.AreEqual(billingAddressFromBD.PickUpInstructions, apiResultBillingAddress.BillingAddress.PickUpInstructions, "PickUpInstructions are not equel")); AssertsAccumulator.Accumulate(() => Assert.AreEqual(billingAddressFromBD.PostalCode, apiResultBillingAddress.BillingAddress.PostalCode, "PostalCode are not equel")); AssertsAccumulator.Accumulate(() => Assert.AreEqual(billingAddressFromBD.ShippingFromTime, apiResultBillingAddress.BillingAddress.ShippingFromTime, "ShippingFromTime are not equel")); AssertsAccumulator.Accumulate(() => Assert.AreEqual(billingAddressFromBD.ShippingToTime, apiResultBillingAddress.BillingAddress.ShippingToTime, "ShippingToTime are not equel")); AssertsAccumulator.Accumulate(() => Assert.AreEqual(billingAddressFromBD.State, apiResultBillingAddress.BillingAddress.State, "State are not equel")); AssertsAccumulator.Accumulate(() => Assert.AreEqual(billingAddressFromBD.StateCode, apiResultBillingAddress.BillingAddress.StateCode, "StateCode are not equel")); AssertsAccumulator.Accumulate(() => Assert.AreEqual(billingAddressFromBD.StreetLine1, apiResultBillingAddress.BillingAddress.StreetLine1, "StreetLine1 are not equel")); AssertsAccumulator.Accumulate(() => Assert.AreEqual(billingAddressFromBD.StreetLine2, apiResultBillingAddress.BillingAddress.StreetLine2, "StreetLine2 are not equel")); AssertsAccumulator.Accumulate(() => Assert.AreEqual(billingAddressFromBD.ContactPerson.AddressContactId, apiResultBillingAddress.BillingAddress.ContactPerson.AddressContactId, "AddressContactId in Contact are not equel")); AssertsAccumulator.Accumulate(() => Assert.AreEqual(billingAddressFromBD.ContactPerson.Email, apiResultBillingAddress.BillingAddress.ContactPerson.Email, "Email in Contact are not equel")); AssertsAccumulator.Accumulate(() => Assert.AreEqual(billingAddressFromBD.ContactPerson.Ext, apiResultBillingAddress.BillingAddress.ContactPerson.Ext, "Ext in Contact are not equel")); AssertsAccumulator.Accumulate(() => Assert.AreEqual(billingAddressFromBD.ContactPerson.FirstName, apiResultBillingAddress.BillingAddress.ContactPerson.FirstName, "FirstName in Contact are not equel")); AssertsAccumulator.Accumulate(() => Assert.AreEqual(billingAddressFromBD.ContactPerson.isPrimary, apiResultBillingAddress.BillingAddress.ContactPerson.isPrimary, "isPrimary in Contact are not equel")); AssertsAccumulator.Accumulate(() => Assert.AreEqual(billingAddressFromBD.ContactPerson.LastName, apiResultBillingAddress.BillingAddress.ContactPerson.LastName, "LastName in Contact are not equel")); AssertsAccumulator.Accumulate(() => Assert.AreEqual(billingAddressFromBD.ContactPerson.Phone, apiResultBillingAddress.BillingAddress.ContactPerson.Phone, "Phone in Contact are not equel")); AssertsAccumulator.Accumulate(() => Assert.AreEqual(billingAddressFromBD.ContactPerson.Position, apiResultBillingAddress.BillingAddress.ContactPerson.Position, "Position in Contact are not equel")); if (billingAddressFromBD.Location != null && apiResultBillingAddress.BillingAddress.Location != null) { AssertsAccumulator.Accumulate(() => Assert.AreEqual(billingAddressFromBD.Location.AddressId, apiResultBillingAddress.BillingAddress.Location.AddressId, "AddressId in Location are not equel")); AssertsAccumulator.Accumulate(() => Assert.AreEqual(billingAddressFromBD.Location.IsDefault, apiResultBillingAddress.BillingAddress.Location.IsDefault, "IsDefault in Location are not equel")); AssertsAccumulator.Accumulate(() => Assert.AreEqual(billingAddressFromBD.Location.Name, apiResultBillingAddress.BillingAddress.Location.Name, "Position in Location are not equel")); } }
public void GetIsRequiredNmfcCode() { TokenApi tokenApi = new TokenApi(); String token = tokenApi.GetToken("*****@*****.**", "123456789").Token; GetQuoteDataApi getQuoteData = new GetQuoteDataApi(token); Boolean IsNmfcApi = getQuoteData.Request().Quote.isRequiredNmfcCode; Boolean IsNmfDb = _quoteService.GetCustomerInfo("*****@*****.**").IsRequiredNmfcCode; AssertsAccumulator.Accumulate(() => Assert.AreEqual(IsNmfDb, IsNmfcApi)); }
public void GetSpecialInstructionDefaultText() { TokenApi tokenApi = new TokenApi(); String token = tokenApi.GetToken("*****@*****.**", "123456789").Token; GetQuoteDataApi getQuoteData = new GetQuoteDataApi(token); String textApi = getQuoteData.Request().Quote.specialInstructionDefaultText; String textDB = _quoteService.GetCustomerInfo("*****@*****.**").SpecialInstructionDefaultText; AssertsAccumulator.Accumulate(() => Assert.AreEqual(textDB, textApi)); }
public void VltlToggleDisplayed() { LandingPage.Open(); LandingPage.SignIn(); LoginPage.LogIn("*****@*****.**", "123456789"); QuotePage.Open(); AssertsAccumulator.Accumulate(() => Assert.IsFalse(QuotePage.IsLinearFeetPresent(), "Linear Feed displayed")); AssertsAccumulator.Accumulate(() => Assert.IsTrue(QuotePage.IsVltlTogglePresent())); QuotePage.SwitchVLTLToggle(); AssertsAccumulator.Accumulate(() => Assert.IsTrue(QuotePage.IsLinearFeetPresent(), "Linear Feed hidden")); }
public void StringTest() { string strActual = "First test on local machine"; string strBExpected = "First test"; AssertsAccumulator Test2 = new AssertsAccumulator(); Test2.Accumulate(() => CollectionAssert.AreEquivalent(strActual, strBExpected, "Test equal A = b : False")); Assert.IsTrue(string.Equals(strActual, strBExpected, StringComparison.OrdinalIgnoreCase)); Test2.Accumulate(() => CollectionAssert.AreNotEquivalent(strActual, "First test on local machine", "Test equal A = const : True")); }
public void AllIntegerValue() { LandingPage.Open(); LandingPage.SignIn(); LoginPage.LogIn("*****@*****.**", "123456789"); QuotePage.Open(). SetOriginallDropdownAddress("RT Rotisserie, 101 Oak Street, San Francisco, CA 94102, USA"). SetDestinationAutocompleteAddress("Mizyak Test, 1202 Chalet Ln, Do Not Delete – Test Account, Pelham, AL 35124, USA"); QuotePage.HandingUnit.SetType("Tube"). SetCount(QuoteConstants.FOR_INTEGER_FIELDS_STRING). SetL(QuoteConstants.DIMENSIONS_INTEGER_MAX). SetW(QuoteConstants.DIMENSIONS_INTEGER_MAX). SetH(QuoteConstants.DIMENSIONS_INTEGER_MAX). CheckStackable(); QuotePage.HandingUnit.Commodity.SetNMFC(QuoteConstants.FOR_INTEGER_FIELDS_STRING). SetSub(QuoteConstants.FOR_INTEGER_FIELDS_STRING). SetClass(QuoteConstants.CLASS). SetPieces(QuoteConstants.FOR_INTEGER_FIELDS_STRING). SetTotalWeight(QuoteConstants.FOR_INTEGER_FIELDS_STRING). CheckHazMat(); String messageCountValidationMessage = QuotePage.HandingUnit.GetCountValidationMessage(); String messageNmfcValidationMessage = QuotePage.HandingUnit.Commodity.GetNMFCValidationMessage(); String messageSubValidationMessage = QuotePage.HandingUnit.Commodity.GetSUBValidationMessage(); String messagePiecesValidationMessage = QuotePage.HandingUnit.Commodity.GetPiecesValidationMessage(); String messageTotalWeightMessage = QuotePage.HandingUnit.Commodity.GetTotalWeightValidationMessage(); AssertsAccumulator.Accumulate(() => Assert.AreEqual(QuoteConstants.VALIDATION_INTEGER_MESSADE, messageCountValidationMessage, "Validation message on Count field is unexpected")); AssertsAccumulator.Accumulate(() => Assert.AreEqual(QuoteConstants.VALIDATION_NUMERIC_MESSADE, messageNmfcValidationMessage, "Validation message on NMFC field is unexpected")); AssertsAccumulator.Accumulate(() => Assert.AreEqual(QuoteConstants.VALIDATION_NUMERIC_MESSADE, messageSubValidationMessage, "Validation message on SUB field is unexpected")); AssertsAccumulator.Accumulate(() => Assert.AreEqual(QuoteConstants.VALIDATION_INTEGER_MESSADE, messagePiecesValidationMessage, "Validation message on PIECES field is unexpected")); AssertsAccumulator.Accumulate(() => Assert.AreEqual(QuoteConstants.VALIDATION_INTEGER_MESSADE, messageTotalWeightMessage, "Validation message on PIECES field is unexpected")); QuotePage.ClickOnSelectCarrier(); }