public void Settings_100_12_4() { HomePage.SelectLeftMenuItem(driver, LocatorType.XPath, "//div[@id='zone-top']/div/div/div", LocatorType.Id, "settings"); driver.FindElement(By.CssSelector("span.option.off")); if (driver.FindElement(By.CssSelector("span.option.off")).GetAttribute("class").Contains("selected")) { driver.FindElement(By.CssSelector("span.option.on")).Click(); driver.FindElement(By.CssSelector("div.confirm-button.button > div.content")).Click(); driver.FindElement(By.CssSelector("div.confirm-button.button > div.content")).Click(); ControlAccessMethods.LogOut(driver); Thread.Sleep(3000); ControlAccessMethods.LogIn(driver, "470000001", "12345678"); HomePage.SelectLeftMenuItem(driver, LocatorType.XPath, "//div[@id='zone-top']/div/div/div", LocatorType.Id, "settings"); Assert.AreEqual(true, driver.FindElement(By.CssSelector("span.option.on")).GetAttribute("class").Contains("selected")); } else { driver.FindElement(By.CssSelector("span.option.off")).Click(); ControlAccessMethods.LogOut(driver); Thread.Sleep(3000); ControlAccessMethods.LogIn(driver, "470000001", "12345678"); HomePage.SelectLeftMenuItem(driver, LocatorType.XPath, "//div[@id='zone-top']/div/div/div", LocatorType.Id, "settings"); Assert.AreEqual(true, driver.FindElement(By.CssSelector("span.option.off")).GetAttribute("class").Contains("selected")); } }
public void ParentalControl_100_13_5() { driver.FindElement(By.XPath("//div[@id='zone-top']/div/div/div")).Click(); Thread.Sleep(3000); driver.FindElement(By.Id("settings")).Click(); Thread.Sleep(3000); IWebElement dropdown = driver.FindElement(By.CssSelector("select.switcher")); ReadOnlyCollection <IWebElement> options = dropdown.FindElements(By.TagName("Option")); string originalrating = dropdown.GetAttribute("value").Split('@')[0]; int changedrating = int.Parse(dropdown.GetAttribute("value").Split('@')[0]) + 1; SelectElement setrating = new SelectElement(dropdown); setrating.SelectByText(changedrating.ToString()); driver.FindElement(By.CssSelector("div.form-row > input.textbox")).SendKeys("xxxx"); driver.FindElement(By.CssSelector("div.button.confirm-button > div.content")).Click(); Thread.Sleep(2000); Assert.AreEqual(true, driver.FindElement(By.CssSelector("div.loading-error-message > div.error-message")).Text.Contains("Invalid pin")); driver.FindElement(By.ClassName("close-button")); Thread.Sleep(6000); ControlAccessMethods.LogOut(driver); ControlAccessMethods.LogIn(driver, "nortest1", "nortest1"); Thread.Sleep(6000); driver.FindElement(By.XPath("//div[@id='zone-top']/div/div/div")).Click(); Thread.Sleep(3000); driver.FindElement(By.Id("settings")).Click(); Thread.Sleep(3000); dropdown = driver.FindElement(By.CssSelector("select.switcher")); Assert.AreEqual(originalrating, dropdown.GetAttribute("value").Split('@')[0]); }
public void ParentalControl_100_13_4() { driver.FindElement(By.XPath("//div[@id='zone-top']/div/div/div")).Click(); Thread.Sleep(3000); driver.FindElement(By.Id("tvod")).Click(); Thread.Sleep(3000); ReadOnlyCollection <IWebElement> elements = driver.FindElements(By.ClassName("gallery-content")); //loop thorugh the items to find a purchasable item Thread.Sleep(3000); int agerating = 0; int ratedmovieindex = 0; for (int i = 0; i < driver.FindElements(By.ClassName("gallery-content")).Count; i++) { driver.FindElements(By.ClassName("gallery-content"))[i].Click(); try { if (int.Parse(driver.FindElement(By.CssSelector("div.parental-rating > div.value")).Text) < 14) { ratedmovieindex = i; agerating = int.Parse(driver.FindElement(By.CssSelector("div.parental-rating > div.value")).Text); driver.Navigate().Back(); break; } } catch (Exception e) { } driver.Navigate().Back(); } driver.FindElement(By.XPath("//div[@id='zone-top']/div/div/div")).Click(); Thread.Sleep(3000); driver.FindElement(By.Id("settings")).Click(); Thread.Sleep(3000); ControlAccessMethods.SelectDropDown(driver, LocatorType.CssSelector, "select.switcher", agerating.ToString()); // SelectElement setrating = new SelectElement(dropdown); //setrating.SelectByText(changedrating.ToString()); driver.FindElement(By.CssSelector("div.form-row > input.textbox")).SendKeys("1234"); Thread.Sleep(2000); driver.FindElement(By.CssSelector("div.button.confirm-button > div.content")).Click(); Thread.Sleep(9000); ControlAccessMethods.LogOut(driver); ControlAccessMethods.LogIn(driver, "470000005", "12345678"); Thread.Sleep(6000); driver.FindElement(By.XPath("//div[@id='zone-top']/div/div/div")).Click(); Thread.Sleep(3000); driver.FindElement(By.Id("tvod")).Click(); Thread.Sleep(3000); string moviename = driver.FindElements(By.ClassName("gallery-content"))[ratedmovieindex].Text.Split('\r')[0]; driver.FindElements(By.ClassName("gallery-content"))[ratedmovieindex].Click(); Thread.Sleep(6000); Assert.AreEqual(true, driver.FindElement(By.CssSelector("div.title")).Text.Contains(moviename)); }