-
Notifications
You must be signed in to change notification settings - Fork 1
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
Petr Komissarov
committed
May 16, 2024
1 parent
9697c5e
commit fdafaf9
Showing
9 changed files
with
199 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,21 @@ | ||
pluginVersion = 1.0.5 | ||
pluginGroup = ru.testit.management | ||
pluginName = testit_management | ||
pluginRepositoryUrl = https://github.com/testit-tms/testit-management/ | ||
pluginSinceBuild = 231 | ||
pluginUntilBuild = 241.* | ||
platformType = IC | ||
platformVersion = 2024.1.1 | ||
platformPlugins = | ||
javaEncoding = UTF-8 | ||
javaVersion = 17 | ||
kotlin.code.style = official | ||
kotlin.stdlib.default.dependency = false | ||
org.gradle.caching = true | ||
org.gradle.configuration-cache = true | ||
org.gradle.configureondemand = true | ||
org.gradle.parallel = true | ||
org.gradle.warning.mode = all | ||
org.gradle.welcome = never | ||
org.gradle.jvmargs = -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseParallelGC | ||
pluginVersion=1.0.5 | ||
pluginGroup=ru.testit.management | ||
pluginName=testit_management | ||
pluginRepositoryUrl=https://github.com/testit-tms/testit-management/ | ||
gradleVersion=8.7 | ||
pluginSinceBuild=231 | ||
pluginUntilBuild=241.* | ||
platformType=IC | ||
platformVersion=2024.1.1 | ||
platformPlugins= | ||
javaEncoding=UTF-8 | ||
javaVersion=17 | ||
kotlin.code.style=official | ||
kotlin.stdlib.default.dependency=false | ||
org.gradle.caching=true | ||
org.gradle.configuration-cache=true | ||
org.gradle.configureondemand=true | ||
org.gradle.parallel=true | ||
org.gradle.warning.mode=all | ||
org.gradle.welcome=never | ||
org.gradle.jvmargs=-XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseParallelGC |
Empty file.
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,25 @@ | ||
package ru.testit.management | ||
|
||
import org.junit.jupiter.api.DisplayName | ||
import ru.testit.management.clients.TmsClient | ||
import kotlin.test.DefaultAsserter.assertEquals | ||
import kotlin.test.Test | ||
|
||
|
||
@DisplayName("Client") | ||
class ClientTests { | ||
|
||
@DisplayName("Validation") | ||
@Test | ||
fun checkMessage() { | ||
// Arrange | ||
val expected = | ||
"<html><body style='width: 350px;'>Expected URL scheme 'http' or 'https' but no scheme was found for /api/v...</body></html>" | ||
|
||
// Act | ||
val actual = TmsClient.getSettingsValidationErrorMsg("", "", "") | ||
|
||
// Assert | ||
assertEquals("Validation error message assertion failed!", expected, actual) | ||
} | ||
} |
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,29 @@ | ||
package ru.testit.management | ||
|
||
import org.junit.jupiter.api.DisplayName | ||
import org.junit.jupiter.api.condition.DisabledIfSystemProperty | ||
import ru.testit.management.utils.ClipboardUtils | ||
import java.awt.Toolkit.getDefaultToolkit | ||
import java.awt.datatransfer.DataFlavor | ||
import kotlin.test.DefaultAsserter.assertEquals | ||
import kotlin.test.Test | ||
|
||
|
||
@DisplayName("Clipboard") | ||
class ClipboardTests { | ||
|
||
@DisplayName("Copy") | ||
@DisabledIfSystemProperty(named = "TEST_CI", matches = "true") | ||
@Test | ||
fun checkCopy() { | ||
// Arrange | ||
val expected = "Test123" | ||
|
||
// Act | ||
ClipboardUtils.copyToClipboard(expected) | ||
val actual = getDefaultToolkit().systemClipboard.getData(DataFlavor.stringFlavor) as String | ||
|
||
// Assert | ||
assertEquals("Clipboard value assertion failed!", expected, actual) | ||
} | ||
} |
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,53 @@ | ||
package ru.testit.management | ||
|
||
import kotlinx.collections.immutable.persistentSetOf | ||
import org.junit.jupiter.api.DisplayName | ||
import ru.testit.client.model.StepModel | ||
import ru.testit.management.utils.CodeSnippedUtils | ||
import ru.testit.management.windows.tools.TmsNodeModel | ||
import kotlin.test.DefaultAsserter.assertEquals | ||
import kotlin.test.Test | ||
|
||
|
||
@DisplayName("Code snippet") | ||
class CodeSnippedTests { | ||
|
||
@DisplayName("Create") | ||
@Test | ||
fun checkCodeSnippet() { | ||
// Arrange | ||
val name = "Test name" | ||
val globalID = 12345L | ||
|
||
val preModel = StepModel() | ||
preModel.action = "Precondition text" | ||
val pre = persistentSetOf(preModel) | ||
|
||
val stepModel = StepModel() | ||
stepModel.action = "Step text" | ||
val steps = persistentSetOf(stepModel) | ||
|
||
val postModel = StepModel() | ||
postModel.action = "Postcondition text" | ||
val post = persistentSetOf(postModel) | ||
|
||
val model = TmsNodeModel(name, globalID, pre, steps, post) | ||
val expected = """@WorkItemIds("$globalID") | ||
@Test | ||
public void testName() { | ||
// See work item [$globalID] for detailed steps description | ||
// Pre: | ||
// ${preModel.action} | ||
// Steps: | ||
// ${stepModel.action} | ||
// Post: | ||
// ${postModel.action} | ||
}""" | ||
|
||
// Act | ||
val actual = CodeSnippedUtils.getNewSnippet(model) | ||
|
||
// Assert | ||
assertEquals("Code snipped text assertion failed!", expected, actual) | ||
} | ||
} |
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 @@ | ||
package ru.testit.management | ||
|
||
import org.junit.jupiter.api.DisplayName | ||
import ru.testit.management.utils.MessagesUtils | ||
import kotlin.test.DefaultAsserter.assertEquals | ||
import kotlin.test.Test | ||
|
||
|
||
@DisplayName("Messages") | ||
class MessagesTests { | ||
|
||
@DisplayName("Copy") | ||
@Test | ||
fun checkCopy() { | ||
// Arrange | ||
val expected = "Copy" | ||
|
||
// Act | ||
val actual = MessagesUtils.get("window.tool.popup.copy.text") | ||
|
||
// Assert | ||
assertEquals("Message text assertion failed!", expected, actual) | ||
} | ||
} |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
junit.jupiter.execution.parallel.enabled=true | ||
junit.jupiter.execution.parallel.mode.default=same_thread | ||
junit.jupiter.execution.parallel.mode.classes.default=concurrent | ||
junit.jupiter.displayname.generator.default=org.junit.jupiter.api.DisplayNameGenerator$ReplaceUnderscores |