From 054494677b55b397c98fe1f5891c9a0143f46117 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Mon, 8 Oct 2018 07:46:18 -0700 Subject: [PATCH] Added checkbox to automatically update AWS. --- tools/auto-tester/src/AWSInterface.cpp | 6 +++-- tools/auto-tester/src/AWSInterface.h | 3 ++- tools/auto-tester/src/Test.cpp | 4 +-- tools/auto-tester/src/Test.h | 2 +- tools/auto-tester/src/ui/AutoTester.cpp | 2 +- tools/auto-tester/src/ui/AutoTester.ui | 33 +++++++++++++++++-------- 6 files changed, 33 insertions(+), 17 deletions(-) diff --git a/tools/auto-tester/src/AWSInterface.cpp b/tools/auto-tester/src/AWSInterface.cpp index 28d6e8dcfa..51b7efcc15 100644 --- a/tools/auto-tester/src/AWSInterface.cpp +++ b/tools/auto-tester/src/AWSInterface.cpp @@ -21,14 +21,16 @@ AWSInterface::AWSInterface(QObject* parent) : QObject(parent) { _pythonCommand = _pythonInterface->getPythonCommand(); } -void AWSInterface::createWebPageFromResults(const QString& testResults, const QString& workingDirectory) { +void AWSInterface::createWebPageFromResults(const QString& testResults, + const QString& workingDirectory, + QCheckBox* updateAWSCheckBox) { _testResults = testResults; _workingDirectory = workingDirectory; extractTestFailuresFromZippedFolder(); createHTMLFile(); - if (QMessageBox::Yes == QMessageBox(QMessageBox::Information, "HTML has been created", "Do you want to update AWS?", QMessageBox::Yes | QMessageBox::No).exec()) { + if (updateAWSCheckBox->isChecked()) { updateAWS(); } } diff --git a/tools/auto-tester/src/AWSInterface.h b/tools/auto-tester/src/AWSInterface.h index b642315a0a..ebfc027345 100644 --- a/tools/auto-tester/src/AWSInterface.h +++ b/tools/auto-tester/src/AWSInterface.h @@ -11,6 +11,7 @@ #ifndef hifi_AWSInterface_h #define hifi_AWSInterface_h +#include #include #include @@ -23,7 +24,7 @@ class AWSInterface : public QObject { public: explicit AWSInterface(QObject* parent = 0); - void createWebPageFromResults(const QString& testResults, const QString& workingDirectory); + void createWebPageFromResults(const QString& testResults, const QString& workingDirectory, QCheckBox* updateAWSCheckBox); void extractTestFailuresFromZippedFolder(); void createHTMLFile(); diff --git a/tools/auto-tester/src/Test.cpp b/tools/auto-tester/src/Test.cpp index 659a3e3158..a150805bd2 100644 --- a/tools/auto-tester/src/Test.cpp +++ b/tools/auto-tester/src/Test.cpp @@ -1028,7 +1028,7 @@ void Test::setTestRailCreateMode(TestRailCreateMode testRailCreateMode) { _testRailCreateMode = testRailCreateMode; } -void Test::createWebPage() { +void Test::createWebPage(QCheckBox* updateAWSCheckBox) { QString testResults = QFileDialog::getOpenFileName(nullptr, "Please select the zipped test results to update from", nullptr, "Zipped Test Results (*.zip)"); if (testResults.isNull()) { @@ -1041,5 +1041,5 @@ void Test::createWebPage() { return; } - _awsInterface.createWebPageFromResults(testResults, tempDirectory); + _awsInterface.createWebPageFromResults(testResults, tempDirectory, updateAWSCheckBox); } \ No newline at end of file diff --git a/tools/auto-tester/src/Test.h b/tools/auto-tester/src/Test.h index 10cb779379..93e8ec249d 100644 --- a/tools/auto-tester/src/Test.h +++ b/tools/auto-tester/src/Test.h @@ -98,7 +98,7 @@ public: void setTestRailCreateMode(TestRailCreateMode testRailCreateMode); - void createWebPage(); + void createWebPage(QCheckBox* updateAWSCheckBox); private: QProgressBar* _progressBar; diff --git a/tools/auto-tester/src/ui/AutoTester.cpp b/tools/auto-tester/src/ui/AutoTester.cpp index 1cfe872662..1450d657cb 100644 --- a/tools/auto-tester/src/ui/AutoTester.cpp +++ b/tools/auto-tester/src/ui/AutoTester.cpp @@ -213,7 +213,7 @@ void AutoTester::on_createXMLScriptRadioButton_clicked() { } void AutoTester::on_createWebPagePushButton_clicked() { - _test->createWebPage(); + _test->createWebPage(_ui.updateAWSCheckBox); } void AutoTester::downloadFile(const QUrl& url) { diff --git a/tools/auto-tester/src/ui/AutoTester.ui b/tools/auto-tester/src/ui/AutoTester.ui index 956806e269..e551302f00 100644 --- a/tools/auto-tester/src/ui/AutoTester.ui +++ b/tools/auto-tester/src/ui/AutoTester.ui @@ -588,7 +588,7 @@ - 130 + 90 230 160 40 @@ -601,7 +601,7 @@ - 60 + 20 110 95 20 @@ -617,7 +617,7 @@ - 130 + 90 170 160 40 @@ -630,7 +630,7 @@ - 130 + 90 110 160 40 @@ -643,7 +643,7 @@ - 60 + 20 130 95 20 @@ -656,9 +656,9 @@ - 40 + -20 30 - 271 + 291 300 @@ -669,9 +669,9 @@ - 370 + 329 30 - 210 + 291 300 @@ -684,7 +684,7 @@ - 25 + 110 80 160 40 @@ -694,6 +694,19 @@ Create Web Page + + + + 20 + 92 + 81 + 17 + + + + Update AWS + + groupBox updateTestRailRunResultsButton