//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("******************************"); }
public void WhenIClickOnTheLanguagesTabAndAddInVariousOptions() { //add various language options under Profile tab var addLang = new AddLanguage(driver); addLang.Language(); }
//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); }
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"); } } }
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")); }
public void Test1() { AddLanguage language = new AddLanguage(driver); language.Addlanguage(GenerateRandomString.random()); Thread.Sleep(5000); }
public void WhenClickOnTheEditButtonOfDescription() { AddLanguage language = new AddLanguage(driver); language.Addlanguage(GenerateRandomString.random()); Thread.Sleep(5000); }
public void Addlanguagedetails() { //Calling the Addlanguage Class AddLanguage obj4 = new AddLanguage(); obj4.Addlanguagedetails(); }
public AppDomainObject AddLanguage(AddLanguage command) { ThrowIfNotCreated(); RaiseEvent(SimpleMapper.Map(command, new AppLanguageAdded())); return(this); }
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)); }
public void CanAddLanguage_should_not_throw_exception_if_language_valid() { var command = new AddLanguage { Language = Language.EN }; GuardAppLanguages.CanAdd(languages_0, command); }
protected Task On(AddLanguage command, CommandContext context) { return(handler.UpdateSyncedAsync <AppDomainObject>(context, a => { GuardAppLanguages.CanAdd(a.Snapshot.LanguagesConfig, command); a.AddLanguage(command); })); }
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.")); }
public AppDomainObject AddLanguage(AddLanguage command) { Guard.Valid(command, nameof(command), () => "Cannot add language"); ThrowIfNotCreated(); RaiseEvent(SimpleMapper.Map(command, new AppLanguageAdded())); return(this); }
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(); }
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."); } }); }
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))); } }); }
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"); }
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."); } }); }
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")); } }); }
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")); } }); }
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); } }
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 }) ); }
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); } } }
private void AddLanguage(AddLanguage command) { Raise(command, new AppLanguageAdded()); }
public void AddLanguage(AddLanguage command) { RaiseEvent(SimpleMapper.Map(command, new AppLanguageAdded())); }
protected Task On(AddLanguage command, CommandContext context) { return(handler.UpdateAsync <AppDomainObject>(context, a => a.AddLanguage(command))); }
public void AddLanguage(AddLanguage command) { Raise(command, new AppLanguageAdded()); }
public static AppLanguageDto FromCommand(AddLanguage command) { return(SimpleMapper.Map(command.Language, new AppLanguageDto { Fallback = new List <Language>() })); }
public void CanAddLanguage_should_throw_exception_if_language_is_null() { var command = new AddLanguage(); Assert.Throws <ValidationException>(() => GuardAppLanguages.CanAdd(languages_0, command)); }