Skip to content

Commit e4cd320

Browse files
authored
Merge pull request #1871 from RedRoverSchool/eg/Freestyle-Error-NoWorkspace
AT_18.005.02 - Freestyle Project - View Workspace-Error: no Workspace
2 parents 07ebefc + aed629b commit e4cd320

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed

src/test/java/school/redrover/FreestyleProjectTest.java

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package school.redrover;
22

3-
import org.openqa.selenium.By;
4-
import org.openqa.selenium.WebElement;
53
import org.testng.Assert;
64
import org.testng.annotations.Test;
75
import school.redrover.common.BaseTest;
@@ -299,10 +297,12 @@ public void testAddParameterForParameterizationOfBuilds() {
299297
Assert.assertTrue(selectedParameterList.contains(parameterName));
300298
}
301299

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

304+
createFreestyleProject(PROJECT_NAME);
305+
306306
String actualHeadingText = new HomePage(getDriver())
307307
.openProject(PROJECT_NAME, new FreestyleProjectStatusPage(getDriver()))
308308
.getSidebarComponent()
@@ -313,4 +313,27 @@ public void testNavigationToWorkspaceAfterBuild() {
313313

314314
Assert.assertEquals(actualHeadingText, expectedHeadingText);
315315
}
316+
317+
@Test
318+
public void testErrorMessageForProjectWithNoWorkspace() {
319+
final String expectedHeadingText = "Error: no workspace";
320+
321+
createFreestyleProject(PROJECT_NAME);
322+
323+
String actualHeadingText = new HomePage(getDriver())
324+
.openProject(PROJECT_NAME, new FreestyleProjectStatusPage(getDriver()))
325+
.getSidebarComponent()
326+
.clickSidebarWorkspace()
327+
.getHeaderText();
328+
329+
Assert.assertEquals(actualHeadingText, expectedHeadingText);
330+
}
331+
332+
private void createFreestyleProject(String name) {
333+
new HomePage(getDriver())
334+
.clickCreateJob()
335+
.sendName(name)
336+
.selectFreestyleProjectAndSubmit()
337+
.gotoHomePage();
338+
}
316339
}

0 commit comments

Comments
 (0)