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 AddTimeline(Timeline timeline) { Logger.Log("<- timeline: " + timeline); InitTimelineCreationMode(); DrawTimeline(); SetTimelineName(timeline.Title); CreateTimeline(); WaitAjaxComplete(60); Logger.Log("->"); }
public Timeline GetLastTimeline() { Logger.Log("<-"); var timeline = new Timeline(); const string script = Javascripts.LastCanvasElement; timeline.Title = GetJavaScriptExecutionResult(script + ".title"); timeline.TimelineId = GetJavaScriptExecutionResult(script + ".id"); Logger.Log("-> " + timeline); return timeline; }
public void DeleteTimeline(Timeline timeline) { Logger.Log("<- timeline: " + timeline); NavigateToTimeLine(timeline); WaitAnimation(); InitEditForm(); ClickDelete(); ConfirmDeletion(); Logger.Log("->"); }
public static void ClassInitialize(TestContext testContext) { BrowserStateManager.RefreshState(); HomePageHelper.OpenSandboxPage(); _timeline = new Timeline { Title = "WebdriverTitle" }; HomePageHelper.DeleteAllElementsLocally(); TimelineHelper.AddTimeline(_timeline); _newTimeline = TimelineHelper.GetLastTimeline(); }
public void DeleteTimelineByApi(Timeline timeline) { timeline.Timeline_ID = new Guid(CosmosGuidTemplate); DataContractJsonSerializer timelineSerializer = new DataContractJsonSerializer(typeof(Timeline)); HttpWebRequest request = MakeDeleteRequest(TimelineApiServiceUrl); Stream requestStream = request.GetRequestStream(); timelineSerializer.WriteObject(requestStream, timeline); request.GetResponse(); }
public void TestInitialize() { BrowserStateManager.RefreshState(); HomePageHelper.OpenSandboxPage(); 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 bool IsTimelineFound(Timeline newTimeline) { Logger.Log("<- timeline: " + newTimeline); try { ExecuteJavaScript(string.Format("CZ.Search.goToSearchResult('{0}', 'timeline')", newTimeline.TimelineId)); Logger.Log("-> true"); return true; } catch (Exception) { Logger.Log("-> false"); return false; } }
public Guid CreateTimelineByApi(Timeline timeline) { timeline.Timeline_ID = new Guid(CosmosGuidTemplate); DataContractJsonSerializer timelineSerializer = new DataContractJsonSerializer(typeof(Timeline)); DataContractJsonSerializer guidSerializer = new DataContractJsonSerializer(typeof(Guid)); HttpWebRequest request = MakePutRequest(TimelineApiServiceUrl); Stream requestStream = request.GetRequestStream(); timelineSerializer.WriteObject(requestStream, timeline); WebResponse response = request.GetResponse(); Stream responseStream = response.GetResponseStream(); if (responseStream == null) { throw new NullReferenceException("responseStream is null"); } Guid timelineId = (Guid)guidSerializer.ReadObject(responseStream); return timelineId; }
public Guid CreateTimelineByApi(Timeline timeline) { timeline.Timeline_ID = new Guid(CosmosGuidTemplate); DataContractJsonSerializer timelineSerializer = new DataContractJsonSerializer(typeof(Timeline)); DataContractJsonSerializer guidSerializer = new DataContractJsonSerializer(typeof(Guid)); HttpWebRequest request = MakePutRequest(TimelineApiServiceUrl); Stream requestStream = request.GetRequestStream(); timelineSerializer.WriteObject(requestStream, timeline); WebResponse response = request.GetResponse(); Stream responseStream = response.GetResponseStream(); if (responseStream == null) { throw new NullReferenceException("responseStream is null"); } Guid timelineId = (Guid)guidSerializer.ReadObject(responseStream); return(timelineId); }
public void timeline_should_be_created_in_date_mode() { Logger.Log("Bug: https://github.com/alterm4nn/ChronoZoom/issues/528", LogType.Debug); _timeline = new Timeline { Title = "WebdriverTitleDayMode" }; TimelineHelper.AddTimelineWithDayMode(_timeline); _newTimeline = TimelineHelper.GetLastTimeline(); Assert.AreEqual(_timeline.Title, _newTimeline.Title); }
public void DeleteTimelineByJavaScript(Timeline timeline) { Logger.Log("<-"); ExecuteJavaScript(string.Format("CZ.Authoring.removeTimeline({0})", Javascripts.LastCanvasElement)); Logger.Log("->"); }
private void NavigateToTimeLine(Timeline timeline) { Logger.Log("<-"); ExecuteJavaScript(string.Format("CZ.Search.goToSearchResult('{0}')", timeline.TimelineId)); Logger.Log("->"); }