mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 20:56:52 +02:00
Added user and branch - not tested yet!
This commit is contained in:
parent
a6dbeb3db7
commit
112ba27f2d
3 changed files with 21 additions and 20 deletions
|
@ -839,7 +839,7 @@ void Test::createTestRailTestSuite() {
|
||||||
}
|
}
|
||||||
|
|
||||||
TestSuiteCreator testSuiteCreator;
|
TestSuiteCreator testSuiteCreator;
|
||||||
testSuiteCreator.createTestSuite(testDirectory);
|
testSuiteCreator.createTestSuite(testDirectory, autoTester->getSelectedUser(), autoTester->getSelectedBranch());
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList Test::createListOfAll_imagesInDirectory(const QString& imageFormat, const QString& pathToImageDirectory) {
|
QStringList Test::createListOfAll_imagesInDirectory(const QString& imageFormat, const QString& pathToImageDirectory) {
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
|
|
||||||
void TestSuiteCreator::createTestSuite(const QString& testDirectory) {
|
void TestSuiteCreator::createTestSuite(const QString& testDirectory, const QString& user, const QString& branch) {
|
||||||
QDomProcessingInstruction instruction = document.createProcessingInstruction("xml", "version='1.0' encoding='UTF-8'");
|
QDomProcessingInstruction instruction = document.createProcessingInstruction("xml", "version='1.0' encoding='UTF-8'");
|
||||||
document.appendChild(instruction);
|
document.appendChild(instruction);
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ void TestSuiteCreator::createTestSuite(const QString& testDirectory) {
|
||||||
topLevelSection.appendChild(suiteName);
|
topLevelSection.appendChild(suiteName);
|
||||||
|
|
||||||
QDomElement secondLevelSections = document.createElement("sections");
|
QDomElement secondLevelSections = document.createElement("sections");
|
||||||
topLevelSection.appendChild(processDirectory(testDirectory, secondLevelSections));
|
topLevelSection.appendChild(processDirectory(testDirectory, user, branch, secondLevelSections));
|
||||||
|
|
||||||
topLevelSection.appendChild(secondLevelSections);
|
topLevelSection.appendChild(secondLevelSections);
|
||||||
root.appendChild(topLevelSection);
|
root.appendChild(topLevelSection);
|
||||||
|
@ -52,7 +52,7 @@ void TestSuiteCreator::createTestSuite(const QString& testDirectory) {
|
||||||
QMessageBox::information(0, "Success", "TestRail XML file has been created");
|
QMessageBox::information(0, "Success", "TestRail XML file has been created");
|
||||||
}
|
}
|
||||||
|
|
||||||
QDomElement TestSuiteCreator::processDirectory(const QString& directory, const QDomElement& element) {
|
QDomElement TestSuiteCreator::processDirectory(const QString& directory, const QString& user, const QString& branch, const QDomElement& element) {
|
||||||
QDomElement result = element;
|
QDomElement result = element;
|
||||||
|
|
||||||
// Loop over all entries in directory
|
// Loop over all entries in directory
|
||||||
|
@ -79,25 +79,23 @@ QDomElement TestSuiteCreator::processDirectory(const QString& directory, const Q
|
||||||
sectionElement.appendChild(sectionElementName);
|
sectionElement.appendChild(sectionElementName);
|
||||||
|
|
||||||
QDomElement testsElement = document.createElement("sections");
|
QDomElement testsElement = document.createElement("sections");
|
||||||
sectionElement.appendChild(processDirectory(nextDirectory, testsElement));
|
sectionElement.appendChild(processDirectory(nextDirectory, user, branch, testsElement));
|
||||||
|
|
||||||
result.appendChild(sectionElement);
|
result.appendChild(sectionElement);
|
||||||
} else {
|
} else if (objectName == "test.js" || objectName == "testStory.js") {
|
||||||
if (objectName == "test.js") {
|
QDomElement sectionElement = document.createElement("section");
|
||||||
QDomElement sectionElement = document.createElement("section");
|
QDomElement sectionElementName = document.createElement("name");
|
||||||
QDomElement sectionElementName = document.createElement("name");
|
sectionElementName.appendChild(document.createTextNode("all"));
|
||||||
sectionElementName.appendChild(document.createTextNode("all"));
|
sectionElement.appendChild(sectionElementName);
|
||||||
sectionElement.appendChild(sectionElementName);
|
sectionElement.appendChild(processTest(nextDirectory, objectName, user, branch, document.createElement("cases")));
|
||||||
sectionElement.appendChild(processTest(nextDirectory, objectName, document.createElement("cases")));
|
result.appendChild(sectionElement);
|
||||||
result.appendChild(sectionElement);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
QDomElement TestSuiteCreator::processTest(const QString& fullDirectory, const QString& test, const QDomElement& element) {
|
QDomElement TestSuiteCreator::processTest(const QString& fullDirectory, const QString& test, const QString& user, const QString& branch, const QDomElement& element) {
|
||||||
QDomElement result = element;
|
QDomElement result = element;
|
||||||
|
|
||||||
QDomElement caseElement = document.createElement("case");
|
QDomElement caseElement = document.createElement("case");
|
||||||
|
@ -177,13 +175,15 @@ QDomElement TestSuiteCreator::processTest(const QString& fullDirectory, const QS
|
||||||
precondsElement.appendChild(document.createTextNode("Tester is in an empty region of a domain in which they have edit rights\n\n*Note: Press 'n' to advance test script"));
|
precondsElement.appendChild(document.createTextNode("Tester is in an empty region of a domain in which they have edit rights\n\n*Note: Press 'n' to advance test script"));
|
||||||
customElement.appendChild(precondsElement);
|
customElement.appendChild(precondsElement);
|
||||||
|
|
||||||
|
QString testMDName = QString("https://github.com/") + user + "/hifi_tests/blob/" + branch + "/tests/content/entity/light/point/create/test.md";
|
||||||
|
|
||||||
QDomElement steps_seperatedElement = document.createElement("steps_separated");
|
QDomElement steps_seperatedElement = document.createElement("steps_separated");
|
||||||
QDomElement stepElement = document.createElement("step");
|
QDomElement stepElement = document.createElement("step");
|
||||||
QDomElement stepIndexElement = document.createElement("index");
|
QDomElement stepIndexElement = document.createElement("index");
|
||||||
stepIndexElement.appendChild(document.createTextNode("1"));
|
stepIndexElement.appendChild(document.createTextNode("1"));
|
||||||
stepElement.appendChild(stepIndexElement);
|
stepElement.appendChild(stepIndexElement);
|
||||||
QDomElement stepContentElement = document.createElement("content");
|
QDomElement stepContentElement = document.createElement("content");
|
||||||
stepContentElement.appendChild(document.createTextNode("Execute instructions in [THIS TEST](https://github.com/highfidelity/hifi_tests/blob/RC70/tests/content/entity/light/point/create/test.md)"));
|
stepContentElement.appendChild(document.createTextNode(QString("Execute instructions in [THIS TEST](") + testMDName + ")"));
|
||||||
stepElement.appendChild(stepContentElement);
|
stepElement.appendChild(stepContentElement);
|
||||||
QDomElement stepExpectedElement = document.createElement("expected");
|
QDomElement stepExpectedElement = document.createElement("expected");
|
||||||
stepExpectedElement.appendChild(document.createTextNode("Refer to the expected result in the linked description."));
|
stepExpectedElement.appendChild(document.createTextNode("Refer to the expected result in the linked description."));
|
||||||
|
@ -192,7 +192,7 @@ QDomElement TestSuiteCreator::processTest(const QString& fullDirectory, const QS
|
||||||
customElement.appendChild(steps_seperatedElement);
|
customElement.appendChild(steps_seperatedElement);
|
||||||
|
|
||||||
QDomElement notesElement = document.createElement("notes");
|
QDomElement notesElement = document.createElement("notes");
|
||||||
notesElement.appendChild(document.createTextNode("https://github.com/highfidelity/hifi_tests/blob/RC70/tests/content/entity/light/point/create/test.md"));
|
notesElement.appendChild(document.createTextNode(testMDName));
|
||||||
customElement.appendChild(notesElement);
|
customElement.appendChild(notesElement);
|
||||||
|
|
||||||
caseElement.appendChild(customElement);
|
caseElement.appendChild(customElement);
|
||||||
|
|
|
@ -17,9 +17,10 @@
|
||||||
|
|
||||||
class TestSuiteCreator {
|
class TestSuiteCreator {
|
||||||
public:
|
public:
|
||||||
void createTestSuite(const QString& testDirectory);
|
void createTestSuite(const QString& testDirectory, const QString& user, const QString& branch);
|
||||||
QDomElement processDirectory(const QString& directory, const QDomElement& element);
|
|
||||||
QDomElement processTest(const QString& fullDirectory, const QString& test, const QDomElement& element);
|
QDomElement processDirectory(const QString& directory, const QString& user, const QString& branch, const QDomElement& element);
|
||||||
|
QDomElement processTest(const QString& fullDirectory, const QString& test, const QString& user, const QString& branch, const QDomElement& element);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QDomDocument document;
|
QDomDocument document;
|
||||||
|
|
Loading…
Reference in a new issue