Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fmp_vip
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhenfei.zhang
fmp_vip
Commits
519b74ad
Commit
519b74ad
authored
May 29, 2018
by
xiaojing.zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GoogleTest隐藏弹出框
parent
50ade67c
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
32 additions
and
24 deletions
+32
-24
fmvip/global.h
+2
-0
fmvip/task/fmtask.cpp
+2
-5
fmvip/task/tasklogin.cpp
+1
-2
fmvip/windows/fmmsgwnd.cpp
+8
-0
fmvip/windows/fmviplogin.cpp
+6
-7
fmvip/windows/fmviporder.cpp
+4
-4
fmvip/windows/fmviprefund.cpp
+5
-2
fmvip/windows/fmviprefund.h
+2
-2
tests/TestPlugin/test_newvip.h
+2
-2
No files found.
fmvip/global.h
View file @
519b74ad
...
...
@@ -22,9 +22,11 @@
//#define PARTNER_ID "c3e82ff2-6285-4823-8e3f-7ec880ae7119"
//! 测试
#ifdef UNIT_TEST
#define APP_ID "T015"
#define KEY_CODE "85870ccc8da9affa5eafe7488533f273"
#define PARTNER_ID "7f657d18-9f3f-41fd-b97f-1a71f7d1ffa0"
#endif
// 请求类型的枚举值
enum
FM_TYPE
{
...
...
fmvip/task/fmtask.cpp
View file @
519b74ad
...
...
@@ -95,18 +95,15 @@ void FMTask::showWindow()
if
(
_window
!=
nullptr
)
{
_window
->
initWnd
(
this
->
session
());
int
ret
;
/*
#ifdef UNIT_TEST
if(_FM_Type == FM_Login || _FM_Type == FM_Pay )
if
(
_FM_Type
==
FM_Login
||
_FM_Type
==
FM_Pay
||
_FM_Type
==
FM_Refund
)
ret
=
1
;
else
ret
=
_window
->
exec
();
#else
ret
=
_window
->
exec
();
#endif
*/
ret
=
_window
->
exec
();
if
(
ret
!=
1
)
{
setError
(
FM_API_WINDOWCLOSE
);
}
...
...
fmvip/task/tasklogin.cpp
View file @
519b74ad
...
...
@@ -82,11 +82,10 @@ void TaskLogin::onLogin()
bool
canPay
=
(
getServerJsonValue
(
PosProps
.
CanPay
).
toInt
()
==
1
);
/*
#ifdef UNIT_TEST
canPay
=
true
;
#endif
*/
if
(
!
canPay
)
{
if
(
getPosJsonValue
(
PosProps
.
Fm_cmd
).
toInt
()
!=
FM_Pay
)
{
FMMsgWnd
::
LoginSuccess
(
account
,
name
,
birthday
,
_window
);
...
...
fmvip/windows/fmmsgwnd.cpp
View file @
519b74ad
...
...
@@ -73,37 +73,45 @@ int FMMsgWnd::_exec(InfoType type, const QString &info)
void
FMMsgWnd
::
FailureWnd
(
const
QString
&
info
,
QDialog
*
parent
)
{
#ifndef UNIT_TEST
FMMsgWnd
window
(
parent
);
if
(
parent
!=
nullptr
)
{
window
.
setGeometry
(
parent
->
geometry
());
}
window
.
_exec
(
FMMsgWnd
::
T_Failure
,
info
);
#endif
}
void
FMMsgWnd
::
WarningWnd
(
const
QString
&
info
,
QDialog
*
parent
)
{
#ifndef UNIT_TEST
FMMsgWnd
window
(
parent
);
if
(
parent
!=
nullptr
)
{
window
.
setGeometry
(
parent
->
geometry
());
}
window
.
_exec
(
FMMsgWnd
::
T_Warning
,
info
);
#endif
}
void
FMMsgWnd
::
SuccessWnd
(
const
QString
&
info
,
QDialog
*
parent
)
{
#ifndef UNIT_TEST
FMMsgWnd
window
(
parent
);
if
(
parent
!=
nullptr
)
{
window
.
setGeometry
(
parent
->
geometry
());
}
window
.
_exec
(
FMMsgWnd
::
T_Success
,
info
);
#endif
}
void
FMMsgWnd
::
LoginSuccess
(
const
QString
&
account
,
const
QString
&
name
,
const
QString
&
birthday
,
QDialog
*
parent
)
{
#ifndef UNIT_TEST
FMMsgWnd
window
(
parent
);
if
(
parent
!=
nullptr
)
{
window
.
setGeometry
(
parent
->
geometry
());
}
QString
info
=
QString
::
fromLocal8Bit
(
"账号:%1
\n
姓名:%2
\n
生日:%3"
).
arg
(
account
).
arg
(
name
).
arg
(
birthday
);
window
.
_exec
(
FMMsgWnd
::
T_LoginSuccess
,
info
);
#endif
}
int
FMMsgWnd
::
Question
(
const
QString
&
info
,
QDialog
*
parent
)
...
...
fmvip/windows/fmviplogin.cpp
View file @
519b74ad
...
...
@@ -47,12 +47,6 @@ bool FMVipLogin::initWnd(Session *session)
QString
placeText
;
if
(
session
->
data
(
PosProps
.
FM_Type
).
toInt
()
==
FM_Pay
)
{
placeText
=
QString
::
fromLocal8Bit
(
"输入支付码"
);
#ifdef UNIT_TEST
QString
paycode
=
GetPayCode
();
QTest
::
keyClicks
(
ui
->
login_edit
,
paycode
);
//QTest::mouseClick(ui->login_btn,Qt::LeftButton);
#endif
}
else
{
placeText
=
QString
::
fromLocal8Bit
(
"输入手机号/会员码/支付码"
);
}
...
...
@@ -62,7 +56,12 @@ bool FMVipLogin::initWnd(Session *session)
ui
->
operator_label
->
setText
(
session
->
data
(
PosProps
.
OperatorId
).
toString
());
ui
->
bd_label
->
setText
(
session
->
data
(
PosProps
.
BussinessDate
).
toString
());
ui
->
login_edit
->
setPlaceholderText
(
placeText
);
#ifdef UNIT_TEST
QString
paycode
=
GetPayCode
();
QTest
::
keyClicks
(
ui
->
login_edit
,
paycode
);
QTest
::
mouseClick
(
ui
->
login_btn
,
Qt
::
LeftButton
);
#endif
return
true
;
}
QString
FMVipLogin
::
getVersionInfo
()
...
...
@@ -114,7 +113,7 @@ QString FMVipLogin::GetPayCode()
QNetworkAccessManager
networkAcessManager
;
QNetworkRequest
_req
;
QString
codeFormat
;
QString
url
=
"http://
jtest
.sandload.cn:8748/wechat/card/getPayCode?partnerId=7f657d18-9f3f-41fd-b97f-1a71f7d1ffa0&openId=o4_93jjwHWPke-U1IT2IkUO5hbII&mobile=15821343897&URL=http%3A%2F%2Fjtest.sandload.cn"
;
QString
url
=
"http://
membertest1
.sandload.cn:8748/wechat/card/getPayCode?partnerId=7f657d18-9f3f-41fd-b97f-1a71f7d1ffa0&openId=o4_93jjwHWPke-U1IT2IkUO5hbII&mobile=15821343897&URL=http%3A%2F%2Fjtest.sandload.cn"
;
_req
.
setUrl
(
url
);
auto
reply
=
networkAcessManager
.
get
(
_req
);
QEventLoop
loop
;
...
...
fmvip/windows/fmviporder.cpp
View file @
519b74ad
...
...
@@ -6,11 +6,11 @@
#include "fmnumpad.h"
#include <QScrollBar>
#include <QItemSelectionModel>
/*
#ifdef UNIT_TEST
#include <QTest>
#endif
*/
FMVipOrder
::
FMVipOrder
(
QDialog
*
parent
)
:
FMVipWnd
(
parent
),
...
...
@@ -88,11 +88,11 @@ bool FMVipOrder::initWnd(Session *session)
ui
->
pay_edit
->
setValidator
(
new
QRegExpValidator
(
regexp
));
ui
->
score_edit
->
setValidator
(
new
QRegExpValidator
(
regexp
));
setWillPayText
();
/*
#ifdef UNIT_TEST
QTest
::
mouseClick
(
ui
->
pay_btn
,
Qt
::
LeftButton
);
#endif
*/
return
true
;
}
...
...
fmvip/windows/fmviprefund.cpp
View file @
519b74ad
...
...
@@ -108,6 +108,9 @@ bool FMVipRefund::initWnd(Session *session)
col
=
0
;
}
}
#ifdef UNIT_TEST
UiAutoTest
();
#endif
return
true
;
}
...
...
@@ -149,7 +152,7 @@ void FMVipRefund::setIsRefundSuccess(bool isRefundSuccess)
_isRefundSuccess
=
isRefundSuccess
;
}
/*
//测试程序自动退款时退最近的一笔
#ifdef UNIT_TEST
void
FMVipRefund
::
UiAutoTest
()
...
...
@@ -162,4 +165,4 @@ void FMVipRefund::UiAutoTest()
QTest
::
mouseClick
(
ui
->
close_btn
,
Qt
::
LeftButton
);
}
#endif
*/
fmvip/windows/fmviprefund.h
View file @
519b74ad
...
...
@@ -27,11 +27,11 @@ public:
bool
isRefundSuccess
()
const
;
void
setIsRefundSuccess
(
bool
isRefundSuccess
);
/*
#ifdef UNIT_TEST
void
UiAutoTest
();
#endif
*/
signals
:
void
refundPay
(
int
);
...
...
tests/TestPlugin/test_newvip.h
View file @
519b74ad
...
...
@@ -7,7 +7,6 @@
#include "fmtask.h"
#include "fmnumpad.h"
#include "readjsoncommand.h"
#include "loadrelyplugin.h"
#include <QByteArray>
#include <gtest/gtest.h>
...
...
@@ -126,7 +125,7 @@ QByteArray VipRefund()
////////////////////////////////////////////////////////////////////////
/*
TEST(TestNewVip, Vip_InfoFailed)
{
DeleteLocalDB();
...
...
@@ -134,6 +133,7 @@ TEST(TestNewVip, Vip_InfoFailed)
rspData = VipInfo();
ASSERT_FALSE(respDataDetect(rspData));
}
*/
//设置门店信息
TEST
(
TestNewVip
,
store_Info
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment