Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions src/test/java/runner/ClaimPageTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package runner;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.testng.Assert;
import org.testng.annotations.*;

import java.time.Duration;

public class ClaimPageTest {
private WebDriver driver;
private WebDriverWait wait;

@BeforeClass
public void setUp() {
driver = new ChromeDriver();
driver.manage().window().maximize();
driver.get("https://opensource-demo.orangehrmlive.com/");
wait = new WebDriverWait(driver, Duration.ofSeconds(10));
}

@Test
public void LoginInAccount() {

WebElement usernameField = wait.until(ExpectedConditions.presenceOfElementLocated(
By.name("username")));
usernameField.sendKeys("Admin");
WebElement passwordField = wait.until(ExpectedConditions.presenceOfElementLocated(
By.name("password")));
passwordField.sendKeys("admin123");

WebElement loginButton = wait.until(ExpectedConditions.elementToBeClickable(
By.xpath("//button[@type='submit']")));
loginButton.click();

WebElement profilePicture = wait.until(ExpectedConditions.presenceOfElementLocated(
By.xpath("//img[@alt='profile picture']")));
Assert.assertTrue(profilePicture.isDisplayed(), "Profile picture is not displayed!");
}

@AfterMethod
public void tearDown() {
if (driver != null) {
driver.quit();
}
}
}
2 changes: 0 additions & 2 deletions src/test/java/runner/DashboardPageTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@ public class DashboardPageTest {

@BeforeClass
public void setUp() {
// Инициализация драйвера
driver = new ChromeDriver();
driver.manage().window().maximize();
driver.get("https://opensource-demo.orangehrmlive.com/");
// Инициализация WebDriverWait
wait = new WebDriverWait(driver, Duration.ofSeconds(10));
}

Expand Down
Loading