Skip to content
Closed

Rf h1 #1868

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
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ public class BuildHistoryOfJenkinsPage extends BasePage<BuildHistoryOfJenkinsPag
@FindBy(css = "thead th a.sortheader")
private List<WebElement> tableHeaders;

@FindBy(tagName = "h1")
private WebElement header;

@FindBy(css = ".jenkins-icon-size > :nth-child(1) > ol > li[tooltip]")
public WebElement iconSizeButon;

Expand All @@ -35,7 +32,7 @@ public BuildHistoryOfJenkinsPage getPage() {

@Override
public BuildHistoryOfJenkinsPage waitUntilPageLoad() {
getWait5().until(ExpectedConditions.textToBePresentInElement(header, "Build History of Jenkins"));
getWait5().until(ExpectedConditions.textToBePresentInElement(getHeader(), "Build History of Jenkins"));

return this;
}
Expand Down
9 changes: 5 additions & 4 deletions src/test/java/school/redrover/page/CloudsPage.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package school.redrover.page;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
Expand All @@ -9,12 +10,12 @@

public class CloudsPage extends BasePage<CloudsPage> {

@FindBy(tagName = "h1")
private WebElement header;

@FindBy(xpath = "//p")
private WebElement cloudsInfo;

@FindBy(xpath = "//*[@id='main-panel']//ul/li[1]/a")
private WebElement contentBlockLearnMore;

public CloudsPage(WebDriver driver) {
super(driver);
}
Expand All @@ -26,7 +27,7 @@ public CloudsPage getPage() {

@Override
public CloudsPage waitUntilPageLoad() {
getWait5().until(ExpectedConditions.visibilityOf(header));
getWait5().until(ExpectedConditions.visibilityOf(contentBlockLearnMore));

return this;
}
Expand Down
7 changes: 2 additions & 5 deletions src/test/java/school/redrover/page/CreateViewPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ public class CreateViewPage extends BasePage<CreateViewPage> {
@FindBy(xpath = "//label[text() = 'My View']")
private WebElement clickMyView;

@FindBy(tagName = "h1")
private WebElement header;

@FindBy(id = "ok")
private WebElement createButton;

Expand All @@ -40,7 +37,7 @@ public CreateViewPage getPage() {

@Override
public CreateViewPage waitUntilPageLoad() {
getWait5().until(ExpectedConditions.textToBePresentInElement(header, "New view"));
getWait5().until(ExpectedConditions.textToBePresentInElement(getHeader(), "New view"));

return this;
}
Expand All @@ -57,7 +54,7 @@ public CreateViewPage clickMyViewName(){
return this;
}

public HomePage clickCreateButtonForNewView() {
public HomePage clickCreateButtonForNewView(){
createButton.click();

return new HomePage(getDriver()).waitUntilPageLoadJS();
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/school/redrover/page/FolderStatusPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public FolderStatusPage waitUntilPageLoad() {
}

public FolderInfo getInfo() {
String displayName = getWait5().until(ExpectedConditions.visibilityOfElementLocated(By.tagName("h1"))).getText();
String displayName = getHeader().getText() ;
String description = getDriver().findElement(By.id("view-message")).getText();

return new FolderInfo(displayName, description);
Expand Down
12 changes: 5 additions & 7 deletions src/test/java/school/redrover/page/HomePage.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ public class HomePage extends BasePage<HomePage> {
@FindBy(xpath = "//span[text()='Configure a cloud']")
private WebElement configureCloudLink;

@FindBy (css = "svg[tooltip='Disabled']")
@FindBy(css = "svg[tooltip='Disabled']")
private WebElement iconDisabled;

@FindBy(css = ".jenkins-table__link >span:first-child")
private List<WebElement> projectsNames;

@FindBy (id = "systemmessage")
@FindBy(id = "systemmessage")
private WebElement systemMessage;

public HomePage(WebDriver driver) {
Expand Down Expand Up @@ -289,15 +289,13 @@ public NewNodePage clickSetUpAnAgent() {
public NodesPage clickBuildExecutorStatus() {
buildExecutorStatusButton.click();

getWait5().until(ExpectedConditions.presenceOfElementLocated(By.tagName("h1")));
return new NodesPage(getDriver());
return new NodesPage(getDriver()).waitUntilPageLoadJS();
}

public BuildHistoryOfJenkinsPage clickBuildHistory() {
buildHistoryButton.click();

getWait5().until(ExpectedConditions.presenceOfElementLocated(By.tagName("h1")));
return new BuildHistoryOfJenkinsPage(getDriver());
return new BuildHistoryOfJenkinsPage(getDriver()).waitUntilPageLoadJS();
}

public ArchitectingForScalePage clickLearnMoreAboutDistributedBuildsLink() {
Expand Down Expand Up @@ -345,7 +343,7 @@ public String checkIconSize() {
return result;
}

public boolean isDisabledIconDisplayed(){
public boolean isDisabledIconDisplayed() {

return iconDisabled.isDisplayed();
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/school/redrover/page/LoginPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public LoginPage waitUntilPageLoad() {
}

public String getTitle() {
return getDriver().findElement(By.tagName("h1")).getText();
return getHeader().getText();
}

public String getUrlProfile() {
Expand Down
Loading