Skip to content
Merged
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
16 changes: 16 additions & 0 deletions src/test/java/school/redrover/FreestyleProjectTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -301,4 +301,20 @@ public void testAddParameterForParameterizationOfBuilds() {

Assert.assertTrue(selectedParameterList.contains(parameterName));
}

@Test(dependsOnMethods = "testCreate")
public void testNavigationToWorkspaceAfterBuild() {
final String expectedHeadingText = "Workspace of " + PROJECT_NAME + " on Built-In Node";

String actualHeadingText = new HomePage(getDriver())
.openProject(PROJECT_NAME, new FreestyleProjectStatusPage(getDriver()))
.getSidebarComponent()
.clickSidebarBuildNow()
.getSidebarComponent()
.clickSidebarWorkspace()
.getHeader()
.getText();
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! Мы вроде договорились недавно не прописывать .getText(), в тестах, а прописывать в методах. Может есть смысл прописать метод getHeaderText() в Base Page, так как эта функциональность часто используется? Как ты считаешь?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Привет, да, тоже увидела. Но т.к. этот PR для одного теста, не стала менять общий метод ( он сейчас на Base Page -getHeader()). Его можно зарефакторить отдельным PR, и попутно заменить во всех тестах

Copy link
Collaborator

Choose a reason for hiding this comment

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

ok


Assert.assertEquals(actualHeadingText, expectedHeadingText);
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
package school.redrover.page;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.ui.ExpectedConditions;
import school.redrover.common.BasePage;


public class FreestyleProjectWorkspacePage extends BasePage<FreestyleProjectWorkspacePage> {

@FindBy(xpath = "//span[text()='Wipe Out Current Workspace']")
private WebElement wipeOutWorkspaceLink;

public FreestyleProjectWorkspacePage(WebDriver driver) {
super(driver);
}
Expand All @@ -17,6 +23,8 @@ public FreestyleProjectWorkspacePage getPage() {

@Override
public FreestyleProjectWorkspacePage waitUntilPageLoad() {
return null;
getWait5().until(ExpectedConditions.visibilityOf(wipeOutWorkspaceLink));

return this;
}
}