The CreatorCon Call for Content is officially open! Get started here.

ATF Test Steps Scope

mariavic1998
Tera Contributor

Hi Everyone, Ihave a test suite in the Global Scope but I need to change the whole test to another scope, for what I saw this would imply changing the XML for every step of every test into the test suite which is not very practical. Do you know if there is a way of doing this by scripting? I would really appreciate that, thank you in advance.

1 ACCEPTED SOLUTION

Diogo Ramos
Giga Sage
Giga Sage

Hello,

You can do it via script yes, but you will need to go to each ATF table you want to copy and enable the option Can create on the table config to true (for each table required):

DiogoRamos_0-1738958936654.png

Then after doing it for all atf related tables, you can then switch to your scope. And go to background scripts make sure you run the script on the wanted scope, and you can just use something like : 

var grSATS = new GlideRecord('sys_atf_test_suite');
if (grSATS.get('1106a3193b3902108b6c118aa4e45aca')) {
var newSuiteId = grSATS.insert(); // save this value to be used for other tables
}

// Then for each test (sys_atf_test) in the suite do an insert chaging the parent field to the value above
// Then for each step (sys_atf_step_list)  in the test changing the field test to be the one inserted above


I hope it works.

Cheers
Diogo

View solution in original post

1 REPLY 1

Diogo Ramos
Giga Sage
Giga Sage

Hello,

You can do it via script yes, but you will need to go to each ATF table you want to copy and enable the option Can create on the table config to true (for each table required):

DiogoRamos_0-1738958936654.png

Then after doing it for all atf related tables, you can then switch to your scope. And go to background scripts make sure you run the script on the wanted scope, and you can just use something like : 

var grSATS = new GlideRecord('sys_atf_test_suite');
if (grSATS.get('1106a3193b3902108b6c118aa4e45aca')) {
var newSuiteId = grSATS.insert(); // save this value to be used for other tables
}

// Then for each test (sys_atf_test) in the suite do an insert chaging the parent field to the value above
// Then for each step (sys_atf_step_list)  in the test changing the field test to be the one inserted above


I hope it works.

Cheers
Diogo