-
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.
feat: TMS-29071: migrate to 2.1.0 plugin; add pycharm configuration;
multiple configuration build enabled; add settings dropdown list for selected generator;
- Loading branch information
1 parent
b7a95b4
commit f29d7ab
Showing
21 changed files
with
339 additions
and
97 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
12 changes: 12 additions & 0 deletions
12
src/main/kotlin/ru/testit/management/enums/FrameworkOption.kt
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,12 @@ | ||
package ru.testit.management.enums | ||
|
||
enum class FrameworkOption { | ||
JUNIT { | ||
override fun toString() = "junit" | ||
}, | ||
PYTEST { | ||
override fun toString() = "pytest" | ||
} | ||
|
||
|
||
} |
47 changes: 47 additions & 0 deletions
47
src/main/kotlin/ru/testit/management/snippet/JunitSnippet.kt
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,47 @@ | ||
package ru.testit.management.snippet | ||
|
||
import ru.testit.management.utils.CodeSnippetUtils.getTestName | ||
import ru.testit.management.utils.CodeSnippetUtils.tryUpdateLineWithSteps | ||
import ru.testit.management.utils.StringUtils | ||
import ru.testit.management.windows.tools.TmsNodeModel | ||
|
||
object JunitSnippet { | ||
const val JUNIT_CODE_SNIPPET = """ | ||
@WorkItemIds("globalId") | ||
@Test | ||
public void testName() { | ||
// See work item [globalId] for detailed steps description | ||
// Pre: | ||
// preconditions | ||
// Steps: | ||
// testSteps | ||
// Post: | ||
// postconditions | ||
} | ||
""" | ||
|
||
|
||
val comparator = { globalId: Long -> "@WorkItemIds(\"$globalId\")" } | ||
|
||
|
||
fun getNewSnippetJunit(userObject: Any): String { | ||
val model = userObject as TmsNodeModel | ||
val builder = StringBuilder() | ||
|
||
JUNIT_CODE_SNIPPET.lines().forEach { line -> | ||
var modifiedLine = line | ||
.replace("testName", | ||
StringUtils.spacesToCamelCase(getTestName(model))) | ||
.replace("globalId", model.globalId.toString()) | ||
|
||
modifiedLine = tryUpdateLineWithSteps(modifiedLine, model) | ||
|
||
if (modifiedLine.isNotBlank()) { | ||
builder.appendLine(modifiedLine) | ||
} | ||
} | ||
|
||
return builder.toString().trimIndent() | ||
} | ||
|
||
} |
52 changes: 52 additions & 0 deletions
52
src/main/kotlin/ru/testit/management/snippet/PytestSnippet.kt
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,52 @@ | ||
package ru.testit.management.snippet | ||
|
||
import ru.testit.management.utils.CodeSnippetUtils | ||
import ru.testit.management.utils.CodeSnippetUtils.getTestName | ||
import ru.testit.management.utils.CodeSnippetUtils.tryUpdateLineWithSteps | ||
import ru.testit.management.utils.StringUtils | ||
import ru.testit.management.windows.tools.TmsNodeModel | ||
|
||
object PytestSnippet { | ||
const val PYTEST_CODE_SNIPPET = """ | ||
@testit.externalId("externalId") | ||
@testit.displayName("displayName_") | ||
@testit.title("title_") | ||
@testit.description("description") | ||
@testit.workItemIds("globalId") | ||
def testName(): | ||
// See work item [globalId] for detailed steps description | ||
// Pre: | ||
// preconditions | ||
// Steps: | ||
// testSteps | ||
// Post: | ||
// postconditions | ||
""" | ||
|
||
val comparator = { globalId: Long -> "@testit.workItemIds(\"$globalId\")" } | ||
|
||
|
||
fun getNewSnippetPytest(userObject: Any): String { | ||
val model = userObject as TmsNodeModel | ||
val builder = StringBuilder() | ||
|
||
val testName = getTestName(model) | ||
PYTEST_CODE_SNIPPET.lines().forEach { line -> | ||
var modifiedLine = line | ||
.replace("testName", | ||
StringUtils.spacesToSnakeCase(testName)) | ||
.replace("globalId", model.globalId.toString()) | ||
.replace("title_", testName) | ||
.replace("displayName_", testName) | ||
|
||
modifiedLine = tryUpdateLineWithSteps(modifiedLine, model) | ||
|
||
if (modifiedLine.isNotBlank()) { | ||
builder.appendLine(modifiedLine) | ||
} | ||
} | ||
|
||
return builder.toString().trimIndent() | ||
} | ||
} |
Oops, something went wrong.