Added checkbox to automatically update AWS.

This commit is contained in:
NissimHadar 2018-10-08 07:46:18 -07:00
parent 138ca76d1c
commit 054494677b
6 changed files with 33 additions and 17 deletions

View file

@ -21,14 +21,16 @@ AWSInterface::AWSInterface(QObject* parent) : QObject(parent) {
_pythonCommand = _pythonInterface->getPythonCommand(); _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; _testResults = testResults;
_workingDirectory = workingDirectory; _workingDirectory = workingDirectory;
extractTestFailuresFromZippedFolder(); extractTestFailuresFromZippedFolder();
createHTMLFile(); 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(); updateAWS();
} }
} }

View file

@ -11,6 +11,7 @@
#ifndef hifi_AWSInterface_h #ifndef hifi_AWSInterface_h
#define hifi_AWSInterface_h #define hifi_AWSInterface_h
#include <QCheckBox>
#include <QObject> #include <QObject>
#include <QTextStream> #include <QTextStream>
@ -23,7 +24,7 @@ class AWSInterface : public QObject {
public: public:
explicit AWSInterface(QObject* parent = 0); 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 extractTestFailuresFromZippedFolder();
void createHTMLFile(); void createHTMLFile();

View file

@ -1028,7 +1028,7 @@ void Test::setTestRailCreateMode(TestRailCreateMode testRailCreateMode) {
_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, QString testResults = QFileDialog::getOpenFileName(nullptr, "Please select the zipped test results to update from", nullptr,
"Zipped Test Results (*.zip)"); "Zipped Test Results (*.zip)");
if (testResults.isNull()) { if (testResults.isNull()) {
@ -1041,5 +1041,5 @@ void Test::createWebPage() {
return; return;
} }
_awsInterface.createWebPageFromResults(testResults, tempDirectory); _awsInterface.createWebPageFromResults(testResults, tempDirectory, updateAWSCheckBox);
} }

View file

@ -98,7 +98,7 @@ public:
void setTestRailCreateMode(TestRailCreateMode testRailCreateMode); void setTestRailCreateMode(TestRailCreateMode testRailCreateMode);
void createWebPage(); void createWebPage(QCheckBox* updateAWSCheckBox);
private: private:
QProgressBar* _progressBar; QProgressBar* _progressBar;

View file

@ -213,7 +213,7 @@ void AutoTester::on_createXMLScriptRadioButton_clicked() {
} }
void AutoTester::on_createWebPagePushButton_clicked() { void AutoTester::on_createWebPagePushButton_clicked() {
_test->createWebPage(); _test->createWebPage(_ui.updateAWSCheckBox);
} }
void AutoTester::downloadFile(const QUrl& url) { void AutoTester::downloadFile(const QUrl& url) {

View file

@ -588,7 +588,7 @@
<widget class="QPushButton" name="updateTestRailRunResultsButton"> <widget class="QPushButton" name="updateTestRailRunResultsButton">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>130</x> <x>90</x>
<y>230</y> <y>230</y>
<width>160</width> <width>160</width>
<height>40</height> <height>40</height>
@ -601,7 +601,7 @@
<widget class="QRadioButton" name="createPythonScriptRadioButton"> <widget class="QRadioButton" name="createPythonScriptRadioButton">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>60</x> <x>20</x>
<y>110</y> <y>110</y>
<width>95</width> <width>95</width>
<height>20</height> <height>20</height>
@ -617,7 +617,7 @@
<widget class="QPushButton" name="createTestRailRunButton"> <widget class="QPushButton" name="createTestRailRunButton">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>130</x> <x>90</x>
<y>170</y> <y>170</y>
<width>160</width> <width>160</width>
<height>40</height> <height>40</height>
@ -630,7 +630,7 @@
<widget class="QPushButton" name="createTestRailTestCasesButton"> <widget class="QPushButton" name="createTestRailTestCasesButton">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>130</x> <x>90</x>
<y>110</y> <y>110</y>
<width>160</width> <width>160</width>
<height>40</height> <height>40</height>
@ -643,7 +643,7 @@
<widget class="QRadioButton" name="createXMLScriptRadioButton"> <widget class="QRadioButton" name="createXMLScriptRadioButton">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>60</x> <x>20</x>
<y>130</y> <y>130</y>
<width>95</width> <width>95</width>
<height>20</height> <height>20</height>
@ -656,9 +656,9 @@
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="groupBox">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>40</x> <x>-20</x>
<y>30</y> <y>30</y>
<width>271</width> <width>291</width>
<height>300</height> <height>300</height>
</rect> </rect>
</property> </property>
@ -669,9 +669,9 @@
<widget class="QGroupBox" name="groupBox_2"> <widget class="QGroupBox" name="groupBox_2">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>370</x> <x>329</x>
<y>30</y> <y>30</y>
<width>210</width> <width>291</width>
<height>300</height> <height>300</height>
</rect> </rect>
</property> </property>
@ -684,7 +684,7 @@
</property> </property>
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>25</x> <x>110</x>
<y>80</y> <y>80</y>
<width>160</width> <width>160</width>
<height>40</height> <height>40</height>
@ -694,6 +694,19 @@
<string>Create Web Page</string> <string>Create Web Page</string>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" name="updateAWSCheckBox">
<property name="geometry">
<rect>
<x>20</x>
<y>92</y>
<width>81</width>
<height>17</height>
</rect>
</property>
<property name="text">
<string>Update AWS</string>
</property>
</widget>
</widget> </widget>
<zorder>groupBox</zorder> <zorder>groupBox</zorder>
<zorder>updateTestRailRunResultsButton</zorder> <zorder>updateTestRailRunResultsButton</zorder>