【发布时间】:2020-09-24 13:56:14
【问题描述】:
使用空手道我需要将一些文件上传到 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', filename:'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 并获得许可?谢谢!
【问题讨论】: