Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
willdesk_apiauto
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
29
Issues
29
List
Boards
Labels
Service Desk
Milestones
Merge Requests
29
Merge Requests
29
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
桦生 詹
willdesk_apiauto
Commits
ad82365b
Commit
ad82365b
authored
Apr 22, 2024
by
zhanhuasheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfix
parent
b368b3a3
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
9 additions
and
23 deletions
+9
-23
TestCase/FAQ/test_01_article_info.py
TestCase/FAQ/test_01_article_info.py
+0
-1
TestCase/FAQ/test_02_article_opreate.py
TestCase/FAQ/test_02_article_opreate.py
+0
-1
TestCase/FAQ/test_03_article_page_setting.py
TestCase/FAQ/test_03_article_page_setting.py
+0
-1
TestCase/account/test_01_account.py
TestCase/account/test_01_account.py
+0
-1
TestCase/billing/test_01_buyPlan.py
TestCase/billing/test_01_buyPlan.py
+0
-1
TestCase/customer/test_01_customer.py
TestCase/customer/test_01_customer.py
+0
-1
TestCase/inbox/test_01_livechat.py
TestCase/inbox/test_01_livechat.py
+0
-1
TestCase/inbox/test_02_ticketStatus.py
TestCase/inbox/test_02_ticketStatus.py
+0
-1
TestCase/inbox/test_03_ticketOpreate.py
TestCase/inbox/test_03_ticketOpreate.py
+0
-1
TestCase/inbox/test_04_ticketInfo.py
TestCase/inbox/test_04_ticketInfo.py
+0
-1
TestCase/inbox/test_05_team.py
TestCase/inbox/test_05_team.py
+0
-1
TestCase/inbox/test_06_channel.py
TestCase/inbox/test_06_channel.py
+0
-1
TestCase/inbox/test_07_ticketDetail.py
TestCase/inbox/test_07_ticketDetail.py
+0
-1
TestCase/report/test_01_report.py
TestCase/report/test_01_report.py
+0
-1
TestCase/setting/test_01_emailIntegration.py
TestCase/setting/test_01_emailIntegration.py
+0
-1
TestCase/setting/test_02_whatsappIntegration.py
TestCase/setting/test_02_whatsappIntegration.py
+0
-1
TestCase/setting/test_04_widgetSetting.py
TestCase/setting/test_04_widgetSetting.py
+0
-1
TestData/setting/email_integration_test_data.py
TestData/setting/email_integration_test_data.py
+2
-1
Utils/req_handler.py
Utils/req_handler.py
+2
-0
Utils/webhook_handler.py
Utils/webhook_handler.py
+5
-5
No files found.
TestCase/FAQ/test_01_article_info.py
View file @
ad82365b
...
...
@@ -11,4 +11,3 @@ class TestFAQ:
@
pytest
.
mark
.
parametrize
(
'case'
,
yaml_data
)
def
test_article
(
self
,
case
):
req_handler
.
ReqHandler
.
send_requests
(
case
=
case
,
var_class
=
articleInfoTestData
)
print
(
case
)
\ No newline at end of file
TestCase/FAQ/test_02_article_opreate.py
View file @
ad82365b
...
...
@@ -11,4 +11,3 @@ class TestArticleOpreate:
@
pytest
.
mark
.
parametrize
(
'case'
,
yaml_data
)
def
test_article_opreate
(
self
,
case
):
req_handler
.
ReqHandler
.
send_requests
(
case
=
case
,
var_class
=
articleOperateTestData
)
print
(
case
)
\ No newline at end of file
TestCase/FAQ/test_03_article_page_setting.py
View file @
ad82365b
...
...
@@ -11,4 +11,3 @@ class TestArticleOpreate:
@
pytest
.
mark
.
parametrize
(
'case'
,
yaml_data
)
def
test_article_page_setting
(
self
,
case
):
req_handler
.
ReqHandler
.
send_requests
(
case
=
case
,
var_class
=
articlePageSettingTestData
)
print
(
case
)
\ No newline at end of file
TestCase/account/test_01_account.py
View file @
ad82365b
...
...
@@ -12,4 +12,3 @@ class TestAccount:
@
pytest
.
mark
.
parametrize
(
'case'
,
yaml_data
)
def
test_account
(
self
,
case
):
req_handler
.
ReqHandler
.
send_requests
(
case
=
case
,
var_class
=
accountData
)
print
(
case
)
\ No newline at end of file
TestCase/billing/test_01_buyPlan.py
View file @
ad82365b
...
...
@@ -11,4 +11,3 @@ class TestBuyPlan:
@
pytest
.
mark
.
parametrize
(
'case'
,
yaml_data
)
def
test_buy_plan
(
self
,
case
):
req_handler
.
ReqHandler
.
send_requests
(
case
=
case
,
var_class
=
buyPlanData
)
print
(
case
)
\ No newline at end of file
TestCase/customer/test_01_customer.py
View file @
ad82365b
...
...
@@ -11,4 +11,3 @@ class TestCustomer:
@
pytest
.
mark
.
parametrize
(
'case'
,
yaml_data
)
def
test_customer
(
self
,
case
):
req_handler
.
ReqHandler
.
send_requests
(
case
=
case
,
var_class
=
customerData
)
print
(
case
)
\ No newline at end of file
TestCase/inbox/test_01_livechat.py
View file @
ad82365b
...
...
@@ -11,4 +11,3 @@ class TestLivechat:
@
pytest
.
mark
.
parametrize
(
'case'
,
yaml_data
)
def
test_livechat
(
self
,
case
):
req_handler
.
ReqHandler
.
send_requests
(
case
=
case
,
var_class
=
livechatData
)
print
(
case
)
\ No newline at end of file
TestCase/inbox/test_02_ticketStatus.py
View file @
ad82365b
...
...
@@ -10,5 +10,4 @@ class TestTicketStatus:
@
pytest
.
mark
.
flaky
(
reruns
=
ticketStatusData
.
rerun
,
reruns_delay
=
ticketStatusData
.
rerun_delay
)
@
pytest
.
mark
.
parametrize
(
'case'
,
yaml_data
)
def
test_ticketStatus
(
self
,
case
):
print
(
case
)
req_handler
.
ReqHandler
.
send_requests
(
case
=
case
,
var_class
=
ticketStatusData
)
TestCase/inbox/test_03_ticketOpreate.py
View file @
ad82365b
...
...
@@ -14,5 +14,4 @@ class TestTicketOpreate:
@
pytest
.
mark
.
flaky
(
reruns
=
ticketStatusData
.
rerun
,
reruns_delay
=
ticketStatusData
.
rerun_delay
)
@
pytest
.
mark
.
parametrize
(
'case'
,
yaml_data
)
def
test_ticketOpreate
(
self
,
case
):
print
(
case
)
req_handler
.
ReqHandler
.
send_requests
(
case
=
case
,
var_class
=
ticketStatusData
)
TestCase/inbox/test_04_ticketInfo.py
View file @
ad82365b
...
...
@@ -10,5 +10,4 @@ class TestTicketInfo:
@
pytest
.
mark
.
flaky
(
reruns
=
ticketInfoData
.
rerun
,
reruns_delay
=
ticketInfoData
.
rerun_delay
)
@
pytest
.
mark
.
parametrize
(
'case'
,
yaml_data
)
def
test_ticketInfo
(
self
,
case
):
print
(
case
)
req_handler
.
ReqHandler
.
send_requests
(
case
=
case
,
var_class
=
ticketInfoData
)
TestCase/inbox/test_05_team.py
View file @
ad82365b
...
...
@@ -10,5 +10,4 @@ class TestTeam:
@
pytest
.
mark
.
flaky
(
reruns
=
teamData
.
rerun
,
reruns_delay
=
teamData
.
rerun_delay
)
@
pytest
.
mark
.
parametrize
(
'case'
,
yaml_data
)
def
test_team
(
self
,
case
):
print
(
case
)
req_handler
.
ReqHandler
.
send_requests
(
case
=
case
,
var_class
=
teamData
)
TestCase/inbox/test_06_channel.py
View file @
ad82365b
...
...
@@ -10,5 +10,4 @@ class TestChannel:
@
pytest
.
mark
.
flaky
(
reruns
=
channelData
.
rerun
,
reruns_delay
=
channelData
.
rerun_delay
)
@
pytest
.
mark
.
parametrize
(
'case'
,
yaml_data
)
def
test_channel
(
self
,
case
):
print
(
case
)
req_handler
.
ReqHandler
.
send_requests
(
case
=
case
,
var_class
=
channelData
)
TestCase/inbox/test_07_ticketDetail.py
View file @
ad82365b
...
...
@@ -10,5 +10,4 @@ class TestTiocketDetail:
@
pytest
.
mark
.
flaky
(
reruns
=
ticketDetailData
.
rerun
,
reruns_delay
=
ticketDetailData
.
rerun_delay
)
@
pytest
.
mark
.
parametrize
(
'case'
,
yaml_data
)
def
test_ticketDetail
(
self
,
case
):
print
(
case
)
req_handler
.
ReqHandler
.
send_requests
(
case
=
case
,
var_class
=
ticketDetailData
)
TestCase/report/test_01_report.py
View file @
ad82365b
...
...
@@ -11,4 +11,3 @@ class TestReport:
@
pytest
.
mark
.
parametrize
(
'case'
,
yaml_data
)
def
test_report
(
self
,
case
):
req_handler
.
ReqHandler
.
send_requests
(
case
=
case
,
var_class
=
reportData
)
print
(
case
)
\ No newline at end of file
TestCase/setting/test_01_emailIntegration.py
View file @
ad82365b
...
...
@@ -11,5 +11,4 @@ class TestEmailIntegration:
@
pytest
.
mark
.
flaky
(
reruns
=
emailIntegrationData
.
rerun
,
reruns_delay
=
emailIntegrationData
.
rerun_delay
)
@
pytest
.
mark
.
parametrize
(
'case'
,
yaml_data
)
def
test_emailIntegration
(
self
,
case
):
print
(
case
)
req_handler
.
ReqHandler
.
send_requests
(
case
=
case
,
var_class
=
emailIntegrationData
)
TestCase/setting/test_02_whatsappIntegration.py
View file @
ad82365b
...
...
@@ -10,5 +10,4 @@ class TestWhatsappIntegration:
@
pytest
.
mark
.
flaky
(
reruns
=
whatsappIntegrationData
.
rerun
,
reruns_delay
=
whatsappIntegrationData
.
rerun_delay
)
@
pytest
.
mark
.
parametrize
(
'case'
,
yaml_data
)
def
test_whatsappIntegration
(
self
,
case
):
print
(
case
)
req_handler
.
ReqHandler
.
send_requests
(
case
=
case
,
var_class
=
whatsappIntegrationData
)
TestCase/setting/test_04_widgetSetting.py
View file @
ad82365b
...
...
@@ -10,5 +10,4 @@ class TestWidgetSetting:
@
pytest
.
mark
.
flaky
(
reruns
=
widgetSettingData
.
rerun
,
reruns_delay
=
widgetSettingData
.
rerun_delay
)
@
pytest
.
mark
.
parametrize
(
'case'
,
yaml_data
)
def
test_widgetSetting
(
self
,
case
):
print
(
case
)
req_handler
.
ReqHandler
.
send_requests
(
case
=
case
,
var_class
=
widgetSettingData
)
TestData/setting/email_integration_test_data.py
View file @
ad82365b
from
Utils.global_variate
import
Global
from
Utils.mockData_handler
import
data_handler
class
emailIntegrationData
(
Global
):
append_email_address
=
'autotest
@channelwill.cn'
append_email_address
=
f
'
{
data_handler
.
name
()
}
@channelwill.cn'
append_email_name
=
'autotest'
append_email_status
=
0
new_email_name
=
'autotest2'
Utils/req_handler.py
View file @
ad82365b
...
...
@@ -104,11 +104,13 @@ class ReqHandler:
raise
TypeError
(
'用例格式有误'
)
except
AssertionError
:
logger
.
error
(
f
'
{
title
}
用例执行失败,失败原因:断言不通过
\n
用例
{
case
}
\n
期望值
{
expected
}
\n
实际返回值
{
res
.
text
}
'
)
print
(
f
'
{
title
}
用例执行失败,失败原因:断言不通过
\n
用例
{
case
}
\n
期望值
{
expected
}
\n
实际返回值
{
res
.
text
}
'
)
raise
AssertionError
except
Exception
as
e
:
import
traceback
print
(
traceback
.
print_exc
())
logger
.
error
(
f
'
{
title
}
用例执行失败,失败原因:
{
e
}
'
)
print
(
f
'
{
title
}
用例执行失败,失败原因:
{
e
}
\n
用例
{
case
}
'
)
raise
Exception
def
ws_requests
(
self
,
case
):
...
...
Utils/webhook_handler.py
View file @
ad82365b
...
...
@@ -9,18 +9,19 @@ import urllib.parse
timestamp
=
str
(
round
(
time
.
time
()
*
1000
))
secret
=
'SEC80ae01de9c486a9f8531d4ec1ed09b8fbd5d9cc1b0ba171b0493f9bebfeb4807'
secret
=
'SEC80ae01de9c486a9f8531d4ec1ed09b8fbd5d9cc1b0ba171b0493f9bebfeb4807'
#正式的webhook
# secret = 'SEC9d91939234e83369cba32c0ca4bcd9af60b5b1f69424d6fabd36f48d572a151c' #测试用的webhook
secret_enc
=
secret
.
encode
(
'utf-8'
)
string_to_sign
=
'{}
\n
{}'
.
format
(
timestamp
,
secret
)
string_to_sign_enc
=
string_to_sign
.
encode
(
'utf-8'
)
hmac_code
=
hmac
.
new
(
secret_enc
,
string_to_sign_enc
,
digestmod
=
hashlib
.
sha256
).
digest
()
sign
=
urllib
.
parse
.
quote_plus
(
base64
.
b64encode
(
hmac_code
))
# webhook_url = 'https://oapi.dingtalk.com/robot/send?access_token=22fda27990b00841c3201c20649c0a8abb6da82d8472b6f6154ef4cd9dadb33f' #测试用的webhook
webhook_url
=
'https://oapi.dingtalk.com/robot/send?access_token=775093d6cbe22673b65e506f20aea7036cc58c4b9e89850f660eb798e4c149f6'
#正式的webhook
class
webhookHandler
:
def
__init__
(
self
,
webhookUrl
=
f
"
https://oapi.dingtalk.com/robot/send?access_token=775093d6cbe22673b65e506f20aea7036cc58c4b9e89850f660eb798e4c149f6
×tamp=
{
timestamp
}
&sign=
{
sign
}
"
):
def
__init__
(
self
,
webhookUrl
=
f
"
{
webhook_url
}
×tamp=
{
timestamp
}
&sign=
{
sign
}
"
):
self
.
webhookUrl
=
webhookUrl
...
...
@@ -49,4 +50,3 @@ class webhookHandler:
res
=
requests
.
post
(
url
=
self
.
webhookUrl
,
data
=
data
)
webhook
=
webhookHandler
()
webhook
.
getToken
()
\ No newline at end of file
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