How to use _create_pickle_arguments method in Gherkin-python

Best Python code snippet using gherkin-python

compiler.py

Source:compiler.py Github

copy

Full Screen

...47 step_text = _interpolate(48 scenario_outline_step['text'],49 variable_cells,50 value_cells)51 arguments = _create_pickle_arguments(52 scenario_outline_step.get('argument'),53 variable_cells,54 value_cells)55 _pickle_step = {56 'text': step_text,57 'arguments': arguments,58 'locations': [59 _pickle_location(values['location']),60 _pickle_step_location(scenario_outline_step)61 ]62 }63 steps.append(_pickle_step)64 pickle = {65 'name': _interpolate(66 scenario_outline['name'],67 variable_cells,68 value_cells),69 'language': language,70 'steps': steps,71 'tags': _pickle_tags(tags),72 'locations': [73 _pickle_location(values['location']),74 _pickle_location(scenario_outline['location'])75 ]76 }77 pickles.append(pickle)78def _create_pickle_arguments(argument, variables, values):79 result = []80 if not argument:81 return result82 if argument['type'] == 'DataTable':83 table = {'rows': []}84 for row in argument['rows']:85 cells = [86 {87 'location': _pickle_location(cell['location']),88 'value': _interpolate(cell['value'], variables, values)89 } for cell in row['cells']90 ]91 table['rows'].append({'cells': cells})92 result.append(table)93 elif argument['type'] == 'DocString':94 docstring = {95 'location': _pickle_location(argument['location']),96 'content': _interpolate(argument['content'], variables, values)97 }98 if 'contentType' in argument:99 docstring['contentType'] = _interpolate(argument['contentType'], variables, values)100 result.append(docstring)101 else:102 raise Exception('Internal error')103 return result104def _interpolate(name, variable_cells, value_cells):105 for n, variable_cell in enumerate(variable_cells):106 value_cell = value_cells[n]107 name = re.sub(108 u'<{0[value]}>'.format(variable_cell),109 value_cell['value'],110 name111 )112 return name113def _pickle_steps(scenario_definition):114 return [_pickle_step(step)115 for step in scenario_definition['steps']]116def _pickle_step(step):117 return {118 'text': step['text'],119 'arguments': _create_pickle_arguments(120 step.get('argument'),121 [],122 []),123 'locations': [_pickle_step_location(step)]124 }125def _pickle_step_location(step):126 return {127 'line': step['location']['line'],128 'column': step['location']['column'] + count_symbols(step.get('keyword', 0))129 }130def _pickle_location(location):131 return {132 'line': location['line'],133 'column': location['column']...

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 Gherkin-python 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