Skip to content

Commit

Permalink
Comments from Lukas v2
Browse files Browse the repository at this point in the history
Signed-off-by: Jakub Stejskal <[email protected]>
  • Loading branch information
Frawless committed Jul 1, 2024
1 parent 22c1454 commit 2418df8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@ And specify GitHub in your pom:
### Links to labels
Each label could be described in separated file with more details.
In case the files with name in format `<LABEL>.md` exists in directory `labels` in your test-docs path defined via `docsPath`, generator will link these files.
Anyone will be able to see the list of tests that covers a specific label.
Each test case documentation will allow to users to simply clink on label and see the label definition.
Anyone will be able to see the list of tests that covers a specific label.
Each test case documentation will allow to users to simply click on label and see its definition.

In case the file doesn't exist, a not fill be put right after the label name like that `clients (description file doesn't exist)`.
In case the file doesn't exist, the `(description file doesn't exist)` will be put right after the label. For example: `clients (description file doesn't exist)`.
This function is only part of mark-down docs generation.
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ public static void generate(Class<?> testClass, String docsDirPath, String class
// creating first level header for the test-suite
printWriter.println(Header.firstLevelHeader(testClass.getSimpleName()));

int numberOfDirs = classFilePath.length() - classFilePath.replace("/", "").length();
String labelsFilesPath = "../".repeat(numberOfDirs) + LABELS;
String labelsFilesPath = computePathToLabelFiles(classFilePath);

generateDocumentationForTestSuite(printWriter, labelsFilesPath, classFilePathFull, suiteDoc);
generateDocumentationForTestCases(printWriter, labelsFilesPath, classFilePathFull, methods);
Expand Down Expand Up @@ -334,4 +333,15 @@ public static void updateLinksInLabels(String docsPath) {
}
}
}

/**
* Compute a relative path to the directory that contains Labels description based on md doc file
*
* @param docFilePath
* @return relative path form doc file to labels directory
*/
private static String computePathToLabelFiles(String docFilePath) {
int numberOfDirs = docFilePath.length() - docFilePath.replace("/", "").length();
return "../".repeat(numberOfDirs) + LABELS;
}
}

0 comments on commit 2418df8

Please sign in to comment.