コード例 #1
0
        //Add new Lanuguage
        internal void Addlanguage()
        {
            Console.WriteLine("******************************");

            //implicit wait
            ExtentionHelpers.TurnOnWait(driver);

            //click on add new button
            AddNewLanguage.Click();

            ExtentionHelpers.TurnOnWait(driver);
            //enter text in language field
            LanguageText.SendKeys(ExcelLibHelper.ReadData(3, "Language"));

            //select level from drop down

            new SelectElement(driver.FindElement(By.XPath("//select[@class='ui dropdown']"))).SelectByValue(ExcelLibHelper.ReadData(2, "LanguageLevel"));

            ExtentionHelpers.TurnOnWait(driver);

            //click on add button
            AddLanguage.Click();

            ExtentionHelpers.TurnOnWait(driver);

            Console.WriteLine("Language added");
            Console.WriteLine("******************************");
        }
コード例 #2
0
        public void WhenIClickOnTheLanguagesTabAndAddInVariousOptions()
        {
            //add various language options under Profile tab
            var addLang = new AddLanguage(driver);

            addLang.Language();
        }
コード例 #3
0
        //Add new Lanuguage
        internal void Addlanguage()
        {
            //explicit wait
            GlobalDefinitions.WaitForClickableElement(driver, By.XPath("//a[text()='Languages']"), 30);

            //firstly click on language button
            LanguageButton.Click();

            //implicit wait
            GlobalDefinitions.wait(30);

            //click on add new button
            AddNewLanguage.Click();


            GlobalDefinitions.wait(30);
            //enter text in language field
            LanguageText.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Language"));

            //select level from drop down

            new SelectElement(driver.FindElement(By.XPath("//select[@class='ui dropdown']"))).SelectByValue(GlobalDefinitions.ExcelLib.ReadData(2, "LanguageLevel"));

            GlobalDefinitions.wait(30);

            //click on add button
            AddLanguage.Click();

            GlobalDefinitions.wait(30);
        }
コード例 #4
0
        internal void UpdateLanguage()
        {
            //Get the Langugae value needs to be updated
            String expectedValue = ExcelLib.ReadData(2, "Language");

            //Get the rows count in language table
            IList <IWebElement> Tablerows = Driver.FindElements(By.XPath("//h3[contains(text(),'Languages')]/../..//table/tbody/tr"));
            var rowCount = Tablerows.Count;

            //Get the actual Language value and compare with language needs to be updated, if matches update the record
            for (int i = 1; i <= rowCount; i++)
            {
                String actualValue = Driver.FindElement(By.XPath("//h3[contains(text(),'Languages')]/../..//table/tbody[" + i + "]/tr/td[1]")).Text;
                if (expectedValue == actualValue)
                {
                    //Click on Edit icon
                    Driver.FindElement(By.XPath("//h3[contains(text(),'Languages')]/../..//table/tbody[" + i + "]/tr/td[3]/span[1]/i")).Click();

                    //Clear the existing value and add new value
                    Extension.WaitForElementDisplayed(Driver, By.XPath("//input[@placeholder='Add Language']"), 2);
                    AddLanguage.Clear();
                    AddLanguage.SendKeys(ExcelLib.ReadData(2, "UpdateLanguage"));
                    SelectDropDown(ChooseLanguageLevel, "SelectByText", ExcelLib.ReadData(2, "UpdateLevel"));

                    //Click update button
                    UpdateLanguageButton.Click();

                    Base.Image = SaveScreenShotClass.SaveScreenshot(Driver, "Report");

                    //Validate message
                    Extension.MessageValidation(ExcelLib.ReadData(2, "UpdateLanguage") + " has been updated to your languages");
                }
            }
        }
コード例 #5
0
        public void CanAddLanguage_should_throw_exception_if_language_is_null()
        {
            var command = new AddLanguage();

            ValidationAssert.Throws(() => GuardAppLanguages.CanAdd(languages_0, command),
                                    new ValidationError("Language code is required.", "Language"));
        }
コード例 #6
0
        public void Test1()
        {
            AddLanguage language = new AddLanguage(driver);

            language.Addlanguage(GenerateRandomString.random());
            Thread.Sleep(5000);
        }
コード例 #7
0
        public void WhenClickOnTheEditButtonOfDescription()
        {
            AddLanguage language = new AddLanguage(driver);

            language.Addlanguage(GenerateRandomString.random());
            Thread.Sleep(5000);
        }
コード例 #8
0
        public void Addlanguagedetails()
        {
            //Calling the Addlanguage Class
            AddLanguage obj4 = new AddLanguage();

            obj4.Addlanguagedetails();
        }
コード例 #9
0
        public AppDomainObject AddLanguage(AddLanguage command)
        {
            ThrowIfNotCreated();

            RaiseEvent(SimpleMapper.Map(command, new AppLanguageAdded()));

            return(this);
        }
コード例 #10
0
        public void CanAddLanguage_should_throw_exception_if_language_already_added()
        {
            var command = new AddLanguage {
                Language = Language.DE
            };

            Assert.Throws <ValidationException>(() => GuardAppLanguages.CanAdd(languages_0, command));
        }
コード例 #11
0
        public void CanAddLanguage_should_not_throw_exception_if_language_valid()
        {
            var command = new AddLanguage {
                Language = Language.EN
            };

            GuardAppLanguages.CanAdd(languages_0, command);
        }
コード例 #12
0
        protected Task On(AddLanguage command, CommandContext context)
        {
            return(handler.UpdateSyncedAsync <AppDomainObject>(context, a =>
            {
                GuardAppLanguages.CanAdd(a.Snapshot.LanguagesConfig, command);

                a.AddLanguage(command);
            }));
        }
コード例 #13
0
        public void CanAddLanguage_should_throw_exception_if_language_already_added()
        {
            var command = new AddLanguage {
                Language = Language.DE
            };

            ValidationAssert.Throws(() => GuardAppLanguages.CanAdd(languages_0, command),
                                    new ValidationError("Language has already been added."));
        }
コード例 #14
0
        public AppDomainObject AddLanguage(AddLanguage command)
        {
            Guard.Valid(command, nameof(command), () => "Cannot add language");

            ThrowIfNotCreated();

            RaiseEvent(SimpleMapper.Map(command, new AppLanguageAdded()));

            return(this);
        }
コード例 #15
0
        internal void New_Language()
        {
            Commondriver.Excellib.PopulateInCollection(Base.Excelpath, "Language");
            Langtab.Click();
            Addnewbutton.Click();
            AddLanguage.SendKeys(Commondriver.Excellib.ReadData(2, "Language"));
            SelectElement Levelsel = new SelectElement(AddLevel);

            Levelsel.SelectByText(Commondriver.Excellib.ReadData(2, "Level"));
            Addbutton.Click();
        }
コード例 #16
0
        public static void CanAdd(LanguagesConfig languages, AddLanguage command)
        {
            Guard.NotNull(command, nameof(command));

            Validate.It(() => "Cannot add language.", e =>
            {
                if (command.Language == null)
                {
                    e("Language code is required.", nameof(command.Language));
                }
                else if (languages.Contains(command.Language))
                {
                    e("Language has already been added.");
                }
            });
        }
コード例 #17
0
        public static void CanAdd(LanguagesConfig languages, AddLanguage command)
        {
            Guard.NotNull(command, nameof(command));

            Validate.It(() => "Cannot add language.", error =>
            {
                if (command.Language == null)
                {
                    error(new ValidationError("Language cannot be null.", nameof(command.Language)));
                }
                else if (languages.Contains(command.Language))
                {
                    error(new ValidationError("Language already added.", nameof(command.Language)));
                }
            });
        }
コード例 #18
0
        internal void AddNewLanguage()
        {
            //Click Add New button
            AddNewLanguageButton.Click();

            //Enter the language and level
            Extension.WaitForElementDisplayed(Driver, By.XPath("//input[@placeholder='Add Language']"), 2);
            AddLanguage.SendKeys(ExcelLib.ReadData(2, "Language"));
            SelectDropDown(ChooseLanguageLevel, "SelectByText", ExcelLib.ReadData(2, "Level"));

            //Click Add button
            AddLanguageButton.Click();

            Base.Image = SaveScreenShotClass.SaveScreenshot(Driver, "Report");

            //Validate message
            Extension.MessageValidation(ExcelLib.ReadData(2, "Language") + " has been added to your languages");
        }
コード例 #19
0
        public static void CanAdd(LanguagesConfig languages, AddLanguage command)
        {
            Guard.NotNull(command);

            Validate.It(() => "Cannot add language.", e =>
            {
                var language = command.Language;

                if (language == null)
                {
                    e(Not.Defined("Language code"), nameof(command.Language));
                }
                else if (languages.Contains(language))
                {
                    e("Language has already been added.");
                }
            });
        }
コード例 #20
0
        public static void CanAdd(LanguagesConfig languages, AddLanguage command)
        {
            Guard.NotNull(command, nameof(command));

            Validate.It(e =>
            {
                var language = command.Language;

                if (language == null)
                {
                    e(Not.Defined(nameof(command.Language)), nameof(command.Language));
                }
                else if (languages.Contains(language))
                {
                    e(T.Get("apps.languages.languageAlreadyAdded"));
                }
            });
        }
コード例 #21
0
        public static void CanAdd(AddLanguage command, IAppEntity app)
        {
            Guard.NotNull(command);

            Validate.It(e =>
            {
                var languages = app.Languages;
                var language  = command.Language;

                if (language == null)
                {
                    e(Not.Defined(nameof(command.Language)), nameof(command.Language));
                }
                else if (app.Languages.Contains(command.Language))
                {
                    e(T.Get("apps.languages.languageAlreadyAdded"));
                }
            });
        }
コード例 #22
0
        public void EditAvailability()
        {
            test = extent.CreateTest("Add Share Skill");
            test.Log(Status.Info, "Starting the Add Skill Test");
            AddLanguage ProfilePage = new AddLanguage();

            ProfilePage.EditAvailability();
            bool actual = manageListing.Verify();

            if (actual)
            {
                test.Log(Status.Pass, "Add Skill Successfull");
                Assert.IsTrue(actual);
            }
            else
            {
                test.Log(Status.Fail, "Add Skill Failed");
                Assert.IsTrue(actual);
            }
        }
コード例 #23
0
        public async Task AddLanguage_should_create_events_and_update_state()
        {
            var command = new AddLanguage {
                Language = Language.DE
            };

            await ExecuteCreateAsync();

            var result = await sut.ExecuteAsync(CreateCommand(command));

            result.ShouldBeEquivalent(sut.Snapshot);

            Assert.True(sut.Snapshot.LanguagesConfig.Contains(Language.DE));

            LastEvents
            .ShouldHaveSameEvents(
                CreateEvent(new AppLanguageAdded {
                Language = Language.DE
            })
                );
        }
コード例 #24
0
        static void ChangeActiveLanguage(Language language)
        {
            activeLanguage.Language = language;

            var appSetting = new AppSetting
            {
                Name  = "Current Language",
                Value = language.Id.ToString()
            };

            appSetting.Update();

            var translationForm = new TranslationForm();
            var addLanguage     = new AddLanguage();

            foreach (Form form in Application.OpenForms)
            {
                if (dictionaries.ParentForms.ContainsKey(form.UniqueID()))
                {
                    Translate(form);
                }
            }
        }
コード例 #25
0
 private void AddLanguage(AddLanguage command)
 {
     Raise(command, new AppLanguageAdded());
 }
コード例 #26
0
 public void AddLanguage(AddLanguage command)
 {
     RaiseEvent(SimpleMapper.Map(command, new AppLanguageAdded()));
 }
コード例 #27
0
 protected Task On(AddLanguage command, CommandContext context)
 {
     return(handler.UpdateAsync <AppDomainObject>(context, a => a.AddLanguage(command)));
 }
コード例 #28
0
 public void AddLanguage(AddLanguage command)
 {
     Raise(command, new AppLanguageAdded());
 }
コード例 #29
0
ファイル: AppLanguageDto.cs プロジェクト: zxbe/squidex
 public static AppLanguageDto FromCommand(AddLanguage command)
 {
     return(SimpleMapper.Map(command.Language, new AppLanguageDto {
         Fallback = new List <Language>()
     }));
 }
コード例 #30
0
        public void CanAddLanguage_should_throw_exception_if_language_is_null()
        {
            var command = new AddLanguage();

            Assert.Throws <ValidationException>(() => GuardAppLanguages.CanAdd(languages_0, command));
        }