How do we simulate user behavior in automated tests?


With automating tests for our web applications, how do we simulate a user interacting with the application?


The response to this question reiterates a good practice we’ve come across already: carefully organizing the content and styling of our web apps using classes and ids. By organizing our applications in this way, the portions of the app that our users should interact with, or that change due to user interaction, will be carefully labeled so that we can seamlessly interact with these aspects directly from JavaScript. Because our tests will also be written in JavaScript, it’s mostly trivial to simulate user actions by checking the values within and/or inserting new values for these labeled ascpects of the app.