Data Driven Functional Tests - WebdriverIO Wednesdays
Front-end Testing with Kevin
Learn WebdriverIO: https://learn.webdriver.io
Sometimes you need to test the same flow with various inputs.
While you can write multiple it statements, one for each input, you can simplify this by using some JavaScript looping functionality.
In this video, I talk about how to do this, so that we can test out a password input validator.
Code for this episode: https://github.com/wdio-wed/data-driven-testing
Links: Array forEach Method: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach
String/Template Literals: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals
Data-Driven Tests in JavaScript Using Mocha https://booker.codes/data-driven-tests-in-javascript-using-mocha/
Codepen Password Validator https://codepen.io/klamping/full/RMmqvq/
Demo WebdriverIO Code http://try.learnwebdriverio.com/share/mYsWiM5xO72XZdVN ... https://www.youtube.com/watch?v=ph4lGUgeEmU
57754927 Bytes