From 7b1a3044d22e64b498b72172e3ca7567bb1d0d3d Mon Sep 17 00:00:00 2001 From: QDIBYS Date: Fri, 5 Jul 2024 14:37:10 +0200 Subject: [PATCH] Add bug resolution test --- .../cucumber/functional_tests/MainDefinitions.java | 8 +++++++- .../resources/features/do_we_export_numeric.feature | 11 +++++++++++ .../data/faf/data.diff.TESTFAF.20230911141652.xml | 2 +- 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 kraftwerk-functional-tests/src/test/resources/features/do_we_export_numeric.feature diff --git a/kraftwerk-functional-tests/src/test/java/cucumber/functional_tests/MainDefinitions.java b/kraftwerk-functional-tests/src/test/java/cucumber/functional_tests/MainDefinitions.java index 806ae6ed..818c1641 100644 --- a/kraftwerk-functional-tests/src/test/java/cucumber/functional_tests/MainDefinitions.java +++ b/kraftwerk-functional-tests/src/test/java/cucumber/functional_tests/MainDefinitions.java @@ -249,9 +249,15 @@ public void checkVariableValue(String idUE, String expectedValue, String variabl if (tableName == null || tableName.isEmpty()) tableName = Constants.ROOT_GROUP_NAME; + // Go to first datetime folder + Path executionOutDirectory = outDirectory.resolve(Objects.requireNonNull(new File(outDirectory.toString()).listFiles(File::isDirectory))[0].getName()); + + File outputReportingDataFile = new File(executionOutDirectory + "/" + outDirectory.getFileName() + "_" + tableName + ".csv"); + + // Get reader to read the root table written in outputs CSVReader csvReader = CsvUtils - .getReader(outputFiles.getOutputFolder().resolve(outputFiles.outputFileName(tableName))); + .getReader(outputReportingDataFile.toPath()); // get header String[] header = csvReader.readNext(); int idUEPosition = Arrays.asList(header).indexOf(Constants.ROOT_IDENTIFIER_NAME); diff --git a/kraftwerk-functional-tests/src/test/resources/features/do_we_export_numeric.feature b/kraftwerk-functional-tests/src/test/resources/features/do_we_export_numeric.feature new file mode 100644 index 00000000..db9bc9b2 --- /dev/null +++ b/kraftwerk-functional-tests/src/test/resources/features/do_we_export_numeric.feature @@ -0,0 +1,11 @@ +Feature: Do we save number format correctly ? + Everybody wants to know if we save them correctly + + Scenario Outline: Do we export large numbers in right format (without E) + Given Step 0 : We have some survey in directory "" + When Step 1 : We launch main service + Then Step 7 : We check that id "" has value "" for variable "" in table "" + Examples: + |Directory |SurveyUnitId |ExpectedValue |VariableName |TableName | + |SAMPLETEST-DATAONLY-v1 |0000005 |19800340 |T_NPIECES |RACINE | + diff --git a/kraftwerk-functional-tests/src/test/resources/functional_tests/in/SAMPLETEST-DATAONLY-v1/data/faf/data.diff.TESTFAF.20230911141652.xml b/kraftwerk-functional-tests/src/test/resources/functional_tests/in/SAMPLETEST-DATAONLY-v1/data/faf/data.diff.TESTFAF.20230911141652.xml index 47547a91..e8ad144a 100644 --- a/kraftwerk-functional-tests/src/test/resources/functional_tests/in/SAMPLETEST-DATAONLY-v1/data/faf/data.diff.TESTFAF.20230911141652.xml +++ b/kraftwerk-functional-tests/src/test/resources/functional_tests/in/SAMPLETEST-DATAONLY-v1/data/faf/data.diff.TESTFAF.20230911141652.xml @@ -2927,7 +2927,7 @@ - 5 + 19800340