Commit bd4ee7ad authored by Andrea Il Grande's avatar Andrea Il Grande
Browse files

Modified documentation generation for Distributed Operations tests (Removed when and then)

parent 09a1dbb9
Loading
Loading
Loading
Loading
+43 −29
Original line number Diff line number Diff line
@@ -273,6 +273,7 @@ class GenerateRobotData:
                                                                 request=request,
                                                                 params=params)
        
        if 'dist-ops' not in self.test_cases[index]['tags']:
            self.test_cases[index]['when'] = self.robot.generate_when_content(http_verb=self.test_cases[index]['http_verb'],
                                                                            endpoint=self.test_cases[index]['endpoint'],
                                                                            when=self.test_cases[index]['when'])
@@ -447,6 +448,8 @@ class GenerateRobotData:
            documentation = test.doc

        # Get the Content-Type and Body associated to the Test
        # We need to check if the test is in the DistributedOperations group
        if 'dist-ops' not in tags:
            if len(self.args) != 0:
                # We are talking about Test Cases with Test Template, so we need to check the keyword content with the
                # definition of the template
@@ -475,6 +478,17 @@ class GenerateRobotData:
                'then': then,
                'when': when
            }
        else:
            # If the test case is about DistributedOperations we don't want 'when' and 'this' in the generated documentation
            test_case = {
                'name': test.name,
                'permutation_tp_id': f'{self.base_TP_id}/{test.name.split(" ")[0]}',
                'doc': documentation,
                'tags': tags,
                'setup': test.setup.name,
                'teardown': test.teardown.name,
                'template': test.template,
            }

        try:
            self.test_suite['initial_condition'] = self.initial_conditions[test.setup.name]