Git Product home page Git Product logo

testrail-migrate's Issues

Php version to run the script and convertible file location

Hello!
I've been trying to use your script with php 7.1.7 and got an error message

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Markdownify has a deprecated constructor in C:\distr\testrail-migrate-testlink-1.9\testrail-migrate-testlink\lib\markdownify\markdownify.php on line 58

So, please, tell in which version of php script will work or tell what do i havу to fix in it.
Also i've got a problem with location of convertible file - where should it be located. I've put it in the directory where script is, but got an error message

File 1.xml not found

TestLink 1.9 script fails to handle testsuite->testcase case

TestLink export files typically have the following structure:

<testsuite name="Top-Level Suite">
  <testsuite name="Sub-Suite">
    <testcase internalid="12345"
              name="Test Case Name">
...

However, they can also have this structure:

<testsuite name="Top-Level Suite">
  <testcase internalid="12345"
            name="Test Case Name">
...

The migration script appears to handle the former case correctly but not the latter. In the latter case, I get a file with sections but no test cases. I can get the test cases to export by changing write_sections to:

function write_sections($handle, $sections)
{
	xml_write_opening_tag($handle, 'sections');

	foreach ($sections as $section)
	{
		// New code
		if ($section->getName() == 'testcase')
		{
			write_case($handle, $section);
		}
		// End of new code
		else
		{
			write_section($handle, $section);
		}
	}

	xml_write_closing_tag($handle, 'sections');
}

However, that generates an invalid TestRail file as there's no section element. I've fixed that for my case by manually adding a section named "Test Cases" and a cases element inside that, but my PHP isn't good enough to fully fix the script.

Testcase migration from TestLink 1.9.20

Hi.

I'm trying to migrate a testsuite from Testlink 1.9.20 to TestRail 7.0.2.1016 and have tried out this project. I noticed that this project hasn't been updated since 2014 and was wondering if this could explain the errors that I'm seeing:

Fatal error: Uncaught Error: Attempt to assign property "html" on null in /app/public/lib/markdownify/markdownify.php on line 151

Error: Attempt to assign property "html" on null in /app/public/lib/markdownify/markdownify.php on line 151

Call Stack:
    0.0009     427464   1. {main}() /app/public/testlink2testrail.php:0
    0.0305     628360   2. write_output($handle = resource(8) of type (stream), $dom = class SimpleXMLElement { public $@attributes = ['id' => '', 'name' => '']; public $node_order = class SimpleXMLElement {  }; public $details = class SimpleXMLElement {  }; public $testsuite = [0 => class SimpleXMLElement { ... }, 1 => class SimpleXMLElement { ... }, 2 => class SimpleXMLElement { ... }, 3 => class SimpleXMLElement { ... }, 4 => class SimpleXMLElement { ... }, 5 => class SimpleXMLElement { ... }, 6 => class SimpleXMLElement { ... }, 7 => class SimpleXMLElement { ... }, 8 => class SimpleXMLElement { ... }] }) /app/public/testlink2testrail.php:283
    0.0307     628360   3. write_sections($handle = resource(8) of type (stream), $sections = class SimpleXMLElement { public $@attributes = ['id' => '', 'name' => '']; public $node_order = class SimpleXMLElement {  }; public $details = class SimpleXMLElement {  }; public $testsuite = [0 => class SimpleXMLElement { ... }, 1 => class SimpleXMLElement { ... }, 2 => class SimpleXMLElement { ... }, 3 => class SimpleXMLElement { ... }, 4 => class SimpleXMLElement { ... }, 5 => class SimpleXMLElement { ... }, 6 => class SimpleXMLElement { ... }, 7 => class SimpleXMLElement { ... }, 8 => class SimpleXMLElement { ... }] }) /app/public/testlink2testrail.php:131
    0.0308     628640   4. write_section($handle = resource(8) of type (stream), $section = class SimpleXMLElement { public $@attributes = ['id' => '1136', 'name' => '1. Miljøkrav']; public $node_order = class SimpleXMLElement {  }; public $details = class SimpleXMLElement {  }; public $testcase = [0 => class SimpleXMLElement { ... }, 1 => class SimpleXMLElement { ... }, 2 => class SimpleXMLElement { ... }, 3 => class SimpleXMLElement { ... }, 4 => class SimpleXMLElement { ... }, 5 => class SimpleXMLElement { ... }, 6 => class SimpleXMLElement { ... }, 7 => class SimpleXMLElement { ... }, 8 => class SimpleXMLElement { ... }] }) /app/public/testlink2testrail.php:141
    0.0310     628848   5. write_cases($handle = resource(8) of type (stream), $cases = class SimpleXMLElement { public $@attributes = ['internalid' => '1141', 'name' => 'Installation af IBC NM i Windows 10']; public $node_order = class SimpleXMLElement {  }; public $externalid = class SimpleXMLElement {  }; public $fullexternalid = class SimpleXMLElement {  }; public $version = class SimpleXMLElement {  }; public $summary = class SimpleXMLElement {  }; public $preconditions = class SimpleXMLElement {  }; public $execution_type = class SimpleXMLElement {  }; public $importance = class SimpleXMLElement {  }; 
public $estimated_exec_duration = class SimpleXMLElement {  }; public $status = '7'; public $is_open = '0'; public $active = '1'; public $steps = class SimpleXMLElement { public $step = [...] }; public $requirements = class SimpleXMLElement { public $requirement = class SimpleXMLElement { ... } } }) /app/public/testlink2testrail.php:241
    0.0311     629128   6. write_case($handle = resource(8) of type (stream), $case = class SimpleXMLElement { public $@attributes = ['internalid' => '1141', 'name' => 'Installation af IBC NM i Windows 10']; public $node_order = class SimpleXMLElement {  }; public $externalid = class SimpleXMLElement {  }; public $fullexternalid = class SimpleXMLElement {  }; public $version = class SimpleXMLElement {  }; public $summary = class SimpleXMLElement {  }; public $preconditions = class SimpleXMLElement {  }; public $execution_type = class SimpleXMLElement {  }; public $importance = class SimpleXMLElement {  }; public $estimated_exec_duration = class SimpleXMLElement {  }; public $status = '7'; public $is_open = '0'; public $active = '1'; public $steps = class SimpleXMLElement { public $step = [...] }; public $requirements = class SimpleXMLElement { public $requirement = class SimpleXMLElement { ... } } }) /app/public/testlink2testrail.php:154
    0.0314     629520   7. xml_write_html_tag($handle = resource(8) of type (stream), $tag = 'preconds', $value = class SimpleXMLElement { public $0 = class SimpleXMLElement {  } }) /app/public/testlink2testrail.php:180
    0.0314     629520   8. html_to_markdown($html = class SimpleXMLElement { public $0 = class SimpleXMLElement {  } }) /app/public/testlink2testrail.php:112
    0.0314     630568   9. Markdownify->parseString($html = '<p>Der skal eksistere en instruks til installation af IBC-NM</p>') /app/public/testlink2testrail.php:254

Regards,
Thomas

Converted only sections but not cases

tried to convert exported XML from TestLink 1.9.16 to test rail format
But converted test cases as sections, without steps and other information

input and output files here
files.zip

Console:

`PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /Users/macbook/Library/CloudStorage/.com/Мій диск/IBS/POC/testrail-migrate-master/testlink-1.9/lib/markdownify/markdownify.php on line 294

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /Users/macbook/Library/CloudStorage/.com/Мій диск/IBS/POC/testrail-migrate-master/testlink-1.9/lib/markdownify/markdownify.php on line 294
Successfully converted 13 sections and 0 cases
macbook@Macbooks-MacBook-Pro testlink-1.9 % php testlink2testrail.php STK003.xml test.rail.TC2.xml

PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /Users/macbook/Library/CloudStorage/.com/Мій диск/IBS/POC/testrail-migrate-master/testlink-1.9/lib/markdownify/markdownify.php on line 294

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /Users/macbook/Library/CloudStorage/.com/Мій диск/IBS/POC/testrail-migrate-master/testlink-1.9/lib/markdownify/markdownify.php on line 294
Successfully converted 3 sections and 0 cases`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.