Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
        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);
        }