I dynamically generate a div string based of user selection from a set of drop down values and input boxes.
Based of these choices, a string is output to the screen via outerHTML.
Example:
<div data-aggiefeed class="aggiefeed-element edus edus-container" data-num-activities="1" data-activity-source="asucd-rss" data-activity-actions data-content-limit data-no-activities-message id="aggieFeedEmbed" data-activity-action-social='["facebook"]'></div>
I want to create a test that checks if the created div tag contains the correct attributes that were chosen. How can I extract attributes from my created div tag and check if the values are equal to its corresponding ng-model? For some attributes, they do not contain a value and I need to simply check if it exists.
I have tried to convert the string into a JSON object but have little success.
I also do not want to check if the string contains a substring since this leaves room for error.
I am running my test using protractor.js.
Thanks.