zendesk - Zendesk API - 是否可以同时编辑 2 个单独的类别?
问题描述
我有一些可与 Zendesk 帮助中心配合使用的自动化测试,并且我创建了一个 Jenkins 作业,它会在我在项目中推送一些新更改后的某个时间自动运行测试。这些测试使用相同的凭据连接到同一个 Zendesk 主机。
现在,有时我还想在我的 PC 上运行测试,同时它们在 Jenkins 上运行。当测试在本地运行时,我创建一个类别和一个名称为Local Category和Local Section的部分。当它们在 Jenkins 上运行时,名称更改为Jenkins Category和Jenkins Section。我这样做是希望测试能够运行而不会发生冲突。
这是代码:
protected void createTestCategoryAndSection() {
boolean isOnJenkins = System.getenv("JENKINS_HOME") != null;
category = zendeskRepoMngr.createCategory(
isOnJenkins ? "Jenkins Test Category 1" : "Local Test Category 1",
"Category created by a test case run " + (isOnJenkins ? "on Jenkins" : "locally"),
1);
section = zendeskRepoMngr.createSection(
category.getId(),
isOnJenkins ? "Jenkins Test Section 1" : "Local Test Section 1",
"Section created by a test case run " + (isOnJenkins ? "on Jenkins" : "locally"),
1);
}
但是,当我运行我的测试(创建新文章,可能会更新这些文章,删除其中一些)时,我会收到以下错误:
HTTP/503: Service Unavailable - {"message":"Service is temporarily unavailable because of a concurrent update. Please try again."}
或者
HTTP/409: Conflict - {"error":"Conflict","description":"Could not access data due to it being locked by another client"}
甚至
HTTP/500: Internal Server Error - {"status":500,"error":"Internal Server Error"}
有没有办法在本地和 Jenkins 上运行自动化测试,连接到同一个 Zendesk 主机并使用相同的凭据?
解决方案
推荐阅读
- excel - 如何让 Excel 插件在 Chrome 浏览器中打开网页?
- java - Fragment 中的字节数组参数 null
- javascript - React:如何在画布之外捕捉 onMouseUp 事件?
- zurb-foundation - 如何在 Foundation for Emails 中删除一行的底部边距?
- python - 在python中如何混合两个句子?
- html - 我无法更改我的 CSS 中的任何内容,没有任何效果
- sql - 为什么这一列不明确,而同一张表中的另一列不明确?
- ruby-on-rails - 在 Ruby on Rails 中开发 AMP 电子邮件的问题
- javascript - 想用mail()转换成docx后发送附件
- test-suite - Google Home 设备无法识别测试套件命令