Automated tests 空手道软件-通过空手道将文件上载到Gitlab(权限问题)

Automated tests 空手道软件-通过空手道将文件上载到Gitlab(权限问题),automated-tests,karate,Automated Tests,Karate,使用空手道,我需要上传一些文件到Gitlab,但我没有成功。我不知道如何处理能够连接到Git lab的凭据。我尝试使用以下方法: 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 The

使用空手道,我需要上传一些文件到Gitlab,但我没有成功。我不知道如何处理能够连接到Git lab的凭据。我尝试使用以下方法:

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(待登录):

但我仍然收到有关权限问题的信息:

<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管理员


您是否知道如何在获得许可的情况下成功地将文件上载到Gitlab/Github?谢谢大家!

我建议使用API。您必须通过阅读以下文档了解如何传递GitLab凭据:

很抱歉,我帮不了你更多的忙。请注意,演示中有auth甚至OAuth的示例。也许您只需要添加一个带有private/access令牌的头。首先尝试使用cURL命令,然后将其移植到空手道应该很容易

<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>