Пример #1
0
        internal void DeleteLanguage()
        {
            // Populate data saved in Excel
            GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "Profile");

            // Refresh the page
            GlobalDefinitions.driver.Navigate().Refresh();

            //Delete Language

            try
            {
                //Click on language
                GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "XPath", "//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[1]/a[1]", 10000);
                LangBtn.Click();

                //Click on language to delete
                GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "XPath", "//div[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[2]/div/div[2]/div/table/tbody[last()]/tr/td[1]", 10000);
                LangToSel.Click();

                //Click on delete language
                GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "XPath", "//div[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[2]/div/div[2]/div/table/tbody[last()]/tr/td[3]/span[2]/i", 20000);
                DeleteLangBtn.Click();
                Base.test.Log(LogStatus.Pass, "Language deleted successfully");
            }
            catch (Exception ex)
            {
                Assert.Fail("Test failed to delete Language", ex.Message);
                Base.test.Log(LogStatus.Fail, "Language is not deleted successfully");
            }
        }
Пример #2
0
        internal void EditLanguage()
        {
            // Populate data saved in Excel
            GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "Profile");

            // Refresh the page
            GlobalDefinitions.driver.Navigate().Refresh();
            //Click on language
            GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "XPath", "//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[1]/a[1]", 10000);
            LangBtn.Click();

            //Click on language to edit
            GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "XPath", "//div[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[2]/div/div[2]/div/table/tbody[last()]/tr/td[1]", 10000);
            LangToSel.Click();

            //Click on edit language button
            GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "XPath", "//div[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[2]/div/div[2]/div/table/tbody[last()]/tr/td[3]/span[1]/i", 10000);
            EditLangBtn.Click();

            //Update the language
            //Update language level
            GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "Name", "level", 10000);
            ChooseLevel.Click();

            new SelectElement(ChooseLevel).SelectByText(GlobalDefinitions.ExcelLib.ReadData(3, "LanguageLevel"));

            //Click on update
            GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "XPath", "//div[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/form/div[2]/div/div[2]/div/table/tbody/tr/td/div/span/input[1]", 10000);
            UpdateLangBtn.Click();
            Base.test.Log(LogStatus.Info, "Language edited successfully");
        }