Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.
 

Migration question


#1

We are using testrail with the custom config setup for separated steps where we are storing individual steps and the expected results and are we are trying to migrate test cases stored in CSV files, but when I change my filter file to use the new system name steps_seperated from steps in the array, I lose all my data on the import for the steps field.
This works for importing regular steps
$custom[‘steps’] = trim($row[5]);
This does not work for importing separated steps
$custom[‘steps_seperated’] = trim($row[5]);

Is this feature supported by the import/migration tool?
Thanks,
Devin
720-340-0439


#2

Hello Devin,

Thanks for your posting. Yes, separated steps are supported by the import and migration tool. Please see the examples\steps directory in the csv2testrail download for an example. It basically works as follows:

$custom['steps_separated'] = array('collection:step' => array( array('index' => 1, 'content' => $row[4]), array('index' => 2, 'content' => $row[5]), array('index' => 3, 'content' => $row[6]) ) );

Of course, it’s also possible to build the steps array dynamically. Please let me know in case you need any help with this.

Regards,
Tobias


#3

Is there a similar array structure and custom field used for separated expected results? I tried:

But they ended up blank… Thanks


#4

Hello Chris,

Thanks for your posting. You would need to use the following structure to import separate expected results for the Steps custom field:

$custom['expected_separated'] = array('collection:step' => array( array('index' => 1, 'content' => $row[4], 'expected' => 'Expected 1..'), array('index' => 2, 'content' => $row[5], 'expected' => 'Expected 2..'), array('index' => 3, 'content' => $row[6], 'expected' => 'Expected 3..') ) );

This assumes that you are trying to import both the standard description (‘content’) and expected result (‘expected’) for each step. This then looks as follows:

I hope this helps. Just let me know in case you want something different, I’m happy to explain how to set this up as well.

Regards,
Tobias


#5

Hello Tobias,
I have a problem regarding this topic here.

The csv2testrail import does not import my test cases properly when I’m using the steps_separated variant to add separated steps for test cases.
When I enter the imported test case and edit the details there are no steps added. It’s like the tool ignored it in some way!?

I used that code snippet here.

$custom['steps_separated'] = 
            array('collection:step' => 
                 array(
                     array('index' => 1, 'content' => $row[6]),
                     array('index' => 2, 'content' => $row[7]),
                     array('index' => 3, 'content' => $row[8])
                )
             );

When I’m importing all steps into one field

//$custom['steps'] = trim($row[6]);

everything is fine and is also displayed in the test case details under Steps as expected.

Do you have any idea what I have might be done wrong?
If you want I can also send you the files.

Thanks in advance!
Patrice


#6

Hello Patrice,

Thanks for your posting. For the separated steps, you first need to enable/configure the optional Steps custom field:

http://docs.gurock.com/testrail-faq/config-steps

Please let me know in case you have any questions about this.

Regards,
Tobias


#7

Hello Tobias,
I have already configured both steps_separated and step_results and applied them to all projects but still no change. I have also moved steps_separated above steps in the customization area but this order is just for the appearance in the UI.

label: Steps Separated
System Name: steps_separated
Type: Steps

I also set the normal steps field as active only for all other projects except my sample project and the steps separated field active only for the sample project but still no change.

Do I still miss something here?


#8

Hello Patrice,

Thanks for the additional details. We’ve sent you an email to take a look at your CSV file and conversion script.

Regards,
Tobias