如何解决空手道软件-通过空手道将文件上传到Gitlab权限问题
使用空手道,我需要将一些文件上传到Gitlab,但是我不成功。我不知道如何处理凭据才能连接到Git实验室。我试图用这个:
Given url 'https://gitlab.xxxx.xxxxx.com/projectX/client-data-service'
And multipart file file = { read: 'test.jpg',filename:'test.jpg',contentType: 'image/jpg' }
When method post
Then status 200
然后我尝试一开始使用驱动程序通过驱动程序登录gitlab(要登录):
Given driver 'https://gitlab.xxxx.xxxxx.com/users/sign_in'
* retry().input('input[id=user_login]','user@user.xx')
* retry().input('input[id=user_password]','12345')
* retry().click('input[name=commit]')
* delay(3000);
Given driver 'https://gitlab.xxxx.xxxxx.com/projectX/client-data-service'
* delay(3000);
Given url 'https://gitlab.xxxx.xxxxx.com/projectX/client-data-service'
And multipart file file = { read: 'test.jpg',contentType: 'image/jpg' }
When method post
Then status 200
但我仍然收到有关权限问题的信息:
<div class="container">
<h3>The page could not be found or you don't have permission to view it.</h3>
<hr />
<p>The resource that you are attempting to access does not exist or you don't have the necessary permissions to view it.</p>
<p>Make sure the address is correct and that the page hasn't moved.</p>
<p>Please contact your GitLab administrator if you think this is a mistake.</p>
<a href="javascript:history.back()" class="js-go-back go-back">Go back</a>
</div>
您是否有一些想法可以成功将文件上传到Gitlab / Github?谢谢!
解决方法
我建议使用API。您必须通过阅读以下文档来了解如何通过GitLab凭证:https://docs.gitlab.com/ee/api/README.html#authentication
很抱歉,我不能提供更多帮助。请注意,演示中有auth甚至OAuth的示例。也许您只需要添加带有私有/访问令牌的标头即可。尝试首先使cURL命令起作用,然后将其移植到Karate应该很容易。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。