public void PurchaseNewDomain(string purchasingDomainFor) { try { PageInitHelper <PageNavigationHelper> .PageInit.NavigationTo(UiConstantHelper.Domains, UiConstantHelper.DomainNameSearch); Assert.IsTrue(PageInitHelper <PageValidationHelper> .PageInit.TitleIsAt(UiConstantHelper.DomainNameSearchPageTitle.Trim()), "The Page Redirect to some other page - " + BrowserInit.Driver.Title + " instead of " + UiConstantHelper.DomainNameSearchPageTitle); var newDomainNames = PageInitHelper <RandomDomainNameGenerator> .PageInit.DomainName(purchasingDomainFor.Trim()); var searchResultDomainsList = PageInitHelper <DomainsPage> .PageInit.AddingDomainNamesToCart(purchasingDomainFor, newDomainNames); if (searchResultDomainsList == null) { return; } ICartValidation cartWidgetValidation = new DomainListCartValidation(); var mergedSearchdDomainAndCartWidgetList = cartWidgetValidation.CartWidgetValidation(searchResultDomainsList); var withoutWhois = string.Empty; string withPremiumDns = string.Empty; if (purchasingDomainFor.Contains("WithoutWhois")) { withoutWhois = "yes"; } if (purchasingDomainFor.Contains("WithPremiumDNS")) { withPremiumDns = "yes"; } IShoppingCartValidation addShoppingCartItems = new AddProductShoppingCartItems(); var mergedScAndCartWidgetList = addShoppingCartItems.AddShoppingCartItemsToDic(mergedSearchdDomainAndCartWidgetList, withoutWhois, withPremiumDns); var mergedOrderNumbertoScWidgetList = PageInitHelper <PurchaseFlow> .PageInit.PurchasingNcProducts(mergedScAndCartWidgetList); var namespaceName = GetType().Namespace; PageInitHelper <TestFinalizerHelper> .PageInit.Testclosure(namespaceName); IDomainListValidation domainListValidation = new ValidateProductsInDomainList(); domainListValidation.DomainListValidation(mergedOrderNumbertoScWidgetList); IOrdersValidation orderHistory = new ValidateDomainOrderInBillingPage(); orderHistory.VerifyPurchasedOrderInBillingHistoryPage(mergedOrderNumbertoScWidgetList); ITransactionValidation transactionHistory = new ValidatingDomainTransationDetails(); transactionHistory.VerifyPurchasedTransactionDetailsInBillingTransactionPage(mergedOrderNumbertoScWidgetList); } catch (Exception ex) { PageInitHelper <LoggerHelper> .PageInit.CaptureException(ex); var exceptionType = ex.GetType().ToString(); var namespaceName = GetType().Namespace; PageInitHelper <TestFinalizerHelper> .PageInit.Testclosure(namespaceName, ex); PageInitHelper <ExceptionType> .PageInit.ThrowException(exceptionType, ex); } }
public void PurchaseNewTopLevelDomain() { try { PageInitHelper <PageNavigationHelper> .PageInit.NavigationTo(UiConstantHelper.Domains, UiConstantHelper.NewTlDs); Assert.IsTrue(PageInitHelper <PageValidationHelper> .PageInit.TitleIsAt(UiConstantHelper.NewTldsPageTitle.Trim()), "The Page Redirect to some other page - " + BrowserInit.Driver.Title + " instead of " + UiConstantHelper.NewTldsPageTitle); var newSld = new List <string> { PageInitHelper <DataHelper> .PageInit.DomainName }; var searchResultDomainsList = PageInitHelper <NewTldsPage> .PageInit.AddingDomainNamesToCart(newSld); ICartValidation cartWidgetValidation = new DomainListCartValidation(); var mergedSearchdDomainAndCartWidgetList = cartWidgetValidation.CartWidgetValidation(searchResultDomainsList); IShoppingCartValidation addShoppingCartItems = new AddProductShoppingCartItems(); var mergedScAndCartWidgetList = addShoppingCartItems.AddShoppingCartItemsToDic(mergedSearchdDomainAndCartWidgetList); var mergedOrderNumbertoScWidgetList = PageInitHelper <PurchaseFlow> .PageInit.PurchasingNcProducts(mergedScAndCartWidgetList); var namespaceName = GetType().Namespace; PageInitHelper <TestFinalizerHelper> .PageInit.Testclosure(namespaceName); IDomainListValidation domainListValidation = new ValidateProductsInDomainList(); domainListValidation.DomainListValidation(mergedOrderNumbertoScWidgetList); IOrdersValidation orderHistory = new ValidateDomainOrderInBillingPage(); orderHistory.VerifyPurchasedOrderInBillingHistoryPage(mergedOrderNumbertoScWidgetList); ITransactionValidation transactionHistory = new ValidatingDomainTransationDetails(); transactionHistory.VerifyPurchasedTransactionDetailsInBillingTransactionPage(mergedOrderNumbertoScWidgetList); } catch (Exception ex) { PageInitHelper <LoggerHelper> .PageInit.CaptureException(ex); var exceptionType = ex.GetType().ToString(); var namespaceName = GetType().Namespace; PageInitHelper <TestFinalizerHelper> .PageInit.Testclosure(namespaceName, ex); PageInitHelper <ExceptionType> .PageInit.ThrowException(exceptionType, ex); } }
public void FreeDnsServiceForDomainName(string purchasingDomainFor) { try { PageInitHelper <PageNavigationHelper> .PageInit.NavigationTo(UiConstantHelper.Domains, UiConstantHelper.FreeDns); Assert.IsTrue(PageInitHelper <PageValidationHelper> .PageInit.TitleIsAt(UiConstantHelper.Freednspagetitle.Trim()), "The Page Redirect to some other page - " + BrowserInit.Driver.Title + " instead of " + UiConstantHelper.Freednspagetitle); var freeDnsDomainNames = PageInitHelper <RandomDomainNameGenerator> .PageInit.DomainName(purchasingDomainFor.Trim()); var searchResultDomainsList = PageInitHelper <FreeDnsPage> .PageInit.AddingfreeDnsDomainNamesToCartAndPurchase(purchasingDomainFor, freeDnsDomainNames); ICartValidation cartWidgetValidation = new DomainListCartValidation(); var mergedSearchdDomainAndCartWidgetList = cartWidgetValidation.CartWidgetValidation(searchResultDomainsList); var namespaceName = GetType().Namespace; PageInitHelper <TestFinalizerHelper> .PageInit.Testclosure(namespaceName); if (purchasingDomainFor == UiConstantHelper.SingleDomain) { PageInitHelper <FreeDnsPage> .PageInit.ManageDomain(mergedSearchdDomainAndCartWidgetList); } else { IDomainListValidation domainListValidation = new ValidateProductsInDomainList(); domainListValidation.DomainListValidation(mergedSearchdDomainAndCartWidgetList); } } catch (Exception ex) { PageInitHelper <LoggerHelper> .PageInit.CaptureException(ex); var exceptionType = ex.GetType().ToString(); var namespaceName = GetType().Namespace; PageInitHelper <TestFinalizerHelper> .PageInit.Testclosure(namespaceName, ex); PageInitHelper <ExceptionType> .PageInit.ThrowException(exceptionType, ex); } }