Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.openqa.selenium.By;
- import org.openqa.selenium.WebDriver;
- import org.testng.Assert;
- import org.testng.annotations.BeforeTest;
- import org.testng.annotations.Test;
- import org.openqa.selenium.firefox.FirefoxDriver;
- import java.util.concurrent.TimeUnit;
- public class addNewWordToDictionary {
- protected static WebDriver driver;
- @BeforeTest
- public void startChrome() {
- System.setProperty("webdriver.gecko.driver", "/Users/macbook/Downloads/SampleUITests/drivers/geckodriver-18.0-mac");
- driver = new FirefoxDriver();
- driver.manage().window().maximize();
- driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);
- }
- @Test(priority = 1, description = "Successful login into Lingualeo")
- public void SuccessfulLoginToLinguaLeo() {
- driver.get("https://lingualeo.com/ru/login");
- driver.findElement(By.xpath("//*[@id=\"email\"]")).sendKeys("adikalova@gmail.com");
- driver.findElement(By.xpath("//*[@id=\"password\"]")).sendKeys("A771d6552");
- driver.findElement(By.xpath("/html/body/div[1]/div[2]/div/div[1]/div[3]/form/input[4]")).click();
- Assert.assertTrue(driver.getTitle().contains("Мои задания"), "Login is successful!");
- }
- @Test(priority = 2, description = "Add new world to dictionary")
- public void AddNewWordToDictionary() {
- driver.findElement(By.xpath("//*[contains(text(),'Словарь')]")).click();
- driver.findElement(By.xpath("//*[@placeholder='Найти']")).sendKeys("dog");
- driver.findElement(By.xpath("//*[contains(text(),'Добавить')]")).click();
- // driver.findElement(By.xpath("/html/body/div[18]/div[3]/div/div[1]/a[1]")).click();
- }
- // @AfterTest
- //
- //
- // public void closeBrowser() {
- // driver.quit();
- // }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement