Skip to content

Commit

Permalink
Merge pull request #12 from WilliamYinwei/32bit
Browse files Browse the repository at this point in the history
增加本地测试结果导出功能
  • Loading branch information
WilliamYinwei authored Dec 18, 2020
2 parents 4097c25 + 5fd5e37 commit 3642b97
Show file tree
Hide file tree
Showing 28 changed files with 699 additions and 61 deletions.
9 changes: 9 additions & 0 deletions Changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
2、登录TreeATE的默认用户名/密码: admin/123
3、加载Example中的测试工程,点击Play(测试)

V2.0.2
-------------------
1、解决V2.0.1版本引入的问题:循环测试无法点击"停止"

V2.0.1
-------------------
1、解决并行执行时总状态显示问题
2、删除了网络检查功能

V2.0.0
-------------------
1、变更TreeATE的License为LGPL v3
Expand Down
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[![Github issues](https://img.shields.io/github/issues/WilliamYinwei/TreeATE)](https://github.com/WilliamYinwei/TreeATE/issues)
[![Github release (latest SemVer)](https://img.shields.io/github/v/release/WilliamYinwei/TreeATE)](https://github.com/WilliamYinwei/TreeATE/releases/latest)
[![Github All Releases](https://img.shields.io/github/downloads/WilliamYinwei/TreeATE/total)](https://github.com/WilliamYinwei/TreeATE/releases)

# TreeATE
TreeATE是Tree Automatic Test Equipment的缩写,专注服务于工厂成品或半成品测试自动化的一种开源软件工具平台。

Expand Down Expand Up @@ -54,6 +58,21 @@ TreeATE基于QT开发,运行于Windows 32位系统(支持64位)。在编
* PYTHON_PATH C:\Python27\
* PYTHON_LIB C:\Python27\libs\

## 部署
在开始菜单中找到Qt 5.7 32-bit for Desktop(MSVC 2013)命令行窗口进入构建的目录。
例如:D:\Projects\build-TreeATE-Desktop_Qt_5_7_0_MSVC2013_32bit-Release\bin\
再执行以下命令
* windeployqt TestEngine.exe
* windeployqt TreeATE.exe
* windeployqt TreeATEDev.exe
* windeployqt TreeResults.exe

### 打包成安装文件
依赖 Inno Setup
* 通过 Inno Setup 打开 Setup/Setup.iss文件
* 找到第37行,根据本地实际输出的构建目录替换掉路径D:\Projects\build-TreeATE-Desktop_Qt_5_7_0_MSVC2013_32bit-Release\bin
* 再执行Build>>Compile(Ctrl+F9)或Run(F9)

运行
-------------------------------------------------------------------------------
在试用运行之前,一般还需要以下几个操作:
Expand Down
2 changes: 1 addition & 1 deletion Setup/setup.iss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "TreeATE"
#define MyAppVersion "2.0.1"
#define MyAppVersion "2.0.2"
#define MyAppPublisher "David Yin"
#define MyAppURL "https://blog.csdn.net/vivasoft/column/info/31202"
#define MyAppExeName "TreeATE.exe"
Expand Down
2 changes: 1 addition & 1 deletion Src/TreeATE/aboutdialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string notr="true">Version: 2.0.1</string>
<string notr="true">Version: 2.0.2</string>
</property>
</widget>
</item>
Expand Down
8 changes: 4 additions & 4 deletions Src/TreeATE/ate.rc
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ IDI_ICON1 ICON DISCARDABLE "ATE.ico"
#endif

VS_VERSION_INFO VERSIONINFO
FILEVERSION 2,0,1,1
PRODUCTVERSION 2,0,1,1
FILEVERSION 2,0,2,1
PRODUCTVERSION 2,0,2,1
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS VS_FF_DEBUG
Expand All @@ -25,8 +25,8 @@ VS_VERSION_INFO VERSIONINFO
BEGIN
VALUE "CompanyName", "David Yin\0"
VALUE "FileDescription", "TreeATE for manufactory automatic testing\0"
VALUE "FileVersion", "2,0,1,1"
VALUE "ProductVersion", "2,0,1,1"
VALUE "FileVersion", "2,0,2,1"
VALUE "ProductVersion", "2,0,2,1"
VALUE "LegalCopyright", "Copyright 2020(C) David Yin\0"
VALUE "LegalTrademarks", "TreeATE\0"
VALUE "OriginalFilename", "TreeATE.exe\0"
Expand Down
6 changes: 3 additions & 3 deletions Src/TreeATE/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -435,12 +435,12 @@ void MainWindow::on_updateTotalStatus(eTestStatus eStatus, int n)
ui->progressBar->setValue(n);
}

enableForStatus(eStatus);

if(eStatus < m_totalStatus)
return;
m_totalStatus = eStatus;

enableForStatus(eStatus);

QString strStatus;
QString strStyle;
switch(eStatus)
Expand Down Expand Up @@ -883,7 +883,7 @@ void MainWindow::on_action_Edit_triggered()
QString strPath = m_labelPath->text();
QFileInfo info(strPath);
if(info.isFile()) {
lstPara << strPath.remove(strPath.length() - 1, 1); // remove the x (.tpx), need *.tp file
lstPara << strPath;
}
m_pEditWin->start("TreeATEDev.exe", lstPara);
if(!m_pEditWin->waitForStarted(3000))
Expand Down
2 changes: 1 addition & 1 deletion Src/TreeATEDev/aboutdlg.ui
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>Version: 1.2.2</string>
<string>Version: 1.3.1</string>
</property>
</widget>
</item>
Expand Down
8 changes: 4 additions & 4 deletions Src/TreeATEDev/ate_dev.rc
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ IDI_ICON1 ICON DISCARDABLE "ATE_dev.ico"
#endif

VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,2,2,2
PRODUCTVERSION 1,2,2,2
FILEVERSION 1,3,1,1
PRODUCTVERSION 1,3,1,1
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS VS_FF_DEBUG
Expand All @@ -25,8 +25,8 @@ VS_VERSION_INFO VERSIONINFO
BEGIN
VALUE "CompanyName", "David Yin\0"
VALUE "FileDescription", "TreeATE Developer Tools for TreeATE\0"
VALUE "FileVersion", "1,2,2,2"
VALUE "ProductVersion", "1,2,2,2"
VALUE "FileVersion", "1,3,1,1"
VALUE "ProductVersion", "1,3,1,1"
VALUE "LegalCopyright", "Copyright 2020(C) David Yin\0"
VALUE "LegalTrademarks", "TreeATE Dev\0"
VALUE "OriginalFilename", "TreeATEDev.exe\0"
Expand Down
18 changes: 17 additions & 1 deletion Src/TreeATEDev/dlgfind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,20 @@

#include <QActionEvent>
#include <QMessageBox>
#include <QPushButton>

DlgFind::DlgFind(QWidget *parent) :
QDialog(parent),
ui(new Ui::DlgFind)
{
ui->setupUi(this);
QPushButton* pApply = ui->buttonBox->button(QDialogButtonBox::Apply);
pApply->setAutoDefault(true);
pApply->setDefault(true);

QPushButton* pClose = ui->buttonBox->button(QDialogButtonBox::Close);
pClose->setAutoDefault(false);
pClose->setDefault(false);
}

DlgFind::~DlgFind()
Expand Down Expand Up @@ -52,6 +60,14 @@ void DlgFind::on_buttonBox_clicked(QAbstractButton *button)
{
if(button && button->text() == "Apply")
{
emit seachForText(GetFindText(), IsWhole(), IsCase(), IsRegEx());
emit seachForText(GetFindText(),
ui->lineEdit_replace->text(),
IsWhole(), IsCase(), IsRegEx(),
ui->checkBox_replace->isChecked());
}
}

void DlgFind::on_checkBox_replace_clicked(bool checked)
{
ui->lineEdit_replace->setEnabled(checked);
}
5 changes: 4 additions & 1 deletion Src/TreeATEDev/dlgfind.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ class DlgFind : public QDialog
explicit DlgFind(QWidget *parent = 0);
~DlgFind();
signals:
void seachForText(const QString& text, bool wo, bool ca, bool re);
void seachForText(const QString& text, const QString& reText,
bool wo, bool ca, bool re, bool replace);

protected:
QString GetFindText();
Expand All @@ -39,6 +40,8 @@ class DlgFind : public QDialog
private slots:
void on_buttonBox_clicked(QAbstractButton *button);

void on_checkBox_replace_clicked(bool checked);

private:
Ui::DlgFind *ui;
};
Expand Down
36 changes: 25 additions & 11 deletions Src/TreeATEDev/dlgfind.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>359</width>
<height>131</height>
<width>391</width>
<height>161</height>
</rect>
</property>
<property name="windowTitle">
Expand All @@ -16,14 +16,28 @@
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="3" column="1">
<item row="4" column="1">
<widget class="QCheckBox" name="checkBox_regex">
<property name="text">
<string>Use regular expressions</string>
</property>
</widget>
</item>
<item row="1" column="1">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Seach</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QCheckBox" name="checkBox_whole">
<property name="text">
<string>Whole worlds only</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="checkBox_case">
<property name="text">
<string>Case sensitive</string>
Expand All @@ -46,17 +60,17 @@
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="checkBox_whole">
<item row="1" column="0">
<widget class="QCheckBox" name="checkBox_replace">
<property name="text">
<string>Whole worlds only</string>
<string>Replace</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Seach for</string>
<item row="1" column="1">
<widget class="QLineEdit" name="lineEdit_replace">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
Expand Down
69 changes: 57 additions & 12 deletions Src/TreeATEDev/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ MainWindow::MainWindow(QWidget *parent) :
ui->verticalLayout_main->addWidget(splitterMain);

m_pFindDlg = new DlgFind(this);
connect(m_pFindDlg, SIGNAL(seachForText(QString,bool,bool,bool)), this,
SLOT(on_dlgFind(QString,bool,bool,bool)));
connect(m_pFindDlg, SIGNAL(seachForText(QString,QString,bool,bool,bool,bool)), this,
SLOT(on_dlgFind(QString,QString,bool,bool,bool,bool)));

m_fileSysModel = new QFileSystemModel();
m_fileSysModel->setReadOnly(false);
Expand Down Expand Up @@ -145,15 +145,25 @@ bool MainWindow::OpenProjectFile(const QString& strPrjFile, bool bTPX)
if(m_strProjectFile == strPrjFile)
return false;

QFile prjFile(strPrjFile);
QFileInfo fileInfo(strPrjFile);
if(bTPX) { // is tpx file
m_pProMgrWidget->SetProjectPath(fileInfo.absolutePath() + "/"
+ fileInfo.completeBaseName() + ".tpx");
// get tp file name from tpx
m_strProjectFile = fileInfo.absolutePath() + "/" + m_pProMgrWidget->GetPrjName();
}
else { // is tp file
m_strProjectFile == strPrjFile;
}

QFile prjFile(m_strProjectFile);

if(!prjFile.open(QIODevice::ReadOnly)) {
QString errStr = prjFile.errorString() + ": " + strPrjFile;
QString errStr = prjFile.errorString() + ": " + m_strProjectFile;
QMessageBox::warning(this, tr("Warning"), errStr);
return false;
}

m_strProjectFile = strPrjFile;

QJsonParseError jsErr;
QJsonDocument jsonDoc = QJsonDocument::fromJson(prjFile.readAll(), &jsErr);
Expand All @@ -163,7 +173,7 @@ bool MainWindow::OpenProjectFile(const QString& strPrjFile, bool bTPX)
m_pUnitModel->SetPrjData(vaPrj);
m_tvTestItems->expandAll();

QFileInfo fileInfo(strPrjFile);
fileInfo.setFile(m_strProjectFile);
QString scriptFileJs = fileInfo.absolutePath() + "/" + fileInfo.completeBaseName() + ".js";
QString scriptFilePy = fileInfo.absolutePath() + "/" + fileInfo.completeBaseName() + ".py";
fileInfo.setFile(scriptFileJs);
Expand All @@ -186,10 +196,6 @@ bool MainWindow::OpenProjectFile(const QString& strPrjFile, bool bTPX)
m_scriptEdit->SetScriptData(scrFile.readAll());
scrFile.close();

if(bTPX) {
m_pProMgrWidget->SetProjectPath(fileInfo.absolutePath() + "/"
+ fileInfo.completeBaseName() + ".tpx");
}

m_pProMgrWidget->SetPublicPara(m_pUnitModel->GetPublicPara());
m_pProMgrWidget->SetModels(m_pUnitModel->GetPublicModels());
Expand All @@ -214,7 +220,7 @@ bool MainWindow::OpenProjectFile(const QString& strPrjFile, bool bTPX)
void MainWindow::on_action_Open_triggered()
{
QString fileName =
QFileDialog::getOpenFileName(this, tr("Open project file"), "", tr("Test Project(*.tp)"));
QFileDialog::getOpenFileName(this, tr("Open project file"), "", tr("Test Project(*.tpx)"));
if(fileName.isEmpty())
return;

Expand Down Expand Up @@ -585,6 +591,7 @@ void MainWindow::on_actionRemove_modelFile()
void MainWindow::SetNewPrjDisabled()
{
ui->action_New->setDisabled(true);
ui->actionRename->setDisabled(true);
}

void MainWindow::closeEvent(QCloseEvent *event)
Expand Down Expand Up @@ -664,11 +671,49 @@ void MainWindow::on_actionFind_triggered()
}
}

void MainWindow::on_dlgFind(QString text, bool wo, bool ca, bool re)
void MainWindow::on_dlgFind(QString text, QString reText,
bool wo, bool ca, bool re, bool replace)
{
m_scriptEdit->GetScriptEdit()->activateWindow();
if(!m_scriptEdit->GetScriptEdit()->findFirst(text, re, ca, wo, true))
{
QMessageBox::information(this, "Info", "Not found: " + text);
return;
}
if(replace)
{
m_scriptEdit->GetScriptEdit()->replaceSelectedText(reText);
}
}

void MainWindow::on_actionRename_triggered()
{
QFileInfo info(m_strProjectFile);
QString strDistPath = info.absolutePath() + "/";
QString oldFileName = info.baseName();
bool ok = false;
QString newFileName = QInputDialog::getText(this, "Rename", "Current name is: " + oldFileName +
"\r\n* Will be closed this system",
QLineEdit::Normal, "", &ok);
if(ok && !oldFileName.isEmpty()) {
m_strProjectFile = strDistPath + newFileName + ".tp";
QFileInfo fileInfo;
QString scriptFileJs = strDistPath + oldFileName + ".js";
fileInfo.setFile(scriptFileJs);
if(fileInfo.isFile()) {
m_strScriptFile = strDistPath + newFileName + ".js";
}
else {
m_strScriptFile = strDistPath + newFileName + ".py";
scriptFileJs = strDistPath + oldFileName + ".py";
}

QFile::rename(scriptFileJs, m_strScriptFile);
QFile::rename(strDistPath + oldFileName + ".tp", m_strProjectFile);

m_pProMgrWidget->RenameFilePrj(newFileName);

QFile::rename(strDistPath + oldFileName + ".tpx", strDistPath + newFileName + ".tpx");
close();
}
}
Loading

0 comments on commit 3642b97

Please sign in to comment.