import csv



print('''# TEST plan

### Test purpose

1. Validation on the input data and display appropriate error messages

1. Test Plan with test cases and test results.''')
print('\n')
print('\n')
print('\n')

# read a csv file named test.csv
with open('test.csv', 'r') as f:

  # creating a csv reader object
  csvreader = csv.reader(f)

  # extracting each data row one by one
  for row in csvreader:

    print(f'### Test #{row[0]}')
    print('\n')
    print(f'| del me | del me  |')
    print(f'| ----- | -----  |')
    print(f'| Test Case Name | {row[1]}  |')
    print(f'| Procedure | {row[2].replace("<br />",'\\n')}  |')
    print(f'| Expected Output | {row[3].replace("<br />",'\\n')}  |')
    print(f'| Result | {row[4].replace("<br />",'\\n')}  |')
    print('\n')
    print("### Screen capture")
    print( '\n'.join([ (f'\n#### step {i+1} screenshot\n'+x.strip())  for i, x in enumerate(row[5].split("<br />"))]) )
    print('\n')
    print('\n')

