- добавлены методы для KpPage.java, DialogPage.java, StartPage.java.
- добавлен тест searchInKp
This commit is contained in:
parent
84e8493fcc
commit
08461b6c92
@ -52,11 +52,12 @@ public class BpPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* НЕ РАБОТАЕТ
|
||||||
* Открывает страницу все результаты поиска
|
* Открывает страницу все результаты поиска
|
||||||
*/
|
*/
|
||||||
public static void openFullTreeList() {
|
public static void openFullTreeList() {
|
||||||
$(fullTreeListBtn).shouldBe(visible).click();
|
$(fullTreeListBtn).shouldBe(visible).click();
|
||||||
$(DocListPage.workWindow).shouldBe(visible, Duration.of(7, SECONDS));
|
$(DocListPage.workWindow).shouldBe(visible, Duration.of(3, SECONDS));
|
||||||
$(DocListPage.treeList).shouldBe(visible);
|
$(DocListPage.treeList).shouldBe(visible);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
16
src/main/java/page/DialogPage.java
Normal file
16
src/main/java/page/DialogPage.java
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
package page;
|
||||||
|
|
||||||
|
import org.openqa.selenium.By;
|
||||||
|
|
||||||
|
import static com.codeborne.selenide.Selenide.$;
|
||||||
|
|
||||||
|
public class DialogPage {
|
||||||
|
public static final By dialogPopUp = By.cssSelector("[test*='popup-search-text']");
|
||||||
|
public static final By inputSearchLine = By.cssSelector("[class*='x-input__field']");
|
||||||
|
public static final By searchBtn = By.cssSelector("[class='x-search-box__search-button']");
|
||||||
|
|
||||||
|
public static void searchInFieldByQuery(String query) {
|
||||||
|
$(inputSearchLine).sendKeys(query);
|
||||||
|
$(searchBtn).click();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,5 +1,36 @@
|
|||||||
package page;
|
package page;
|
||||||
|
|
||||||
|
import com.codeborne.selenide.ElementsCollection;
|
||||||
|
import com.codeborne.selenide.SelenideElement;
|
||||||
|
import org.openqa.selenium.By;
|
||||||
|
import org.openqa.selenium.NotFoundException;
|
||||||
|
|
||||||
|
import static com.codeborne.selenide.Selenide.*;
|
||||||
|
import static com.codeborne.selenide.Condition.*;
|
||||||
|
|
||||||
public class KpPage {
|
public class KpPage {
|
||||||
|
public static final By cardBlock = By.cssSelector("[class='x-tabs__content x-page-card-tabs__page']");
|
||||||
|
public static final By fieldsList = By.cssSelector("[test='card-field-list-table']");
|
||||||
|
public static final By clearCardBtn = By.cssSelector("[test='card-clear-button']");
|
||||||
|
public static final By cardTabMain = By.cssSelector("[test*='card-tab-0']");
|
||||||
|
|
||||||
|
public static void openSearchDialogByFieldName(String fieldName) {
|
||||||
|
ElementsCollection list = $$(fieldsList);
|
||||||
|
SelenideElement oneField = list.findBy(text(fieldName));
|
||||||
|
oneField.$("[test='card-field-value-content']").click();
|
||||||
|
$(DialogPage.dialogPopUp).shouldBe(visible);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void checkValueInFieldAfterSearch(String fieldName, String query) {
|
||||||
|
ElementsCollection list = $$(fieldsList);
|
||||||
|
SelenideElement oneField = list.findBy(text(fieldName));
|
||||||
|
oneField.shouldHave(text(query));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void searchInFieldWithoutTree(String fieldName, String query) {
|
||||||
|
openSearchDialogByFieldName(fieldName);
|
||||||
|
DialogPage.searchInFieldByQuery(query);
|
||||||
|
checkValueInFieldAfterSearch(fieldName, query);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,6 +13,7 @@ import static com.codeborne.selenide.Selenide.$;
|
|||||||
*/
|
*/
|
||||||
public class StartPage {
|
public class StartPage {
|
||||||
private static final By BP = By.cssSelector("[test*='main-toolbar-button-splus']");
|
private static final By BP = By.cssSelector("[test*='main-toolbar-button-splus']");
|
||||||
|
private static final By KP = By.cssSelector("[test='main-toolbar-button-search-card']");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -22,5 +23,10 @@ public class StartPage {
|
|||||||
$(BpPage.searchField).shouldBe(visible);
|
$(BpPage.searchField).shouldBe(visible);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void openKP() {
|
||||||
|
$(KP).click();
|
||||||
|
$(KpPage.cardBlock).shouldBe(visible);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
import com.codeborne.selenide.Selenide;
|
|
||||||
import com.codeborne.selenide.SelenideElement;
|
import com.codeborne.selenide.SelenideElement;
|
||||||
import static com.codeborne.selenide.Selenide.*;
|
|
||||||
import org.testng.Assert;
|
import org.testng.Assert;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
import page.BpPage;
|
import page.BpPage;
|
||||||
|
import page.DialogPage;
|
||||||
|
import page.KpPage;
|
||||||
import page.StartPage;
|
import page.StartPage;
|
||||||
|
|
||||||
public class ConsultantTest extends BaseTest{
|
public class ConsultantTest extends BaseTest{
|
||||||
@ -33,6 +33,7 @@ public class ConsultantTest extends BaseTest{
|
|||||||
BpPage.openContextMenuByDoc(0);
|
BpPage.openContextMenuByDoc(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// НЕ РАБОТАЕТ
|
||||||
@Test(description = "Переход в дерево-список из БП")
|
@Test(description = "Переход в дерево-список из БП")
|
||||||
public void openTreeListFromBPAndCheck() {
|
public void openTreeListFromBPAndCheck() {
|
||||||
StartPage.openBP();
|
StartPage.openBP();
|
||||||
@ -40,5 +41,9 @@ public class ConsultantTest extends BaseTest{
|
|||||||
BpPage.openFullTreeList();
|
BpPage.openFullTreeList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test(description = "Проверка поиска в КП по полю текст документа")
|
||||||
|
public void searchInKp() {
|
||||||
|
StartPage.openKP();
|
||||||
|
KpPage.searchInFieldWithoutTree("Название документа", "Закон о полиции");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user