diff --git a/README.md b/README.md index 74aff3f..4c98b6b 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ -Изменён pom файл для поддержки cucumber, добавлен cucumberScenario.feature, класс BusinessTripSteps +Итоговое задание для магазина "Регард" с использованием Cucumber. + +![img_2.png](img_2.png) + +![img_3.png](img_3.png) -![img_1.png](img_1.png) diff --git a/img_2.png b/img_2.png new file mode 100644 index 0000000..5278aaf Binary files /dev/null and b/img_2.png differ diff --git a/img_3.png b/img_3.png new file mode 100644 index 0000000..3d1e540 Binary files /dev/null and b/img_3.png differ diff --git a/src/test/java/ru/ibs/framework/CucumberRunner.java b/src/test/java/ru/ibs/framework/CucumberRunner.java deleted file mode 100644 index e6f3a90..0000000 --- a/src/test/java/ru/ibs/framework/CucumberRunner.java +++ /dev/null @@ -1,14 +0,0 @@ -package ru.ibs.framework; - -import io.cucumber.junit.Cucumber; -import io.cucumber.junit.CucumberOptions; -import org.junit.runner.RunWith; - -@RunWith(Cucumber.class) -@CucumberOptions( - features = "src/test/resources/features", - glue = "ru.ibs.tests", - plugin = {"pretty", "io.qameta.allure.cucumber7jvm.AllureCucumber7Jvm"}, - snippets = CucumberOptions.SnippetType.CAMELCASE -) -public class CucumberRunner {} \ No newline at end of file diff --git a/src/test/java/ru/ibs/framework/RegardTestRunner.java b/src/test/java/ru/ibs/framework/RegardTestRunner.java new file mode 100644 index 0000000..31d5a12 --- /dev/null +++ b/src/test/java/ru/ibs/framework/RegardTestRunner.java @@ -0,0 +1,16 @@ +package ru.ibs.framework; + +import io.cucumber.junit.Cucumber; +import io.cucumber.junit.CucumberOptions; +import org.junit.runner.RunWith; + +@RunWith(Cucumber.class) +@CucumberOptions( + features = "src/test/resources/features", + glue = "ru.ibs.tests", + plugin = { + "pretty", + "io.qameta.allure.cucumber7jvm.AllureCucumber7Jvm" + } +) +public class RegardTestRunner {} \ No newline at end of file diff --git a/src/test/java/ru/ibs/framework/pages/BasePage.java b/src/test/java/ru/ibs/framework/pages/BasePage.java index a549d1f..426b376 100644 --- a/src/test/java/ru/ibs/framework/pages/BasePage.java +++ b/src/test/java/ru/ibs/framework/pages/BasePage.java @@ -1,45 +1,46 @@ -package ru.ibs.framework.pages; +package ru.appline.framework.pages; import org.openqa.selenium.By; import org.openqa.selenium.JavascriptExecutor; +import org.openqa.selenium.Keys; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; -import org.openqa.selenium.support.PageFactory; import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.WebDriverWait; -import ru.ibs.framework.managers.DriverManager; import java.time.Duration; +import java.util.List; -public class BasePage { +public abstract class BasePage { + protected WebDriver driver; + protected WebDriverWait wait; - protected WebDriver driver = DriverManager.getDriverManager().getDriver(); - protected WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(10)); - - public BasePage() { - PageFactory.initElements(driver, this); + public BasePage(WebDriver driver) { + this.driver = driver; + this.wait = new WebDriverWait(driver, Duration.ofSeconds(10)); } - protected void fillInputField(By locator, String value) { - WebElement el = waitUntilVisible(locator); - scrollToElement(el); + protected void click(By locator) { + wait.until(ExpectedConditions.elementToBeClickable(locator)).click(); + } + + protected void type(By locator, String text) { + WebElement el = wait.until(ExpectedConditions.visibilityOfElementLocated(locator)); el.clear(); - el.sendKeys(value); + el.sendKeys(text); } - protected void scrollToElement(WebElement element) { - ((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", element); + protected String getText(By locator) { + return wait.until(ExpectedConditions.visibilityOfElementLocated(locator)).getText(); } - protected WebElement waitUntilVisible(By locator) { - return wait.until(ExpectedConditions.visibilityOfElementLocated(locator)); + protected List findElements(By locator) { + return wait.until(ExpectedConditions.visibilityOfAllElementsLocatedBy(locator)); } - protected WebElement waitUntilClickable(By locator) { - return wait.until(ExpectedConditions.elementToBeClickable(locator)); - } - - protected void waitUntilInvisible(By locator) { - wait.until(ExpectedConditions.invisibilityOfElementLocated(locator)); + protected void waitForJSIdle() { + new WebDriverWait(driver, Duration.ofSeconds(15)).until( + wd -> ((JavascriptExecutor) wd).executeScript("return document.readyState").equals("complete") + ); } } diff --git a/src/test/java/ru/ibs/framework/pages/CatalogPage.java b/src/test/java/ru/ibs/framework/pages/CatalogPage.java new file mode 100644 index 0000000..f9301cf --- /dev/null +++ b/src/test/java/ru/ibs/framework/pages/CatalogPage.java @@ -0,0 +1,49 @@ +package ru.ibs.framework.pages; + +import org.openqa.selenium.*; +import org.openqa.selenium.support.ui.ExpectedConditions; +import org.openqa.selenium.support.ui.WebDriverWait; + +import java.time.Duration; + +public class CatalogPage { + private final WebDriver driver; + private final WebDriverWait wait; + + public CatalogPage(WebDriver driver) { + this.driver = driver; + this.wait = new WebDriverWait(driver, Duration.ofSeconds(10)); + } + + public void selectCategory(String name) { + WebElement categoryLink = wait.until(ExpectedConditions.elementToBeClickable( + By.xpath("//a[text()='" + name + "']"))); + categoryLink.click(); + } + + public void closeCookieBannerIfPresent() { + try { + WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(5)); + WebElement acceptButton = wait.until(ExpectedConditions.elementToBeClickable( + By.cssSelector("button.CookieBannerPopover_acceptBtn__VRuFj"))); + acceptButton.click(); + Thread.sleep(500); + } catch (TimeoutException | InterruptedException e) { + + } + } + + public void selectSubCategory(String name) { + closeCookieBannerIfPresent(); // Закрыть баннер если есть + + WebElement subCategory = wait.until(ExpectedConditions.presenceOfElementLocated( + By.xpath("//p[contains(text(), '" + name + "')]/ancestor::a[1]"))); + // Клик через JS: + ((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", subCategory); + ((JavascriptExecutor) driver).executeScript("arguments[0].click();", subCategory); + + // Ждём загрузки фильтра, чтобы убедиться, что перешли + wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("input[name='min']"))); + } + +} \ No newline at end of file diff --git a/src/test/java/ru/ibs/framework/pages/ListingPage.java b/src/test/java/ru/ibs/framework/pages/ListingPage.java new file mode 100644 index 0000000..c18dc43 --- /dev/null +++ b/src/test/java/ru/ibs/framework/pages/ListingPage.java @@ -0,0 +1,48 @@ +package ru.ibs.framework.pages; + +import org.openqa.selenium.*; +import org.openqa.selenium.support.ui.ExpectedConditions; +import org.openqa.selenium.support.ui.WebDriverWait; + +import java.time.Duration; +import java.util.List; + +public class ListingPage { + private final WebDriver driver; + private final WebDriverWait wait; + + public ListingPage(WebDriver driver) { + this.driver = driver; + this.wait = new WebDriverWait(driver, Duration.ofSeconds(10)); + } + + public void setMinPrice(String price) { + WebElement minPrice = driver.findElement(By.cssSelector("input[name='min']")); + minPrice.clear(); + minPrice.sendKeys(price); + minPrice.sendKeys(Keys.ENTER); + waitForJSIdle(); + } + + public void selectGigabyte() { + WebElement checkbox = wait.until(ExpectedConditions.elementToBeClickable( + By.cssSelector("input[id*='Gigabyte'] + label"))); + checkbox.click(); + waitForJSIdle(); + } + + public List getAllProducts() { + return driver.findElements(By.cssSelector("div.Card_wrap__hES44")); + } + + public String getFirstProductTitle() { + return wait.until(ExpectedConditions.visibilityOfElementLocated( + By.cssSelector("a.CardText_link__C_fPZ > div.CardText_title__7bSbO"))).getText(); + } + + public void waitForJSIdle() { + new WebDriverWait(driver, Duration.ofSeconds(10)).until(driver -> + ((JavascriptExecutor) driver).executeScript("return document.readyState").equals("complete") + ); + } +} diff --git a/src/test/java/ru/ibs/framework/pages/MainPage.java b/src/test/java/ru/ibs/framework/pages/MainPage.java new file mode 100644 index 0000000..3fb0727 --- /dev/null +++ b/src/test/java/ru/ibs/framework/pages/MainPage.java @@ -0,0 +1,19 @@ +// MainPage.java +package ru.ibs.framework.pages; + +import org.openqa.selenium.By; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; + +public class MainPage { + private final WebDriver driver; + + public MainPage(WebDriver driver) { + this.driver = driver; + } + + public void openCatalog() { + WebElement catalogButton = driver.findElement(By.xpath("//span[text()='Каталог']/parent::button")); + catalogButton.click(); + } +} \ No newline at end of file diff --git a/src/test/java/ru/ibs/tests/BaseTests.java b/src/test/java/ru/ibs/tests/BaseTests.java deleted file mode 100644 index 8d37efb..0000000 --- a/src/test/java/ru/ibs/tests/BaseTests.java +++ /dev/null @@ -1,18 +0,0 @@ -package ru.ibs.tests; - -import org.junit.AfterClass; -import org.junit.BeforeClass; -import ru.ibs.framework.managers.DriverManager; - -public class BaseTests { - - @BeforeClass - public static void beforeAll() { - DriverManager.getDriverManager(); - } - - @AfterClass - public static void afterAll() { - DriverManager.getDriverManager().quitDriver(); - } -} diff --git a/src/test/java/ru/ibs/tests/BusinessTripPage.java b/src/test/java/ru/ibs/tests/BusinessTripPage.java deleted file mode 100644 index ad36606..0000000 --- a/src/test/java/ru/ibs/tests/BusinessTripPage.java +++ /dev/null @@ -1,103 +0,0 @@ -package ru.ibs.tests; - -import org.openqa.selenium.*; -import org.openqa.selenium.support.FindBy; -import org.openqa.selenium.support.PageFactory; -import org.openqa.selenium.support.ui.*; - -import java.time.Duration; - -public class BusinessTripPage { - private final WebDriver driver; - private final WebDriverWait wait; - - @FindBy(xpath = "//h1[contains(text(), 'Командировки')]") - private WebElement tripsHeader; - - @FindBy(css = "div.pull-left.btn-group.icons-holder") - private WebElement createTripButton; - - @FindBy(xpath = "//h1[@class='user-name' and contains(text(), 'Создать командировку')]") - private WebElement createTripHeader; - - @FindBy(xpath = "//select[contains(@name,'businessUnit')]") - private WebElement departmentSelect; - - @FindBy(id = "company-selector-show") - private WebElement companySelectorShow; - - @FindBy(css = "span.select2-chosen") - private WebElement organizationSpan; - - @FindBy(css = "input.select2-input") - private WebElement organizationInput; - - @FindBy(xpath = "//label[contains(text(),'Заказ билетов')]/preceding-sibling::input") - private WebElement ticketsCheckbox; - - @FindBy(xpath = "//button[contains(text(),'Сохранить и закрыть')]") - private WebElement saveAndCloseButton; - - public BusinessTripPage(WebDriver driver) { - this.driver = driver; - this.wait = new WebDriverWait(driver, Duration.ofSeconds(10)); - PageFactory.initElements(driver, this); - } - - public boolean isTripsPageLoaded() { - return wait.until(ExpectedConditions.visibilityOf(tripsHeader)).isDisplayed(); - } - - public void openCreateTripForm() { - wait.until(ExpectedConditions.elementToBeClickable(createTripButton)).click(); - wait.until(ExpectedConditions.visibilityOf(createTripHeader)); - } - - public void selectDepartment(String departmentName) { - Select select = new Select(departmentSelect); - select.selectByVisibleText(departmentName); - } - - public void selectOrganization(String orgName) { - companySelectorShow.click(); - wait.until(ExpectedConditions.elementToBeClickable(organizationSpan)).click(); - wait.until(ExpectedConditions.visibilityOf(organizationInput)).sendKeys(orgName); - wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//span[@class='select2-match' and text()='" + orgName + "']"))).click(); - } - - public void setTicketsCheckbox(boolean checked) { - if (ticketsCheckbox.isSelected() != checked) { - ticketsCheckbox.click(); - } - } - - public void fillCity(String city) { - By cityInputLocator = By.xpath("//input[contains(@id,'arrivalCity')]"); - WebElement cityInput = wait.until(ExpectedConditions.visibilityOfElementLocated(cityInputLocator)); - scrollToElement(cityInput); - cityInput.clear(); - cityInput.sendKeys(city); - } - - public void fillDate(By dateLocator, String dateValue) { - WebElement dateInput = wait.until(ExpectedConditions.elementToBeClickable(dateLocator)); - scrollToElement(dateInput); - dateInput.clear(); - dateInput.sendKeys(dateValue); - dateInput.sendKeys(Keys.TAB); - } - - public void saveAndClose() { - scrollToElement(saveAndCloseButton); - saveAndCloseButton.click(); - } - - public boolean isErrorDisplayed(String errorText) { - By errorLocator = By.xpath("//span[@class='validation-failed' and contains(text(), '" + errorText + "')]"); - return wait.until(ExpectedConditions.visibilityOfElementLocated(errorLocator)).isDisplayed(); - } - - private void scrollToElement(WebElement element) { - ((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", element); - } -} diff --git a/src/test/java/ru/ibs/tests/BusinessTripSteps.java b/src/test/java/ru/ibs/tests/BusinessTripSteps.java deleted file mode 100644 index 1b99cbc..0000000 --- a/src/test/java/ru/ibs/tests/BusinessTripSteps.java +++ /dev/null @@ -1,91 +0,0 @@ -package ru.ibs.tests; - -import io.cucumber.java.ru.*; -import static org.junit.Assert.*; - -import io.cucumber.java.After; -import org.openqa.selenium.By; -import ru.ibs.framework.managers.DriverManager; -import ru.ibs.tests.*; - -public class BusinessTripSteps { - - private final LoginPage loginPage = new LoginPage(DriverManager.getDriverManager().getDriver()); - private DashboardPage dashboardPage; - private BusinessTripPage businessTripPage; - - @Дано("Открываем страницу логина") - public void openLoginPage() { - DriverManager.getDriverManager().getDriver().get("http://training.appline.ru/user/login"); - } - - @И("Вводим логин {string} и пароль {string}") - public void login(String username, String password) { - dashboardPage = loginPage.login(username, password); - } - - @И("Проверяем, что панель быстрого запуска загружена") - public void dashboardLoaded() { - assertTrue("Dashboard not loaded", dashboardPage.isDashboardLoaded()); - } - - @И("Переходим в раздел {string}") - public void goToBusinessTrip(String name) { - businessTripPage = dashboardPage.goToBusinessTrip(); - } - - @И("Проверяем, что страница {string} загружена") - public void tripsPageLoaded(String title) { - assertTrue("Trips page not loaded", businessTripPage.isTripsPageLoaded()); - } - - @И("Нажимаем на кнопку создания новой командировки") - public void openCreateTripForm() { - businessTripPage.openCreateTripForm(); - } - - @И("Выбираем подразделение {string}") - public void selectDepartment(String department) { - businessTripPage.selectDepartment(department); - } - - @И("Выбираем организацию {string}") - public void selectOrganization(String organization) { - businessTripPage.selectOrganization(organization); - } - - @И("Устанавливаем чекбокс {string} в положение {string}") - public void setCheckbox(String checkboxName, String value) { - boolean checked = Boolean.parseBoolean(value); - businessTripPage.setTicketsCheckbox(checked); - } - - @И("Заполняем поле {string} значением {string}") - public void fillCityOrDate(String field, String value) { - if (field.equalsIgnoreCase("Город")) { - businessTripPage.fillCity(value); - } else if (field.equalsIgnoreCase("Дата отправления")) { - businessTripPage.fillDate(By.xpath("//input[@placeholder='Укажите дату' and contains(@id, 'departureDatePlan')]"), value); - } else if (field.equalsIgnoreCase("Дата возвращения")) { - businessTripPage.fillDate(By.xpath("//input[@placeholder='Укажите дату' and contains(@id, 'returnDatePlan')]"), value); - } - } - - @И("Нажимаем кнопку {string}") - public void clickButton(String buttonName) { - if (buttonName.equals("Сохранить и закрыть")) { - businessTripPage.saveAndClose(); - } - } - - @Тогда("Проверяем, что отображается ошибка {string}") - public void checkError(String errorText) { - assertTrue("Expected validation error not shown", - businessTripPage.isErrorDisplayed(errorText)); - } - - @After - public void tearDown() { - DriverManager.getDriverManager().quitDriver(); - } -} diff --git a/src/test/java/ru/ibs/tests/DashboardPage.java b/src/test/java/ru/ibs/tests/DashboardPage.java deleted file mode 100644 index 84be3c1..0000000 --- a/src/test/java/ru/ibs/tests/DashboardPage.java +++ /dev/null @@ -1,42 +0,0 @@ -package ru.ibs.tests; - -import org.openqa.selenium.WebDriver; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.interactions.Actions; -import org.openqa.selenium.support.FindBy; -import org.openqa.selenium.support.PageFactory; -import org.openqa.selenium.support.ui.ExpectedConditions; -import org.openqa.selenium.support.ui.WebDriverWait; - -import java.time.Duration; - -public class DashboardPage { - private final WebDriver driver; - private final WebDriverWait wait; - - @FindBy(xpath = "//h1[@class='oro-subtitle' and contains(text(), 'Панель быстрого запуска')]") - private WebElement dashboardTitle; - - @FindBy(xpath = "//span[text()='Расходы']/ancestor::li") - private WebElement expensesMenu; - - @FindBy(xpath = "//a[@href='/business-trip/']/span[text()='Командировки']") - private WebElement businessTripLink; - - public DashboardPage(WebDriver driver) { - this.driver = driver; - this.wait = new WebDriverWait(driver, Duration.ofSeconds(10)); - PageFactory.initElements(driver, this); - } - - public boolean isDashboardLoaded() { - return wait.until(ExpectedConditions.visibilityOf(dashboardTitle)).isDisplayed(); - } - - public BusinessTripPage goToBusinessTrip() { - Actions actions = new Actions(driver); - actions.moveToElement(expensesMenu).perform(); - wait.until(ExpectedConditions.elementToBeClickable(businessTripLink)).click(); - return new BusinessTripPage(driver); - } -} diff --git a/src/test/java/ru/ibs/tests/LoginPage.java b/src/test/java/ru/ibs/tests/LoginPage.java deleted file mode 100644 index e5f169a..0000000 --- a/src/test/java/ru/ibs/tests/LoginPage.java +++ /dev/null @@ -1,39 +0,0 @@ -package ru.ibs.tests; - -import org.openqa.selenium.WebDriver; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.support.FindBy; -import org.openqa.selenium.support.PageFactory; -import org.openqa.selenium.support.ui.ExpectedConditions; -import org.openqa.selenium.support.ui.WebDriverWait; - -import java.time.Duration; - -public class LoginPage { - private final WebDriver driver; - private final WebDriverWait wait; - - @FindBy(id = "prependedInput") - private WebElement usernameInput; - - @FindBy(id = "prependedInput2") - private WebElement passwordInput; - - @FindBy(xpath = "//button[@type='submit']") - private WebElement loginButton; - - public LoginPage(WebDriver driver) { - this.driver = driver; - this.wait = new WebDriverWait(driver, Duration.ofSeconds(10)); - PageFactory.initElements(driver, this); - } - - public DashboardPage login(String username, String password) { - wait.until(ExpectedConditions.visibilityOf(usernameInput)).clear(); - usernameInput.sendKeys(username); - wait.until(ExpectedConditions.visibilityOf(passwordInput)).clear(); - passwordInput.sendKeys(password); - wait.until(ExpectedConditions.elementToBeClickable(loginButton)).click(); - return new DashboardPage(driver); - } -} diff --git a/src/test/java/ru/ibs/tests/SearchSteps.java b/src/test/java/ru/ibs/tests/SearchSteps.java new file mode 100644 index 0000000..2baf82e --- /dev/null +++ b/src/test/java/ru/ibs/tests/SearchSteps.java @@ -0,0 +1,106 @@ +package ru.ibs.tests; + +import io.cucumber.java.After; +import io.cucumber.java.ru.Дано; +import io.cucumber.java.ru.И; +import io.cucumber.java.ru.Тогда; + +import org.openqa.selenium.By; +import org.openqa.selenium.Keys; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; + +import org.openqa.selenium.support.ui.ExpectedConditions; +import org.openqa.selenium.support.ui.WebDriverWait; +import ru.ibs.framework.managers.DriverManager; +import ru.ibs.framework.pages.CatalogPage; +import ru.ibs.framework.pages.ListingPage; +import ru.ibs.framework.pages.MainPage; + +import java.time.Duration; +import java.util.List; + +import static org.junit.Assert.*; + +public class SearchSteps { + + WebDriver driver = DriverManager.getDriverManager().getDriver(); + MainPage mainPage = new MainPage(driver); + CatalogPage catalogPage = new CatalogPage(driver); + ListingPage listingPage = new ListingPage(driver); + String savedProductTitle; + + @Дано("Открываем сайт regard") + public void openSite() { + driver.get("https://regard.ru/"); + driver.manage().window().maximize(); + catalogPage.closeCookieBannerIfPresent(); + } + + @И("Открываем меню Каталог") + public void openCatalog() { + mainPage.openCatalog(); + } + + @И("Выбираем раздел {string}") + public void chooseCategory(String category) { + catalogPage.selectCategory(category); + } + + @И("Выбираем подраздел {string}") + public void chooseSubCategory(String sub) { + catalogPage.selectSubCategory(sub); + } + + @И("Задаем цену от {string}") + public void setPrice(String price) { + listingPage.setMinPrice(price); + } + + @И("Фильтруем по производителю {string}") + public void filterByManufacturer(String name) { + if (name.equalsIgnoreCase("Gigabyte")) { + listingPage.selectGigabyte(); + } + } + + @И("Проверяем, что товаров не более {int}") + public void checkNumberOfProducts(int max) { + assertTrue(listingPage.getAllProducts().size() <= max); + } + + @И("Сохраняем наименование первого товара") + public void saveFirstProductName() { + savedProductTitle = listingPage.getFirstProductTitle(); + } + + @И("Ищем товар по сохраненному имени") + public void searchSavedProduct() { + WebElement searchInput = driver.findElement(By.id("searchInput")); + searchInput.clear(); + searchInput.sendKeys(savedProductTitle); + searchInput.sendKeys(Keys.ENTER); + + // Ждем, пока появится хотя бы один товар на странице результатов поиска + new WebDriverWait(driver, Duration.ofSeconds(10)).until( + ExpectedConditions.visibilityOfElementLocated(By.cssSelector("div.Card_wrap__hES44")) + ); + } + + @Тогда("На странице только один товар") + public void waitForProductsCountChange() { + WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(10)); + int oldCount = listingPage.getAllProducts().size(); + wait.until(driver -> driver.findElements(By.cssSelector("div.Card_wrap__hES44")).size() != oldCount); + } + + @И("Название товара соответствует сохраненному") + public void titleShouldMatchSaved() { + assertEquals(savedProductTitle, listingPage.getFirstProductTitle()); + } + + @After + public void tearDown() { + DriverManager.getDriverManager().quitDriver(); + } +} diff --git a/src/test/resources/features/cucumberScenario.feature b/src/test/resources/features/cucumberScenario.feature deleted file mode 100644 index 5d544a3..0000000 --- a/src/test/resources/features/cucumberScenario.feature +++ /dev/null @@ -1,19 +0,0 @@ -# language: ru -@businessTrip -Функционал: Создание командировки - - Сценарий: Проверка ошибки при попытке создать командировку без сотрудников - * Открываем страницу логина - * Вводим логин "Irina Filippova" и пароль "testing" - * Проверяем, что панель быстрого запуска загружена - * Переходим в раздел "Командировки" - * Проверяем, что страница "Командировки" загружена - * Нажимаем на кнопку создания новой командировки - * Выбираем подразделение "Отдел внутренней разработки" - * Выбираем организацию "Edge" - * Устанавливаем чекбокс "Заказ билетов" в положение "true" - * Заполняем поле "Город" значением "Дмитров" - * Заполняем поле "Дата отправления" значением "01.01.2025" - * Заполняем поле "Дата возвращения" значением "10.01.2025" - * Нажимаем кнопку "Сохранить и закрыть" - * Проверяем, что отображается ошибка "Список командируемых сотрудников не может быть пустым" diff --git a/src/test/resources/features/regard_search.feature b/src/test/resources/features/regard_search.feature new file mode 100644 index 0000000..a633c3b --- /dev/null +++ b/src/test/resources/features/regard_search.feature @@ -0,0 +1,15 @@ +# language: ru +Функциональность: Поиск видеокарты на сайте regard.ru + + Сценарий: Поиск видеокарты Gigabyte с фильтрами и проверкой результатов + Дано Открываем сайт regard + И Открываем меню Каталог + И Выбираем раздел "Комплектующие для ПК" + И Выбираем подраздел "Видеокарты" + И Задаем цену от "20000" + И Фильтруем по производителю "Gigabyte" + И Проверяем, что товаров не более 24 + И Сохраняем наименование первого товара + И Ищем товар по сохраненному имени + Тогда На странице только один товар + И Название товара соответствует сохраненному