Added "Download APK" push-button.

This commit is contained in:
NissimHadar 2019-01-24 12:01:00 -08:00
parent e87d5abbd7
commit 64843b5ed2
5 changed files with 78 additions and 14 deletions

View file

@ -38,7 +38,7 @@ Nitpick::Nitpick(QWidget* parent) : QMainWindow(parent) {
_ui.statusLabel->setText("");
_ui.plainTextEdit->setReadOnly(true);
setWindowTitle("Nitpick - v2.0.0");
setWindowTitle("Nitpick - v2.0.1");
}
Nitpick::~Nitpick() {
@ -88,7 +88,7 @@ void Nitpick::setup() {
if (_testRunnerDesktop) {
delete _testRunnerDesktop;
}
_testRunnerDesktop = new TestRunnerDesktop(dayCheckboxes, timeEditCheckboxes, timeEdits, _ui.workingFolderRunOnDesktopLabel, _ui.checkBoxServerless, _ui.checkBoxRunLatest, _ui.urlLineEdit, _ui.runNowButton);
_testRunnerDesktop = new TestRunnerDesktop(dayCheckboxes, timeEditCheckboxes, timeEdits, _ui.workingFolderRunOnDesktopLabel, _ui.checkBoxServerless, _ui.runLatestOnDesktopCheckBox, _ui.urlOnDesktopLineEdit, _ui.runNowButton);
if (_testRunnerMobile) {
delete _testRunnerMobile;
@ -178,8 +178,8 @@ void Nitpick::on_runNowButton_clicked() {
_testRunnerDesktop->run();
}
void Nitpick::on_checkBoxRunLatest_clicked() {
_ui.urlLineEdit->setEnabled(!_ui.checkBoxRunLatest->isChecked());
void Nitpick::on_runLatestOnDesktopCheckBox_clicked() {
_ui.urlOnDesktopLineEdit->setEnabled(!_ui.runLatestOnDesktopCheckBox->isChecked());
}
void Nitpick::automaticTestRunEvaluationComplete(QString zippedFolderName, int numberOfFailures) {
@ -323,6 +323,7 @@ void Nitpick::appendLogWindow(const QString& message) {
_ui.plainTextEdit->appendPlainText(message);
}
// Test on Mobile
void Nitpick::on_setWorkingFolderRunOnMobileButton_clicked() {
_testRunnerMobile->setWorkingFolderAndEnableControls();
}
@ -331,6 +332,14 @@ void Nitpick::on_connectDeviceButton_clicked() {
_testRunnerMobile->connectDevice();
}
void Nitpick::on_runLatestOnMobileCheckBox_clicked() {
_ui.urlOnMobileLineEdit->setEnabled(!_ui.runLatestOnMobileCheckBox->isChecked());
}
void Nitpick::on_downloadAPKButton_clicked() {
_testRunnerMobile->downloadAPK();
}
void Nitpick::on_pullFolderButton_clicked() {
_testRunnerMobile->pullFolder();
}

View file

@ -55,6 +55,8 @@ public:
void appendLogWindow(const QString& message);
private slots:
void on_closeButton_clicked();
void on_tabWidget_currentChanged(int index);
void on_evaluateTestsButton_clicked();
@ -76,7 +78,7 @@ private slots:
void on_setWorkingFolderRunOnDesktopButton_clicked();
void on_runNowButton_clicked();
void on_checkBoxRunLatest_clicked();
void on_runLatestOnDesktopCheckBox_clicked();
void on_updateTestRailRunResultsButton_clicked();
@ -88,15 +90,16 @@ private slots:
void on_createWebPagePushButton_clicked();
void on_closeButton_clicked();
void saveFile(int index);
void about();
void content();
// Run on Mobile controls
void on_setWorkingFolderRunOnMobileButton_clicked();
void on_connectDeviceButton_clicked();
void on_runLatestOnMobileCheckBox_clicked();
void on_downloadAPKButton_clicked();
void on_pullFolderButton_clicked();
private:

View file

@ -98,6 +98,9 @@ void TestRunnerMobile::connectDevice() {
}
}
void TestRunnerMobile::downloadAPK() {
}
void TestRunnerMobile::pullFolder() {
QString command = _adbCommand + " pull " + _folderLineEdit->text() + " " + _workingFolder + " >" + _workingFolder + "/pullOutput.txt";
int result = system(command.toStdString().c_str());

View file

@ -33,6 +33,7 @@ public:
void setWorkingFolderAndEnableControls();
void connectDevice();
void downloadAPK();
void pullFolder();
private:

View file

@ -501,7 +501,7 @@
<bool>false</bool>
</property>
</widget>
<widget class="QCheckBox" name="checkBoxRunLatest">
<widget class="QCheckBox" name="runLatestOnDesktopCheckBox">
<property name="geometry">
<rect>
<x>20</x>
@ -533,7 +533,7 @@
<string>URL</string>
</property>
</widget>
<widget class="QLineEdit" name="urlLineEdit">
<widget class="QLineEdit" name="urlOnDesktopLineEdit">
<property name="enabled">
<bool>false</bool>
</property>
@ -549,7 +549,7 @@
</widget>
<widget class="QWidget" name="tab_5">
<attribute name="title">
<string>Test on Device</string>
<string>Test on Mobile</string>
</attribute>
<widget class="QPushButton" name="connectDeviceButton">
<property name="enabled">
@ -613,7 +613,7 @@
<property name="geometry">
<rect>
<x>200</x>
<y>170</y>
<y>350</y>
<width>160</width>
<height>30</height>
</rect>
@ -629,12 +629,60 @@
<property name="geometry">
<rect>
<x>10</x>
<y>170</y>
<y>350</y>
<width>161</width>
<height>31</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="urlOnMobileLineEdit">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry">
<rect>
<x>170</x>
<y>170</y>
<width>451</width>
<height>21</height>
</rect>
</property>
</widget>
<widget class="QCheckBox" name="runLatestOnMobileCheckBox">
<property name="geometry">
<rect>
<x>20</x>
<y>170</y>
<width>120</width>
<height>20</height>
</rect>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If unchecked, will not show results during evaluation&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Run Latest</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
<widget class="QPushButton" name="downloadAPKButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry">
<rect>
<x>10</x>
<y>210</y>
<width>160</width>
<height>30</height>
</rect>
</property>
<property name="text">
<string>Download APK</string>
</property>
</widget>
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
@ -969,8 +1017,8 @@
<tabstop>setWorkingFolderRunOnDesktopButton</tabstop>
<tabstop>plainTextEdit</tabstop>
<tabstop>checkBoxServerless</tabstop>
<tabstop>checkBoxRunLatest</tabstop>
<tabstop>urlLineEdit</tabstop>
<tabstop>runLatestOnDesktopCheckBox</tabstop>
<tabstop>urlOnDesktopLineEdit</tabstop>
<tabstop>checkBoxInteractiveMode</tabstop>
<tabstop>evaluateTestsButton</tabstop>
<tabstop>updateTestRailRunResultsButton</tabstop>