public void AddMessageToDrafts(string browserName) { IWebDriver driver = InitDriver(browserName); SetUpAuth(driver); GmailInboxPage gmailInbox = new GmailInboxPage(driver); gmailInbox.ClickComposeButton(); gmailInbox.InputMessageSubject(ConfigurationManager.AppSettings["TextSample"]); Assert.True(gmailInbox.IsSavedLabelDisplayed(driver), "Saved Lable is not presented"); gmailInbox.GoToDrafts(); GmailDraftsPage gmailDrafts = new GmailDraftsPage(driver); Assert.True(gmailDrafts.IsDraftPageOpened(driver), "Draft Page is not opened"); Assert.True(gmailDrafts.IsDraftAdded(ConfigurationManager.AppSettings["TextSample"]), "No message with this subject in drafts"); QuitDriver(driver); }
public void DeleteMessageFromDrafts(string browserName) { IWebDriver driver = InitDriver(browserName); SetUpAuth(driver); int draftNumber = 3; GmailInboxPage gmailInbox = new GmailInboxPage(driver); gmailInbox.GoToDrafts(); GmailDraftsPage gmailDrafts = new GmailDraftsPage(driver); Assert.True(gmailDrafts.IsDraftPageOpened(driver), "Draft Page is not opened"); gmailDrafts.ChooseDraft(draftNumber); int countOfDraftsAtStart = gmailDrafts.GetCountOfDrafts(); gmailDrafts.ClickDiscardDraftsButton(); Assert.AreEqual(countOfDraftsAtStart - 1, gmailDrafts.GetCountOfDrafts(), "Count of drafts at start and afted discarding doesn't match"); QuitDriver(driver); }