Add HostName to Test Run name.

This commit is contained in:
NissimHadar 2018-09-28 15:35:09 -07:00
parent 574be7614c
commit 7d60c4c850

View file

@ -16,6 +16,7 @@
#include <QDateTime> #include <QDateTime>
#include <QFile> #include <QFile>
#include <QHostInfo>
#include <QMessageBox> #include <QMessageBox>
#include <QTextStream> #include <QTextStream>
@ -46,7 +47,6 @@ QString TestRailInterface::getObject(const QString& path) {
return path.right(path.length() - path.lastIndexOf("/") - 1); return path.right(path.length() - path.lastIndexOf("/") - 1);
} }
bool TestRailInterface::setPythonCommand() { bool TestRailInterface::setPythonCommand() {
if (QProcessEnvironment::systemEnvironment().contains("PYTHON_PATH")) { if (QProcessEnvironment::systemEnvironment().contains("PYTHON_PATH")) {
QString _pythonPath = QProcessEnvironment::systemEnvironment().value("PYTHON_PATH"); QString _pythonPath = QProcessEnvironment::systemEnvironment().value("PYTHON_PATH");
@ -478,8 +478,8 @@ void TestRailInterface::addRun() {
stream << "\tcase_ids.append(case['id'])\n\n"; stream << "\tcase_ids.append(case['id'])\n\n";
// Now, we can create the run // Now, we can create the run
stream << "data = { 'name': '" + _sectionNames[_testRailRunSelectorWindow.getSectionID()].replace("Section", "Run") + stream << "data = { 'name': '" + _sectionNames[_testRailRunSelectorWindow.getSectionID()].replace("Section", "Run") + "[" +
"', 'suite_id': " + _suiteID + QHostInfo::localHostName() + "]" + "', 'suite_id': " + _suiteID +
", 'include_all': False, 'case_ids': case_ids}\n"; ", 'include_all': False, 'case_ids': case_ids}\n";
stream << "run = client.send_post('add_run/" + _projectID + "', data)\n"; stream << "run = client.send_post('add_run/" + _projectID + "', data)\n";
@ -1028,7 +1028,6 @@ void TestRailInterface::processTestPython(const QString& fullDirectory,
QString testContent = QString("Execute instructions in [THIS TEST](") + testMDName + ")"; QString testContent = QString("Execute instructions in [THIS TEST](") + testMDName + ")";
QString testExpected = QString("Refer to the expected result in the linked description."); QString testExpected = QString("Refer to the expected result in the linked description.");
stream << "data = {\n" stream << "data = {\n"
<< "\t'title': '" << title << "',\n" << "\t'title': '" << title << "',\n"
<< "\t'template_id': 2,\n" << "\t'template_id': 2,\n"