public static FoldersAndLabelsPage EditFolderFromFoldersList(this FoldersAndLabelsPage foldersAndLabelsPage, string oldFolderName, string oldBaseFolder, string newFolderName, string newBaseFolder = "No parent folder", bool toggleNotification = true) { foldersAndLabelsPage.Logger.Info($"Editing folder: {oldFolderName}"); foldersAndLabelsPage.Logger.Info($"Renaming folder: {oldFolderName} to be: {newFolderName}"); foldersAndLabelsPage.Logger.Info($"Moving folder from : {oldBaseFolder} to be under: {newBaseFolder}"); foldersAndLabelsPage.Logger.Info($"Toggling notification"); foldersAndLabelsPage.FolderComponent.EditFolder(oldFolderName, oldBaseFolder, newFolderName, newBaseFolder, toggleNotification); return(foldersAndLabelsPage); }
public static FoldersAndLabelsPage VerifylabelIsAdded(this FoldersAndLabelsPage foldersAndLabelsPage, string labelName, string labelColor) { foldersAndLabelsPage.Logger.Info($"Verifying label: {labelName} is added with color: {labelColor}"); labelColor = Helpers.GetRGBFromColorCode(labelColor); bool isLabelAdded = foldersAndLabelsPage.LabelComponent.IsLabelAddedWithColor(labelName, labelColor); Assert.IsTrue(isLabelAdded, $"The following label is not added to the list of labels: {labelName}"); return(foldersAndLabelsPage); }
public void BeforeTest() { Login(); mainInboxPage = new MainInboxPage(Driver); mainInboxPage.CloseWelcomeModal(); foldersAndLabelsPage = new FoldersAndLabelsPage(Driver); createNewFolderModalPage = new CreateNewFolderModalPage(Driver); mainInboxPage.ClickFoldersLabelsSettings(); foldersAndLabelsPage.ClickAddNewFolder(); createNewFolderModalPage.EnterFoldersName(TestData.Data.FoldersName); createNewFolderModalPage.SubmitFolderCreation(); }
public void BeforeTests() { _loginPage = new LoginPage(Driver); _welcomeModalPage = new WelcomeModalPage(Driver); _leftMenuPage = new LeftMenuPage(Driver); _foldersAndLabelsPage = new FoldersAndLabelsPage(Driver); _loginPage.NavigateToProtonMailAndLogin(); _welcomeModalPage.CloseWelcomeModal(); _leftMenuPage.NavigateToFoldersAndLabels(); _foldersAndLabelsPage.DeleteAllLabels(); }
public static FoldersAndLabelsPage VerifyOldLabelDoesNotExist(this FoldersAndLabelsPage foldersAndLabelsPage, string labelName, string labelColor) { foldersAndLabelsPage.Logger.Info($"Verifying label: {labelName} is not present under the label's list"); labelColor = Helpers.GetRGBFromColorCode(labelColor); bool isLabelAdded = foldersAndLabelsPage.LabelComponent.IsLabelAddedWithColor(labelName, labelColor); Assert.False(isLabelAdded, $"The following label still exists to the list of labels: {labelName}"); return(foldersAndLabelsPage); }
public static FoldersAndLabelsPage VerifyUserIsSignedIn(this SignInPage signInPage) { FoldersAndLabelsPage FoldersAndLabelsPage = new FoldersAndLabelsPage(signInPage.Driver); string ExpectedPageUrl = FoldersAndLabelsPage.PageUrl; signInPage.Logger.Info($"Verifying that user is logged in and successfully navigated to: {ExpectedPageUrl}"); signInPage.Driver.WaitUntil(Driver => Driver.Url.Equals(ExpectedPageUrl)); Assert.AreEqual(ExpectedPageUrl, signInPage.Driver.Url, $"The actual page url is not {ExpectedPageUrl}"); return(FoldersAndLabelsPage); }
public static void CleanUpByDeletingAddedFoldersAndLabels(this FoldersAndLabelsPage foldersAndLabelsPage) { List <string> folderNames = TestExecutionContext.CurrentContext.CurrentTest.Properties.GetValue <List <string> >(FoldersAndLabelsConstants.ADDED_FOLDERS_LIST) ?? new List <string>(); List <string> labelNames = TestExecutionContext.CurrentContext.CurrentTest.Properties.GetValue <List <string> >(FoldersAndLabelsConstants.ADDED_LABELS_LIST) ?? new List <string>(); folderNames = folderNames.Where(x => !x.Contains("/")).ToList(); foreach (string folderName in folderNames) { foldersAndLabelsPage.DeleteFolderFromFoldersList(folderName); } foldersAndLabelsPage.VerifyThereAreNoFoldersAvailable(); foreach (string label in labelNames) { foldersAndLabelsPage.DeleteLabelFromLabelsList(label); } foldersAndLabelsPage.VerifyThereAreNoLabelsAvailable(); }
public static void WhenProtonMailPageIsOpenedLabelEditingIsEnabled(this FoldersAndLabelsPage foldersAndLabelsPage) { string labelName = RandomDataGenerator.RandomAlphaNumericString(10); string labelColor = RandomDataGenerator.RandomItemFromList(FoldersAndLabelsConstants.COLOR_CHOISES.Split('|').ToList()); string newLabelName = RandomDataGenerator.RandomAlphaNumericString(10); string newLabelColor = RandomDataGenerator.RandomItemFromList(FoldersAndLabelsConstants.COLOR_CHOISES.Split('|').ToList()); List <string> labelNames = new List <string>() { newLabelName }; TestExecutionContext.CurrentContext.CurrentTest.Properties.Set(FoldersAndLabelsConstants.ADDED_LABELS_LIST, labelNames); //Adding label and verifying the same one can be edited foldersAndLabelsPage .AddNewLabel(labelName, labelColor) .VerifyEntityCreatedNotificationIsDisplayed(labelName) .VerifylabelIsAdded(labelName, labelColor) .EditExistingLabel(labelName, newLabelName, newLabelColor) .VerifyEntityUpdatedNotificationIsDisplayed(newLabelName) .VerifylabelIsAdded(newLabelName, newLabelColor) .VerifyOldLabelDoesNotExist(labelName, labelColor); }
public static void WhenProtomMailPageIsOpenedNestingOfFoldersIsEnabledAndMaximumFolderLimitCanNotBeExceeded(this FoldersAndLabelsPage foldersAndLabelsPage) { string baseFolderName = RandomDataGenerator.RandomAlphaNumericString(10); List <string> folderNames = new List <string>() { baseFolderName }; //Adding base folder foldersAndLabelsPage.AddBaseFolder(baseFolderName) .VerifyFolderIsAdded(baseFolderName); int numberOfFolders = FoldersAndLabelsConstants.MAX_NUMBER_OF_FOLDERS - 1; //Adding all nested folders while (numberOfFolders != 0) { string currentBaseFolderFullPath = folderNames[folderNames.Count - 1]; string[] AllBaseFolders = currentBaseFolderFullPath.Split('/'); string baseChildFolderName = AllBaseFolders[AllBaseFolders.Length - 1]; string childFolder = RandomDataGenerator.RandomAlphaNumericString(10); foldersAndLabelsPage.AddFolderUnderBaseFolder(childFolder, baseChildFolderName) .VerifyFolderIsAdded(childFolder, baseChildFolderName); folderNames.Add($"{currentBaseFolderFullPath}/{childFolder}"); numberOfFolders--; } TestExecutionContext.CurrentContext.CurrentTest.Properties.Set(FoldersAndLabelsConstants.ADDED_FOLDERS_LIST, folderNames); //Adding an extra folder, to verify the folder limit is reached baseFolderName = RandomDataGenerator.RandomAlphaNumericString(10); foldersAndLabelsPage.AddBaseFolder(baseFolderName) .VerifyModalIsNotClosedAfterSave() .ClickCancelOnTheFoldersModal() .VerifyFolderLimitReachedNotificationIsDisplayed() .VerifyFolderIsNotAdded(baseFolderName);; }
public static void WhenProtonMailPageIsOpenedFolderNotificationsCanBeDisabled(this FoldersAndLabelsPage foldersAndLabelsPage) { string baseFolderName = RandomDataGenerator.RandomAlphaNumericString(10); List <string> folderNames = new List <string>() { baseFolderName }; TestExecutionContext.CurrentContext.CurrentTest.Properties.Set(FoldersAndLabelsConstants.ADDED_FOLDERS_LIST, folderNames); //Adding base folder and updating the folder notification from the folder row foldersAndLabelsPage.AddBaseFolder(baseFolderName) .VerifyEntityCreatedNotificationIsDisplayed(baseFolderName) .VerifyFolderIsAdded(baseFolderName) .ToggleNotificationFromFoldersList(baseFolderName) .VerifyEntityUpdatedNotificationIsDisplayed(baseFolderName); }
public static void WhenProtonMailPageIsOpenedLabelWithSameNameAsExistingCanNotBeAdded(this FoldersAndLabelsPage foldersAndLabelsPage) { string labelName = RandomDataGenerator.RandomAlphaNumericString(10); string labelColor = RandomDataGenerator.RandomItemFromList(FoldersAndLabelsConstants.COLOR_CHOISES.Split('|').ToList()); string secondLabelColor = RandomDataGenerator.RandomItemFromList(FoldersAndLabelsConstants.COLOR_CHOISES.Split('|').ToList()); List <string> labelNames = new List <string>() { labelName }; TestExecutionContext.CurrentContext.CurrentTest.Properties.Set(FoldersAndLabelsConstants.ADDED_LABELS_LIST, labelNames); //Adding two labels with the same name and verifying the second can not be added foldersAndLabelsPage .AddNewLabel(labelName, labelColor) .VerifyEntityCreatedNotificationIsDisplayed(labelName) .VerifylabelIsAdded(labelName, labelColor) .AddNewLabel(labelName, secondLabelColor) .VerifyLabelModalIsNotClosedAfterSave() .VerifyALabelOrFolderWithThisNameAlreadyExistsNotificationIsDisplayed() .ClickCancelOnTheLabelsModal(); }
public static FoldersAndLabelsPage AddFolderUnderBaseFolder(this FoldersAndLabelsPage foldersAndLabelsPage, string folderName, string baseFolderName) { foldersAndLabelsPage.AddNewFolder(folderName, baseFolderName); return(foldersAndLabelsPage); }
public static void WhenProtonMailPageIsOpenedLabelWithNameSameAsExistingFolderCanNotBeAdded(this FoldersAndLabelsPage foldersAndLabelsPage) { string baseFolderName = RandomDataGenerator.RandomAlphaNumericString(10); List <string> folderNames = new List <string>() { baseFolderName }; TestExecutionContext.CurrentContext.CurrentTest.Properties.Set(FoldersAndLabelsConstants.ADDED_FOLDERS_LIST, folderNames); //Adding base folder and adding a new label with the same name as the folder foldersAndLabelsPage.AddBaseFolder(baseFolderName) .VerifyFolderIsAdded(baseFolderName) .VerifyEntityCreatedNotificationIsDisplayed(baseFolderName) .AddNewLabel(baseFolderName) .VerifyLabelModalIsNotClosedAfterSave() .VerifyALabelOrFolderWithThisNameAlreadyExistsNotificationIsDisplayed() .ClickCancelOnTheLabelsModal(); }
public void WhenProtonMailPageIsOpenedFolderNotificationsCanBeDisabled() { FoldersAndLabelsPage.WhenProtonMailPageIsOpenedFolderNotificationsCanBeDisabled(); }
public static void WhenProtonMailPageIsOpenedAndFolderWithSameNameAsExistingFolderOnTheSameLevelFolderCanNotBeAdded(this FoldersAndLabelsPage foldersAndLabelsPage) { string baseFolderName = RandomDataGenerator.RandomAlphaNumericString(10); List <string> folderNames = new List <string>() { baseFolderName }; //Adding two folders with the same name under same level and verifying that the second one can not be added to the folders list foldersAndLabelsPage.AddBaseFolder(baseFolderName) .VerifyEntityCreatedNotificationIsDisplayed(baseFolderName) .VerifyFolderIsAdded(baseFolderName) .AddNewFolder(baseFolderName) .VerifyModalIsNotClosedAfterSave() .ClickCancelOnTheFoldersModal(); TestExecutionContext.CurrentContext.CurrentTest.Properties.Set(FoldersAndLabelsConstants.ADDED_FOLDERS_LIST, folderNames); }
public static FoldersAndLabelsPage VerifyFolderLimitReachedNotificationIsDisplayed(this FoldersAndLabelsPage foldersAndLabelsPage) { foldersAndLabelsPage.Logger.Info($"Verifying notification: {FoldersAndLabelsConstants.FOLDER_LIMIT_REACHED} is displayed on the UI"); string actualNotificationText = foldersAndLabelsPage.NotificationComponent.GetNotificationText(); Assert.AreEqual(FoldersAndLabelsConstants.FOLDER_LIMIT_REACHED, actualNotificationText, $"No {FoldersAndLabelsConstants.FOLDER_LIMIT_REACHED} notification displayed"); return(foldersAndLabelsPage); }
public void WhenProtomMailPageIsOpenedNestingOfFoldersIsEnabledAndMaximumFolderLimitCanNotBeExceeded() { FoldersAndLabelsPage.WhenProtomMailPageIsOpenedNestingOfFoldersIsEnabledAndMaximumFolderLimitCanNotBeExceeded(); }
public static FoldersAndLabelsPage VerifyALabelOrFolderWithThisNameAlreadyExistsNotificationIsDisplayed(this FoldersAndLabelsPage foldersAndLabelsPage) { foldersAndLabelsPage.Logger.Info($"Verifying notification: {FoldersAndLabelsConstants.A_LABEL_OR_FOLDER_WITH_THIS_NAME_ALREADY_EXISTS} is displayed on the UI"); string actualNotificationText = foldersAndLabelsPage.NotificationComponent.GetNotificationText(); Assert.AreEqual(FoldersAndLabelsConstants.A_LABEL_OR_FOLDER_WITH_THIS_NAME_ALREADY_EXISTS, actualNotificationText, $"No {FoldersAndLabelsConstants.A_LABEL_OR_FOLDER_WITH_THIS_NAME_ALREADY_EXISTS} notification displayed"); return(foldersAndLabelsPage); }
public static FoldersAndLabelsPage VerifyEntityUpdatedNotificationIsDisplayed(this FoldersAndLabelsPage foldersAndLabelsPage, string entityName) { string expectedNotificationText = $"{entityName} {FoldersAndLabelsConstants.UPDATED}"; foldersAndLabelsPage.Logger.Info($"Verifying notification: {expectedNotificationText} is displayed on the UI"); string actualNotificationText = foldersAndLabelsPage.NotificationComponent.GetNotificationText(); Assert.AreEqual(expectedNotificationText, actualNotificationText, $"No updated notification is displayed."); return(foldersAndLabelsPage); }
public void WhenProtonMailPageIsOpenedAndFolderWithSameNameAsExistingFolderOnTheSameLevelFolderCanNotBeAdded() { FoldersAndLabelsPage.WhenProtonMailPageIsOpenedAndFolderWithSameNameAsExistingFolderOnTheSameLevelFolderCanNotBeAdded(); }
public void WhenProtonMailPageIsOpenedLabelWithSameNameAsExistingCanNotBeAdded() { FoldersAndLabelsPage.WhenProtonMailPageIsOpenedLabelWithSameNameAsExistingCanNotBeAdded(); }
public static void WhenProtonMailPageIsOpenedAndFolderWithSameNameAsExistingCanBeAddedOnADifferentLevel(this FoldersAndLabelsPage foldersAndLabelsPage) { string baseFolderName = RandomDataGenerator.RandomAlphaNumericString(10); List <string> folderNames = new List <string>() { baseFolderName }; TestExecutionContext.CurrentContext.CurrentTest.Properties.Set(FoldersAndLabelsConstants.ADDED_FOLDERS_LIST, folderNames); //Adding two folders with the same name, just a different location, and verifying that this action can be perfomed foldersAndLabelsPage.AddBaseFolder(baseFolderName) .VerifyEntityCreatedNotificationIsDisplayed(baseFolderName) .VerifyFolderIsAdded(baseFolderName) .AddNewFolder(baseFolderName, baseFolderName) .VerifyEntityCreatedNotificationIsDisplayed(baseFolderName); }
public void WhenProtonMailPageIsOpenedAndFolderWithSameNameAsExistingCanBeAddedOnADifferentLevel() { FoldersAndLabelsPage.WhenProtonMailPageIsOpenedAndFolderWithSameNameAsExistingCanBeAddedOnADifferentLevel(); }
public void WhenProtonMailPageIsOpenedLabelEditingIsEnabled() { FoldersAndLabelsPage.WhenProtonMailPageIsOpenedLabelEditingIsEnabled(); }