How to use check_update_jira method in lettuce-tools

Best Python code snippet using lettuce-tools_python

jira_config.py

Source:jira_config.py Github

copy

Full Screen

...130 data=json.dumps(payload))131 except:132 print(" No connection to Jira post, usign mock link")133 return True134 def check_update_jira(self):135 """136 Parse lettuce own arguments and include jira argument detection137 """138 parser = argparse.ArgumentParser()139 parser.add_argument("-v", "--verbosity",140 dest="verbosity",141 default=4,142 help='The verbosity level')143 parser.add_argument("-s", "--scenarios",144 dest="scenarios",145 default=None,146 help='Comma separated list of scenarios to run')147 parser.add_argument("-t", "--tag",148 dest="tags",149 default=None,150 action='append',151 help='Tells lettuce to run the specified tags only; '152 'can be used multiple times to define more tags'153 '(prefixing tags with "-" will exclude them and '154 'prefixing with "~" will match approximate words)')155 parser.add_argument("-r", "--random",156 dest="random",157 action="store_true",158 default=False,159 help="Run scenarios in a more random order to avoid interference")160 parser.add_argument("--with-xunit",161 dest="enable_xunit",162 action="store_true",163 default=False,164 help='Output JUnit XML test results to a file')165 parser.add_argument("--xunit-file",166 dest="xunit_file",167 default=None,168 type=str,169 help='Write JUnit XML to this file. Defaults to '170 'lettucetests.xml')171 parser.add_argument("--failfast",172 dest="failfast",173 default=False,174 action="store_true",175 help='Stop running in the first failure')176 parser.add_argument("--pdb",177 dest="auto_pdb",178 default=False,179 action="store_true",180 help='Launches an interactive debugger upon error')181 parser.add_argument('root')182 parser.add_argument('jira')183 args = parser.parse_args()184 return args185 def execute_testcase(self, test_id, status):186 """187 Create or updates TestCase executions in case Jira option is enabled188 """189 Jira = self.check_update_jira().jira190 if Jira: # Jira is enabled191 print ("Execute testcase " + test_id + " with status " + status)192 """Get last TestCase Execution id and status"""193 resp = self.session.get(self.server_base_url + "/issue/" + test_id, headers={'x-test2': 'true'}, \194 verify=False)195 data = json.loads(resp.content)196 testcase = data["fields"]["subtasks"].pop()197 testcase_exec = testcase["key"]198 testcase_exec_status = testcase["fields"]["status"]["name"]199 if testcase_exec_status != (status): # New execution status != Last execution status -> new tc execution200 #print "Different statuses: "+testcase_exec_status +" "+ status201 """Create new TestCase execution"""202 payload = {"transition": {"id": "31"}}203 resp = self.session.post(self.server_base_url + "/issue/" + test_id + \...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run lettuce-tools automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful