-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
174 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
src/test/java/com/stepDefinition/UINomadMakesPipeSlipperySteps.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.stepDefinition; | ||
|
||
import io.cucumber.java.en.Then; | ||
import io.cucumber.java.en.When; | ||
import program.main.NomadMoveWindow; | ||
import program.main.NomadPipeInteraction; | ||
import program.main.PlumberMoveWindow; | ||
import program.main.PlumberPipeInteraction; | ||
|
||
import java.awt.event.ActionEvent; | ||
|
||
import static org.junit.Assert.assertTrue; | ||
import static program.main.Main.game; | ||
|
||
public class UINomadMakesPipeSlipperySteps { | ||
private NomadPipeInteraction npInteraction = new NomadPipeInteraction(); | ||
private NomadMoveWindow nmWindow = new NomadMoveWindow(3); | ||
|
||
@When("select destination nomad") | ||
public void select_destination_nomad() { | ||
System.out.println("test started"); | ||
nmWindow.actionPerformed(new ActionEvent(this,ActionEvent.ACTION_PERFORMED,"pump4")); | ||
} | ||
@When("click on make slippery") | ||
public void click_on_make_slippery() { | ||
System.out.println("test started"); | ||
ActionEvent endButtonEvent = new ActionEvent(npInteraction.getSlippery(), ActionEvent.ACTION_PERFORMED, "slippery"); | ||
npInteraction.actionPerformed(endButtonEvent); | ||
} | ||
@When("click on end turn nomad") | ||
public void click_on_end_turn_nomad() { | ||
System.out.println("test started"); | ||
ActionEvent endButtonEvent = new ActionEvent(npInteraction.getEnd(), ActionEvent.ACTION_PERFORMED, "end"); | ||
npInteraction.actionPerformed(endButtonEvent); | ||
} | ||
@Then("check if the pipe is slippery") | ||
public void check_if_the_pipe_is_slippery() { | ||
System.out.println("test started"); | ||
assertTrue(game.Pipes().get(2).GetSlippery()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
src/test/java/com/stepDefinition/UIRepairBrokenPipeSteps.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.stepDefinition; | ||
|
||
import io.cucumber.java.en.Then; | ||
import io.cucumber.java.en.When; | ||
import program.main.PlumberPipeInteraction; | ||
import program.main.State; | ||
|
||
import java.awt.event.ActionEvent; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
import static org.junit.Assert.assertTrue; | ||
import static program.main.Main.game; | ||
|
||
public class UIRepairBrokenPipeSteps { | ||
private PlumberPipeInteraction ppInteraction = new PlumberPipeInteraction(); | ||
@When("click on repair pipe") | ||
public void click_on_repair_pipe() { | ||
System.out.println("test started"); | ||
ActionEvent endButtonEvent = new ActionEvent(ppInteraction.getRepair(), ActionEvent.ACTION_PERFORMED, "repair"); | ||
ppInteraction.actionPerformed(endButtonEvent); | ||
} | ||
@Then("test if pipe is fixed") | ||
public void test_if_pipe_is_fixed() { | ||
System.out.println("test started"); | ||
assertEquals(game.Pipes().get(3).getState(), State.Working); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
src/test/resources/Features/UINomadMakesPipeSlippery.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
Feature: Nomad makes pipe slippery. | ||
|
||
Scenario: First the plumbers move, then nomad stands on a pump then moves to the other pump and makes the pipe between them slippery. | ||
|
||
Given game window starts | ||
When click on start | ||
And game starts | ||
And click on move button | ||
And select destination | ||
And click on end turn | ||
And click on move button | ||
And select destination | ||
And click on end turn | ||
And click on move button | ||
And select destination | ||
And click on end turn | ||
And click on move button | ||
And select destination | ||
And click on end turn | ||
And click on move button | ||
And select destination nomad | ||
And click on make slippery | ||
And click on end turn nomad | ||
Then check if the pipe is slippery |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Feature: Tests a plumber repairing a pipe. | ||
|
||
Scenario: A plumber moves from the starting pump to a neighboring one, and destroys the pipe in-between, then an other plumber moves and repairs that pipe. | ||
|
||
Given game window starts | ||
When click on start | ||
And game starts | ||
And click on move button | ||
And select destination | ||
And click on destroy pipe | ||
And click on end turn | ||
And test if pipe is broken | ||
And click on move button | ||
And select destination | ||
And click on repair pipe | ||
And click on end turn | ||
Then test if pipe is fixed |
Binary file not shown.
Binary file not shown.
24 changes: 24 additions & 0 deletions
24
target/test-classes/Features/UINomadMakesPipeSlippery.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
Feature: Nomad makes pipe slippery. | ||
|
||
Scenario: First the plumbers move, then nomad stands on a pump then moves to the other pump and makes the pipe between them slippery. | ||
|
||
Given game window starts | ||
When click on start | ||
And game starts | ||
And click on move button | ||
And select destination | ||
And click on end turn | ||
And click on move button | ||
And select destination | ||
And click on end turn | ||
And click on move button | ||
And select destination | ||
And click on end turn | ||
And click on move button | ||
And select destination | ||
And click on end turn | ||
And click on move button | ||
And select destination nomad | ||
And click on make slippery | ||
And click on end turn nomad | ||
Then check if the pipe is slippery |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Feature: Tests a plumber repairing a pipe. | ||
|
||
Scenario: A plumber moves from the starting pump to a neighboring one, and destroys the pipe in-between, then an other plumber moves and repairs that pipe. | ||
|
||
Given game window starts | ||
When click on start | ||
And game starts | ||
And click on move button | ||
And select destination | ||
And click on destroy pipe | ||
And click on end turn | ||
And test if pipe is broken | ||
And click on move button | ||
And select destination | ||
And click on repair pipe | ||
And click on end turn | ||
Then test if pipe is fixed |
Binary file modified
BIN
-22 Bytes
(99%)
target/test-classes/com/stepDefinition/UIChangePipeIn.class
Binary file not shown.
Binary file modified
BIN
-23 Bytes
(99%)
target/test-classes/com/stepDefinition/UIChangePipeOut.class
Binary file not shown.
Binary file modified
BIN
-21 Bytes
(99%)
target/test-classes/com/stepDefinition/UIDestroyPipeSteps.class
Binary file not shown.
Binary file renamed
BIN
+1.55 KB
...stepDefinition/UIMakePipeStickSteps.class → ...tepDefinition/UIMakePipeStickySteps.class
Binary file not shown.
Binary file added
BIN
+2.1 KB
target/test-classes/com/stepDefinition/UINomadMakesPipeSlipperySteps.class
Binary file not shown.
Binary file modified
BIN
+134 Bytes
(110%)
target/test-classes/com/stepDefinition/UIPlumberMovesSteps.class
Binary file not shown.
Binary file not shown.