public void ThenClickingOnReadLessClosesTheExpandedView() { // Get context data for created note String originalText = ScenarioContext.Current.Get <String>("Note Text Create"); int id = ScenarioContext.Current.Get <int>("Created Note ID"); //Click on Read Less link - Close Expanded view caseDetailPage.Notes.ClickReadLessOnNoteById(id); //Verify text wraps again and read more link comes back CaseNoteData note = caseDetailPage.Notes.GetFirstNote(); originalText.Should().StartWith(note.Text.Replace("...", ""), "Note visible text displays wrapped and followed by '...' "); note.ReadMoreLinkText.Should().Be("READ MORE", "Read More Link has the correct text"); note.ReadMoreLinkPresentAndActive.Should().BeTrue("Read More Link is Active for this note"); }
public void ThenISeeTheNewNoteAtTheTopOfNotesHistoricalView() { //Set expected data for the note string noteText = ScenarioContext.Current.Get <string>("Note Text Create"); string user = ConfigurationManager.AppSettings.Get("User"); string date = DateTime.Now.ToString("MM-dd-yyyy"); //Give the notes historical window time to Refresh caseDetailPage.Pause(2); //Get the first note and verify all data is the expected CaseNoteData note = caseDetailPage.Notes.GetFirstNote(); note.Text.Should().Be(noteText, "Created Note appears on top of HIstorical View"); note.CreatedBy.Should().Be(user, "Because Note was created with current user as Created By: " + user); note.CreatedDate.Should().Be(date, "Because Note was created with current date as Created Date: " + date); note.EditedBy.Should().Be(user, "Because Note was created with current user as Edited By: " + user); note.EditedDate.Should().Be(date, "Because Note was created with current date as Edited Date: " + date); }
public void ThenClickingOnReadMoreExpandsTheViewAndReadLessLinkDisplays() { // Get context data for created note String originalText = ScenarioContext.Current.Get <String>("Note Text Create"); int id = ScenarioContext.Current.Get <int>("Created Note ID"); //click on read more caseDetailPage.Notes.ClickReadMoreOnNoteById(id); //verify the text now is complete CaseNoteData expandedNote = caseDetailPage.Notes.GetFirstNote(); expandedNote.Text.Should().Be(originalText, "When clicking on Read More the note displays the whole text"); //Verify Read Less link expandedNote.ReadMoreLinkText.Should().Be("READ LESS", "Read Less Link has the correct text"); expandedNote.ReadMoreLinkPresentAndActive.Should().BeTrue("Read Less Link is Active when Note is expanded"); //caseDetailPage.Pause(10); }
public void ThenISeeTheNoteDisplaysWithAReadMoreLink() { //Get original text for created note String originalText = ScenarioContext.Current.Get <String>("Note Text Create"); //Get the note to verify visible text and read more link caseDetailPage.Notes.Open(); CaseNoteData note = caseDetailPage.Notes.GetFirstNote(); //Note visible text should be part of the original text with "..." at the end //note.Text.Should().NotBe(originalText); originalText.Should().StartWith(note.Text.Replace("...", ""), "Note visible text displays wrapped and followed by '...' "); //Read More Link should be active for this note note.ReadMoreLinkText.Should().Be("READ MORE", "Read More Link has the correct text"); note.ReadMoreLinkPresentAndActive.Should().BeTrue("Read More Link is Active for this note"); try { ScenarioContext.Current.Add("Created Note ID", note.Id); } catch (Exception) { } //do nothing, could be already there }
public void ThenISeeTheNoteDisplaysAtTopOfThListWithTheCorrectEditedTextAndDate() { //Wait 2 seconds for the notes list to refresh before seeking for the note caseDetailPage.Notes.Pause(2); //expected values string editedNoteText = ScenarioContext.Current.Get <string>("Edited Note Text"); string date = DateTime.Now.ToString("MM-dd-yyyy"); //actual values CaseNoteData firstNote = caseDetailPage.Notes.GetFirstNote(); //verify firstNote.Text.Should().Be(editedNoteText, "Edited Note displays at top of the list"); firstNote.EditedDate.Should().Be(date, "Edited Date becomes Today Date"); //restore edited note text string originalNoteText = ScenarioContext.Current.Get <string>("Original Note Text"); caseDetailPage.Notes.EditNoteByText(editedNoteText, originalNoteText); }