From 99ba550af5eb7b37e66c487df88c28242137e347 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Thu, 26 Jul 2018 15:00:02 -0700 Subject: [PATCH] WIP --- tools/auto-tester/src/TestRailInterface.cpp | 6 ++- .../src/ui/TestRailSelectorWindow.cpp | 16 ++++++-- .../src/ui/TestRailSelectorWindow.h | 3 ++ .../src/ui/TestRailSelectorWindow.ui | 37 +++++++++++++++++-- 4 files changed, 55 insertions(+), 7 deletions(-) diff --git a/tools/auto-tester/src/TestRailInterface.cpp b/tools/auto-tester/src/TestRailInterface.cpp index 7077b02aac..948da59947 100644 --- a/tools/auto-tester/src/TestRailInterface.cpp +++ b/tools/auto-tester/src/TestRailInterface.cpp @@ -160,6 +160,10 @@ void TestRailInterface::createAddSectionsPythonScript(const QString& outputDirec stream << "client.user = \'" << _user << "\'\n"; stream << "client.password = \'" << _password << "\'\n\n"; + // top-level section + stream << "data = { \'name\': \'" + << "Test Suite - " << QDateTime::currentDateTime().toString("yyyy-MM-ddTHH:mm") << "\'}\n"; + file.close(); } @@ -188,7 +192,7 @@ void TestRailInterface::createTestSuitePython(const QString& testDirectory, QDomElement topLevelSection = _document.createElement("section"); QDomElement suiteName = _document.createElement("name"); - suiteName.appendChild(_document.createTextNode("Test Suite - " + QDateTime::currentDateTime().toString())); + suiteName.appendChild(_document.createTextNode("Test Suite - " + QDateTime::currentDateTime().toString("yyyy-MM-ddTHH:mm"))); topLevelSection.appendChild(suiteName); QDomElement secondLevelSections = _document.createElement("sections"); diff --git a/tools/auto-tester/src/ui/TestRailSelectorWindow.cpp b/tools/auto-tester/src/ui/TestRailSelectorWindow.cpp index ff3cf05ed4..b7232837c8 100644 --- a/tools/auto-tester/src/ui/TestRailSelectorWindow.cpp +++ b/tools/auto-tester/src/ui/TestRailSelectorWindow.cpp @@ -15,6 +15,8 @@ TestRailSelectorWindow::TestRailSelectorWindow(QWidget *parent) { setupUi(this); + + projectLineEdit->setValidator(new QIntValidator(1, 999, this)); } void TestRailSelectorWindow::on_OKButton_clicked() { @@ -40,13 +42,21 @@ QString TestRailSelectorWindow::getURL() { } void TestRailSelectorWindow::setUser(const QString& user) { - UserTextEdit->setText(user); + userTextEdit->setText(user); } QString TestRailSelectorWindow::getUser() { - return UserTextEdit->toPlainText(); + return userTextEdit->toPlainText(); } QString TestRailSelectorWindow::getPassword() { return passwordLineEdit->text(); -} \ No newline at end of file +} + +void TestRailSelectorWindow::setProject(const int project) { + projectLineEdit->setText(QString::number(project)); +} + +int TestRailSelectorWindow::getProject() { + return projectLineEdit->getText().toInt(); +} diff --git a/tools/auto-tester/src/ui/TestRailSelectorWindow.h b/tools/auto-tester/src/ui/TestRailSelectorWindow.h index 587e3401b8..821102b6bc 100644 --- a/tools/auto-tester/src/ui/TestRailSelectorWindow.h +++ b/tools/auto-tester/src/ui/TestRailSelectorWindow.h @@ -28,6 +28,9 @@ public: QString getPassword(); + void setProject(const int project); + int getProject(); + bool userCancelled{ false }; private slots: diff --git a/tools/auto-tester/src/ui/TestRailSelectorWindow.ui b/tools/auto-tester/src/ui/TestRailSelectorWindow.ui index e05e2b6370..dfc477deb0 100644 --- a/tools/auto-tester/src/ui/TestRailSelectorWindow.ui +++ b/tools/auto-tester/src/ui/TestRailSelectorWindow.ui @@ -81,7 +81,7 @@ 120 - 200 + 240 93 28 @@ -94,7 +94,7 @@ 280 - 200 + 240 93 28 @@ -116,7 +116,7 @@ QLineEdit::Password - + 200 @@ -144,6 +144,37 @@ TestRail User + + + + 200 + 160 + 231 + 24 + + + + QLineEdit::Normal + + + + + + 70 + 160 + 121 + 20 + + + + + 10 + + + + TestRail Project + +