public void TestCleanup() { HomePageHelper.WaitWhileHomePageIsLoaded(); AuthorizationHelper.Logout(); HomePageHelper.WaitWhileHomePageIsLoaded(); CreateScreenshotsIfTestFail(TestContext); }
public void TestInitialize() { BrowserStateManager.RefreshState(); HomePageHelper.OpenPage(); WelcomeScreenHelper.CloseWelcomePopup(); SearchHelper.InitSearchWindow(); }
public void NoticeLink() { const string title = "Notices – ChronoZoom Project"; HomePageHelper.OpenNoticeLink(); Assert.AreEqual(title, HomePageHelper.GetNewTabTitle(title)); }
public void HelpLink() { const string title = "User Guide – ChronoZoom Project"; HomePageHelper.OpenHelpLink(); Assert.AreEqual(title, HomePageHelper.GetNewTabTitle(title)); }
public ActionResult EditMain() { CommonDataService cds = new CommonDataService(); CommonModel cm = new CommonModel(); cm = cds.GenerateCommonModel(); Session["FaceBook"] = cm.FaceBook; Session["Twitter"] = cm.Twitter; Session["Youtube"] = cm.Youtube; Session["Instagram"] = cm.Instagram; Session["PhoneNumber"] = cm.PhoneNumber; Session["Email"] = cm.Email; Session["ShoppingHours"] = cm.ShoppingHours; HomePageHelper homeHelp = new HomePageHelper(); MainViewModel mvm = new MainViewModel(); try { mvm = homeHelp.GenerateMainViewModel(); return(View(mvm)); } catch (Exception ex) { throw ex; } finally { homeHelp = null; mvm = null; } }
public void DevelopersLink() { const string title = "Develop – ChronoZoom Project"; HomePageHelper.OpenDevelopersLink(); Assert.AreEqual(title, HomePageHelper.GetNewTabTitle(title)); }
public void TestInitialize() { BrowserStateManager.RefreshState(); HomePageHelper.OpenPage(); WelcomeScreenHelper.CloseWelcomePopup(); AuthorizationHelper.OpenLoginPage(); }
public void Test_Navigate_To_Life() { HomePageHelper.OpenLifeTimeline(); string actual = HomePageHelper.GetLastBreadcrumbs(); Assert.AreEqual("Life", actual); }
public void TestInitialize() { BrowserStateManager.RefreshState(); HomePageHelper.OpenSandboxPage(); //HomePageHelper.DeleteAllElementsLocally(); TourHelper.DeleteToursIfExist("webdriverTour"); #region create timeline _newTimeline = new Timeline { FromYear = -6061670000, ToYear = -5808809999, Title = "WebDriverApiTitle" }; Guid newTimelineId = ApiHelper.CreateTimelineByApi(_newTimeline); _newTimeline.Id = newTimelineId; #endregion #region create exhibit var contentItems = new Collection <ContentItem>(); var contentItem = new ContentItem() { Title = "WebDriverApi", MediaType = "image", Uri = @"http://yandex.st/www/1.609/yaru/i/logo.png", Caption = "", Order = 0, Attribution = "", MediaSource = "" }; contentItems.Add(contentItem); _newExhibit = new Exhibit() { Timeline_ID = newTimelineId, Title = "WebDriverApiExhibit", Year = -8596430000, ContentItems = contentItems }; _newExhibit.Id = new Guid(ApiHelper.CreateExhibitByApi(_newExhibit).ExhibitId); #endregion #region init new tour _newTour = new Tour(); _newTour.Name = "webdriverTour"; _newTour.Description = "webdriver description"; Bookmark exhibitBookmark = new Bookmark { Name = "WebDriverApiExhibitBookmark", Id = _newExhibit.Id, Type = "exhibit" }; Bookmark timelineBookmark = new Bookmark { Name = "WebDriverApiTimelineBookmark", Id = _newTimeline.Id, Type = "timeline" }; Collection <Chronozoom.Entities.Bookmark> bookmarks = new Collection <Chronozoom.Entities.Bookmark> { exhibitBookmark, timelineBookmark }; _newTour.Bookmarks = bookmarks; #endregion HomePageHelper.OpenSandboxPage(); }
public void FeedbackLink() { const string title = "Forum: Discuss - ChronoZoom Project"; HomePageHelper.OpenFeedbackLink(); Assert.AreEqual(title, HomePageHelper.GetNewTabTitle(title)); }
public void TestCleanup() { CreateScreenshotsIfTestFail(TestContext); if (TestContext.CurrentTestOutcome != UnitTestOutcome.Passed && TestContext.CurrentTestOutcome != UnitTestOutcome.Inconclusive) { HomePageHelper.OpenPage(); } }
public static void ClassInitialize(TestContext testContext) { BrowserStateManager.RefreshState(); HomePageHelper.OpenSandboxPage(); HomePageHelper.DeleteAllElementsLocally(); ExhibitHelper.AddExhibitWithContentItem(Exhibit); _newExhibit = ExhibitHelper.GetNewExhibit(); }
public void TestInitialize() { BrowserStateManager.RefreshState(); HomePageHelper.OpenPage(); AuthorizationHelper.OpenLoginPage(); AuthorizationHelper.AuthenticateAsExistedGoogleUser(); HomePageHelper.DeleteAllElementsLocally(); }
public async Task <ActionResult> Index() { int blogsTake = GetSettingValueInt("HomePageMainBlogsContents_ItemsNumber", StoreConstants.DefaultPageSize); int newsTake = GetSettingValueInt("HomePageMainNewsContents_ItemsNumber", StoreConstants.DefaultPageSize); int productsTake = GetSettingValueInt("HomePageMainProductsContents_ItemsNumber", StoreConstants.DefaultPageSize); int sliderTake = GetSettingValueInt("HomePageSliderImages_ItemsNumber", StoreConstants.DefaultPageSize); int? categoryId = null; String key = String.Format("Home:Index-{0}-{1}-{2}-{3}-{4}", StoreId, blogsTake, newsTake, productsTake, sliderTake); var pageDesignTask = PageDesignService.GetPageDesignByName(StoreId, "HomePageWithMainData"); var blogsTask = ContentService.GetMainPageContentsAsync(StoreId, categoryId, StoreConstants.BlogsType, blogsTake); var newsTask = ContentService.GetMainPageContentsAsync(StoreId, categoryId, StoreConstants.NewsType, newsTake); var productsTask = ProductService.GetMainPageProductsAsync(StoreId, productsTake); var sliderTask = FileManagerService.GetStoreCarouselsAsync(StoreId, sliderTake); var categoriesTask = CategoryService.GetCategoriesByStoreIdAsync(StoreId, "", true); var productCategoriesTask = ProductCategoryService.GetProductCategoriesByStoreIdAsync(StoreId, StoreConstants.ProductType, true); // Create new stopwatch. Stopwatch stopwatch = new Stopwatch(); // Begin timing. stopwatch.Start(); await Task.WhenAll(productsTask, blogsTask, newsTask, pageDesignTask, sliderTask, categoriesTask, productCategoriesTask); var settings = GetStoreSettings(); HomePageHelper.StoreId = this.StoreId; HomePageHelper.StoreSettings = settings; var products = productsTask.Result; var blogs = blogsTask.Result; var news = newsTask.Result; var pageDesing = pageDesignTask.Result; var sliderImages = sliderTask.Result; var categories = categoriesTask.Result; var productCategories = productCategoriesTask.Result; StoreLiquidResult liquidResult = HomePageHelper.GetHomePageDesign(pageDesing, sliderImages, products, blogs, news, categories, productCategories); liquidResult.PageTitle = GetSettingValue("HomePage_Title", ""); liquidResult.StoreSettings = settings; liquidResult.MyStore = this.MyStore; // Stop timing. stopwatch.Stop(); Logger.Info("Home:Index:Time elapsed: {0} elapsed milliseconds", stopwatch.ElapsedMilliseconds); return(View(liquidResult)); }
public void Humanity_TimeLine_Contains_Data() { HomePageHelper.OpenHumanityTimeline(); List <string> labels = TimescaleHelper.GetLabels(); CollectionAssert.Contains(labels, Label2000Bce, Label2000Bce + " is not presented"); CollectionAssert.Contains(labels, Label2000Ce, Label2000Ce + " is not presented"); CollectionAssert.DoesNotContain(labels, Label2001Bce, Label2001Bce + " is presented"); }
public void Transition_BCE_to_CE_should_contain_1BCE_and_1CE_ticks() { Logger.Log("Bug: @https://github.com/alterm4nn/ChronoZoom/issues/87", LogType.Debug); HomePageHelper.OpenBceCeArea(); List <string> labels = TimescaleHelper.GetLabels(); CollectionAssert.Contains(labels, Label1Bce, Label1Bce + " is not presented"); CollectionAssert.Contains(labels, Label1Ce, Label1Ce + " is not presented"); }
public void Life_TimeLine_Contains_Data() { HomePageHelper.OpenCosmosTimeline(); HomePageHelper.OpenLifeTimeline(); List <string> labels = TimescaleHelper.GetLabels(); CollectionAssert.Contains(labels, Label3500Ma, Label3500Ma + " is not presented"); CollectionAssert.Contains(labels, Label500Ma, Label500Ma + "is not presented"); }
public void Roman_History_TimeLine_Borders() { HomePageHelper.OpenHumanityTimeline(); HomePageHelper.OpenRomanHistoryTimeline(); const double expected = 942; double leftBorder = TimescaleHelper.GetLeftBorderDate(); double rightBorder = TimescaleHelper.GetRightBorderDate(); Assert.AreEqual(expected, rightBorder - leftBorder); }
public void TestInitialize() { BrowserStateManager.RefreshState(); HomePageHelper.OpenPage(); if (AuthorizationHelper.IsUserNamePresented()) { AuthorizationHelper.OpenLoginPage(); AuthorizationHelper.AuthenticateAsMicrosoftUser(); } }
public async Task <ActionResult> Index3() { int?categoryId = null; String ConnectionString = "Stores"; var rep = new ProductRepository(new StoreContext(ConnectionString)); var rep2 = new ContentRepository(new StoreContext(ConnectionString)); var rep3 = new PageDesignRepository(new StoreContext(ConnectionString)); var rep4 = new ProductCategoryRepository(new StoreContext(ConnectionString)); var rep5 = new CategoryRepository(new StoreContext(ConnectionString)); var rep6 = new FileManagerRepository(new StoreContext(ConnectionString)); var productsTask = rep.GetProductsByBrandAsync(StoreId, 5, 100, null); var pageDesignTask = rep3.GetPageDesignByName(StoreId, "HomePage"); var blogsTask = rep2.GetMainPageContentsAsync(StoreId, categoryId, StoreConstants.BlogsType, 5); var newsTask = rep2.GetMainPageContentsAsync(StoreId, categoryId, StoreConstants.NewsType, 5); var productCategoriesTask = rep4.GetProductCategoriesByStoreIdAsync(StoreId, StoreConstants.ProductType, true); var categoriesTask = rep5.GetCategoriesByStoreIdAsync(StoreId, StoreConstants.NewsType, true); var sliderTask = rep6.GetStoreCarouselsAsync(StoreId, 58); //IProductService rep = ProductService; //IContentService rep2 = ContentService; //IPageDesignService rep3 = PageDesignService; //IProductCategoryService rep4 = ProductCategoryService; //ICategoryService rep5 = CategoryService; //IFileManagerService rep6 = FileManagerService; await Task.WhenAll(productsTask, blogsTask, newsTask, pageDesignTask, sliderTask, categoriesTask, productCategoriesTask); HomePageHelper.StoreId = this.StoreId; HomePageHelper.StoreSettings = GetStoreSettings(); var products = productsTask.Result; var blogs = blogsTask.Result; var news = newsTask.Result; var pageDesing = pageDesignTask.Result; var sliderImages = sliderTask.Result; var categories = categoriesTask.Result; var productCategories = productCategoriesTask.Result; StoreLiquidResult liquidResult = HomePageHelper.GetHomePageDesign(pageDesing, sliderImages, products, blogs, news, categories, productCategories); liquidResult.MyStore = this.MyStore; return(View(liquidResult)); }
public static void ClassInitialize(TestContext testContext) { BrowserStateManager.RefreshState(); HomePageHelper.OpenSandboxPage(); _timeline = new Timeline { Title = "WebdriverTitle" }; HomePageHelper.DeleteAllElementsLocally(); TimelineHelper.AddTimeline(_timeline); _newTimeline = TimelineHelper.GetLastTimeline(); }
public static void ClassInitialize(TestContext testContext) { BrowserStateManager.RefreshState(); HomePageHelper.OpenSandboxPage(); _timeline = new Timeline { Title = RandomString.GetRandomString(1, 200, isUsingSpecChars: true) }; HomePageHelper.DeleteAllElementsLocally(); TimelineHelper.AddTimeline(_timeline); _newTimeline = TimelineHelper.GetLastTimeline(); }
public void Roman_History_TimeLine_Borders_Ages() { HomePageHelper.OpenHumanityTimeline(); HomePageHelper.OpenRomanHistoryTimeline(); const string leftBorderAge = "BCE"; const string righBorderAge = "CE"; string leftBorder = TimescaleHelper.GetLeftBorderDateAge(); string rightBorder = TimescaleHelper.GetRightBorderDateAge(); Assert.AreEqual(leftBorderAge, leftBorder); Assert.AreEqual(righBorderAge, rightBorder); }
public void AddTimelinesToFavorites() { HomePageHelper.OpenPage(); AuthorizationHelper.OpenLoginPage(); AuthorizationHelper.AuthenticateAsExistedGoogleUser(); Collection <Timeline> timelines = ApiHelper.GetCurrentUserTimelines(); NavigationHelper.OpenHomePage(); ApiHelper.SetUserTimelinesAsNotFavorite(timelines); Guid[] selectedAsFavoriteTimelineGuids = ApiHelper.SelectAllTimelinesAsFavorites(timelines); Guid[] currentUserFavoriteTimelineGuids = ApiHelper.GetFavoriteTimelines(); Assert.IsTrue(selectedAsFavoriteTimelineGuids.OrderBy(a => a).SequenceEqual(currentUserFavoriteTimelineGuids.OrderBy(a => a))); }
public void Mouse_Marker() { HomePageHelper.OpenHumanityTimeline(); string mouseMarkerText = TimescaleHelper.GetMouseMarkerText(); HomePageHelper.MoveMouseToCenter(); string mouseMarkerCenterText = TimescaleHelper.GetMouseMarkerText(); Assert.AreNotEqual(mouseMarkerText, mouseMarkerCenterText); HomePageHelper.MoveMouseToLeft(); mouseMarkerText = TimescaleHelper.GetMouseMarkerText(); Assert.AreNotEqual(mouseMarkerText, mouseMarkerCenterText); }
public void TestInitialize() { BrowserStateManager.RefreshState(); HomePageHelper.OpenPage(); AuthorizationHelper.OpenLoginPage(); AuthorizationHelper.AuthenticateAsMicrosoftUser(); //authenticate as existing cz user HomePageHelper.DeleteAllElementsLocally(); var exhibit = new Exhibit { Title = "WebdriverExhibitWithContent" }; ExhibitHelper.AddExhibitWithoutFormClosing(exhibit); ExhibitHelper.ClickByAddArtifact(); }
public PageNavigation() { homePage = new HomePage(); if (DriverManager.Mode == DeviceMode.Desktop) { homePageHelper = new HomePageHelper(this); } else if (DriverManager.Mode == DeviceMode.Mobile) { homePageHelper = new HomePageMobileHelper(this); } else { homePageHelper = new HomePageTabletHelper(this); } }
public void exhibit_should_display_correct_date_december_in_bce() { var contentItemPdf = new ContentItem { Title = RandomString.GetRandomString(1, 200), Caption = RandomString.GetRandomString(1, 200), MediaSource = RandomUrl.GetRandomWebUrl(), MediaType = "image", Attribution = RandomString.GetRandomString(1, 200), Uri = RandomUrl.GetRandomImageUrl(), Order = 0 }; const decimal year = -2015; _newExhibit = new Exhibit { Title = RandomString.GetRandomString(1, 200), ContentItems = new Collection <ContentItem> { contentItemPdf }, Month = "December", Day = "31", Year = ExhibitHelper.GetCoordinateFromYmd(year, 12, 31), Timeline_ID = new Guid("bdc1ceff-76f8-4df4-ba72-96b353991314") }; ApiHelper.CreateExhibitByApi(_newExhibit); HomePageHelper.OpenSandboxPage(); ExhibitHelper.NavigateToExhibit(_newExhibit); string displayDate = ExhibitHelper.GetExhibitDisplayDate(_newExhibit); StringAssert.Contains(displayDate, "BCE"); StringAssert.Contains(displayDate, year.ToString(CultureInfo.InvariantCulture)); StringAssert.Contains(displayDate, _newExhibit.Day); if (GitHubIssueWatcher.IssueStatus.IsIssueResolved("1024")) { StringAssert.Contains(displayDate, DateTime.ParseExact(_newExhibit.Month, "MMMM", CultureInfo.InvariantCulture).Month.ToString(CultureInfo.InvariantCulture)); } }
public ActionResult Index() { CommonDataService cds = new CommonDataService(); CommonModel cm = new CommonModel(); cm = cds.GenerateCommonModel(); Session["FaceBook"] = cm.FaceBook; Session["Twitter"] = cm.Twitter; Session["Youtube"] = cm.Youtube; Session["Instagram"] = cm.Instagram; Session["PhoneNumber"] = cm.PhoneNumber; Session["Email"] = cm.Email; Session["ShoppingHours"] = cm.ShoppingHours; CarouselsHelper carHelp = new CarouselsHelper(); HomePageHelper homeHelp = new HomePageHelper(); HomeViewModels hvm = new HomeViewModels(); try { hvm.CarouselsViewModels = carHelp.GenerateCarousels(); hvm.MainViewModels = homeHelp.GenerateMainViewModel(); hvm.FeatureMainModel = homeHelp.GenerateFeatureMainModel(); return(View(hvm)); } catch (Exception ex) { throw ex; } finally { carHelp = null; homeHelp = null; hvm = null; } }
public void TestInitialize() { BrowserStateManager.RefreshState(); #region create exhibit var contentItems = new Collection <ContentItem>(); var contentItem = new ContentItem { Title = "WebDriverApi", MediaType = "image", Uri = @"http://yandex.st/www/1.609/yaru/i/logo.png", Caption = "", Order = 0, Attribution = "AttributionApI", MediaSource = "https://trello.com/board/development/510a91105420848638003cda" }; contentItems.Add(contentItem); _newExhibit = new Exhibit { Timeline_ID = new Guid("bdc1ceff-76f8-4df4-ba72-96b353991314"), Title = "WebDriverApiExhibitAlexey", Year = -8596430000, ContentItems = contentItems }; _newExhibit.Id = new Guid(ApiHelper.CreateExhibitByApi(_newExhibit).ExhibitId); #endregion HomePageHelper.OpenSandboxPage(); }