-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#208: adds tests for tab context menu, makes test execution more resi…
…lient
- Loading branch information
1 parent
558cdb2
commit 7506729
Showing
26 changed files
with
236 additions
and
96 deletions.
There are no files selected for viewing
19 changes: 0 additions & 19 deletions
19
app-tests/src/test/scala/app/logorrr/steps/CanCloseAllFiles.scala
This file was deleted.
Oops, something went wrong.
23 changes: 23 additions & 0 deletions
23
app-tests/src/test/scala/app/logorrr/steps/CheckTabPaneActions.scala
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,23 @@ | ||
package app.logorrr.steps | ||
|
||
import app.logorrr.usecases.TestFxBaseApplicationTest | ||
import app.logorrr.views.UiNodes | ||
import javafx.scene.control.TabPane | ||
|
||
|
||
trait CheckTabPaneActions { | ||
self: TestFxBaseApplicationTest => | ||
|
||
def checkForEmptyTabPane(): Unit = { | ||
waitForPredicate[TabPane](UiNodes.MainTabPane, classOf[TabPane], tabPane => { | ||
tabPane.getTabs.isEmpty | ||
}) | ||
} | ||
|
||
def checkForNonEmptyTabPane(): Unit = { | ||
waitForPredicate[TabPane](UiNodes.MainTabPane, classOf[TabPane], tabPane => { | ||
!tabPane.getTabs.isEmpty | ||
}) | ||
} | ||
|
||
} |
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
33 changes: 33 additions & 0 deletions
33
...est/scala/app/logorrr/usecases/contextmenu/OpenSingleFileAndCloseViaContextMenuTest.scala
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,33 @@ | ||
package app.logorrr.usecases.contextmenu | ||
|
||
import app.logorrr.TestFiles | ||
import app.logorrr.steps.{CheckTabPaneActions, VisibleItemActions} | ||
import app.logorrr.usecases.SingleFileApplicationTest | ||
import app.logorrr.views.UiNodes | ||
import app.logorrr.views.logfiletab.actions.CloseTabMenuItem | ||
import javafx.scene.input.MouseButton | ||
import javafx.scene.layout.StackPane | ||
import org.junit.jupiter.api.Test | ||
|
||
/** | ||
* Checks if LogoRRR can open a file via the 'open file' menu | ||
*/ | ||
class OpenSingleFileAndCloseViaContextMenuTest | ||
extends SingleFileApplicationTest(TestFiles.simpleLog0) | ||
with VisibleItemActions | ||
with CheckTabPaneActions { | ||
|
||
/** | ||
* checks if an open file creates a new logfiletab with an id matching the file opened. | ||
*/ | ||
@Test def openAndCloseTab(): Unit = { | ||
checkForEmptyTabPane() | ||
openFile(path) | ||
checkForNonEmptyTabPane() | ||
clickOn(lookup(UiNodes.LogFileHeaderTabs).query[StackPane](), MouseButton.SECONDARY) | ||
waitAndClickVisibleItem(CloseTabMenuItem.uiNode(fileId)) | ||
checkForEmptyTabPane() | ||
} | ||
|
||
} | ||
|
33 changes: 33 additions & 0 deletions
33
...s/src/test/scala/app/logorrr/usecases/contextmenu/OpenSingleFileAndOpenInFinderTest.scala
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,33 @@ | ||
package app.logorrr.usecases.contextmenu | ||
|
||
import app.logorrr.TestFiles | ||
import app.logorrr.steps.{CheckTabPaneActions, VisibleItemActions} | ||
import app.logorrr.usecases.SingleFileApplicationTest | ||
import app.logorrr.views.UiNodes | ||
import app.logorrr.views.logfiletab.actions.OpenInFinderMenuItem | ||
import javafx.scene.input.MouseButton | ||
import javafx.scene.layout.StackPane | ||
import org.junit.jupiter.api.Test | ||
|
||
/** | ||
* Checks if LogoRRR can open a file via the 'open file' menu | ||
*/ | ||
class OpenSingleFileAndOpenInFinderTest | ||
extends SingleFileApplicationTest(TestFiles.simpleLog0) | ||
with VisibleItemActions | ||
with CheckTabPaneActions { | ||
|
||
/** | ||
* checks if an open file creates a new logfiletab with an id matching the file opened. | ||
*/ | ||
@Test def openSingleFileAndOpenInFinderTest(): Unit = { | ||
checkForEmptyTabPane() | ||
openFile(path) | ||
checkForNonEmptyTabPane() | ||
clickOn(lookup(UiNodes.LogFileHeaderTabs).query[StackPane](), MouseButton.SECONDARY) | ||
waitAndClickVisibleItem(OpenInFinderMenuItem.uiNode(fileId)) | ||
checkForNonEmptyTabPane() | ||
} | ||
|
||
} | ||
|
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
15 changes: 7 additions & 8 deletions
15
.../src/test/scala/app/logorrr/usecases/openclose/OpenAndCloseMultipleFilesViaMenuTest.scala
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
Oops, something went wrong.