Cucumber Step data table implementation using hashes in typescript

Viewed 49

I've to automate below step using- step level data table methods of cucumber in WebdriverIO with TS. Both key and Values are the distinct elements exposed on UI. I've to write effective code for this cucumber step using typescript. I can't hardcode the values as they will keep changing on the basis of the EMI plan selected by user for any given transaction amount. For ex- if user selects 6 months plan for a 300 transaction value- the Fee will be 5% of EMI amount (i.e. 5% of 50) and same will be 10% for a 12 months plan, and Min pym= 50% of the rounded off value of EMI amount.

Then I see 'Confirm Plan' page with the details of the plan as selected
|key             |Value           |
|Trx amount      |$300.00         |
|Plan Length     |6 months        |
|EMI             |$52.50 per month|
|Refund Today    |$300.00         |
|Total fee       |$15.00          |
|Total repayable |$315.00         |
|Minimum Payment |$26.00 per month|

Can anyone please help me writing step definition for same, I'm very new to ts.

0 Answers
Related