Skip to content

Conversation

@Elena-Galina
Copy link
Collaborator

@Elena-Galina Elena-Galina linked an issue Jan 16, 2026 that may be closed by this pull request
(By.xpath("//button[contains(@style,'inline-flex') and normalize-space()='%s']".formatted(buildStep))));
public String verifySentNameIsInFilter(String buildStep) {
return getWait5().until(ExpectedConditions.visibilityOfElementLocated(By
.xpath("//button[contains(@style,'inline-flex') and normalize-space()='%s']".formatted(buildStep))))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А тут нельзя да вынести элемент в FindBy?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Решили, что при переходе на PageFactory "не трогаем форматированные локаторы (%s, .formatted())"


public WebElement findItem(String itemName) {
return getDriver().findElement(By.xpath("//a[@href='job/" + itemName + "/']"));
public String getTextFoundItem(String itemName) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Text должен быть в конце

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ок, поправлю)

return getWait10().until(ExpectedConditions.visibilityOfElementLocated(By.id("itemname-invalid")));
public String getErrorMessageText() {
return getWait10().until(ExpectedConditions.visibilityOfElementLocated(By
.id("itemname-invalid"))).getText();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Этот элемент точно можно вынести в в поле

}

public WebElement getTextAreaValidationMessage() {
public String getTextAreaValidationMessage() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тоже Text в конец

return this;
}

public String getDisplayNameInStatus() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename: getStatusDisplayNameText?

.gotoHomePage()
.findItem(MULTIBRANCH_PIPELINE_NAME)
.getText();
.getTextFoundItem(MULTIBRANCH_PIPELINE_NAME);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Text в конец


Assert.assertEquals(
visibleStep.getText(),
configPage.verifySentNameIsInFilter(buildStep),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Мне и кажется это лучше убрать в chain

.typeIntoFilterBuildStep(buildStep.substring(0, Math.min(5, buildStep.length())));

WebElement visibleStep = configPage.verifySentNameIsInFilter(buildStep);
// WebElement visibleStep = configPage.verifySentNameIsInFilter(buildStep);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А зачем коммент?

@Elena-Galina Elena-Galina merged commit 07ebefc into main Jan 16, 2026
2 checks passed
@Elena-Galina Elena-Galina deleted the eg/replace-returned-WebElement-to-String branch January 16, 2026 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RF | Replace the returned WebElement to String on all pages

4 participants