-
Notifications
You must be signed in to change notification settings - Fork 6
RF | Replace the returned WebElement to String on Pages #1870
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| (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)))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А тут нельзя да вынести элемент в FindBy?
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Text должен быть в конце
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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() { |
There was a problem hiding this comment.
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() { |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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), |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А зачем коммент?
#1869