ATF: Testing a custom service portal widget, using sn-atf-id within an ng-repeat

Jamsta1912
Tera Guru

Hi all,

 

I'm setting up an ATF test for a custom service portal widget, after watching the demo in the Creator Toolbox episode here: https://www.youtube.com/watch?v=ZaQmay-smOI&t=916s. The episode is quite old, but it still holds :).

 

I've added the sn-atf-id attribute to some components, and it's working fine in general. However, I have some components within ng-repeats where I'm assigning a value to sn-atf-id dynamically. 

 

So for instance, iterating over a collection of items like this:

ng-repeat="item in c.data.items track by item.sys_id" 
I'm setting a unique value for sn-atf-id for a checkbox bound to a property in each individual item object, like this:
<input type="checkbox" ng-model="item.isSelected" sn-atf-id="isSelectedCheckBox_{{item.sys_id}}">
 
I can see this works as expected, when I inspect the elements on the page. I see values for sn-atf-id like 'isSelectedCheckBox_36b291b2838996108234c480ceaad3ec'. However, when I create a test step 'Set Component Values (Custom UI)' and view the hover tips for the available components, the value for sn-atf-id does not show for those components withing the ng-repeat loop. It does show for the components with static values for sn-atf-id.
 
So my question is, is there a way to use ATF to test components within an ng-repeat like this, i.e. to get the components to show up for selection in the test step, with the value for sn-atf-id visible on hover?
 
Thank you
On this episode, join Brad Tilton and Lisa Holenstein as they dive into ATF and use the Page Inspector to create some custom UI tests. * 00:00 Start * 02:00 Introduction * 03:08 Use case scenario * 04:20 Testing a UI Page with the sn-atf-id attribute * 10:52 Using the page inspector on a Service ...
1 REPLY 1

CoffeeInMyVein
Tera Contributor

anyone tried this before? I have same scenario 

 create ATF for custom widget that has ng-repeat with button for each column in a portal in Servicenow