用于扑面集成测试的记者

发布于 2025-01-30 15:27:01 字数 98 浏览 4 评论 0 原文

我正在寻找扑动集成库和测试管理工具(例如TestRail或XRARY)之间集成的示例。 对于柏树和其他浏览器自动化工具,我可以找到大量的解决方案,但是对于扑动的集成基本上什么都没有。

I am looking for examples of integrations among Flutter Integration library and test management tools like TestRail or Xray.
For Cypress and other browser automation tools I can find plenty of solutions but for Flutter integration basically nothing.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

请持续率性 2025-02-06 15:27:01

对于Xray,还没有教程。但是,应该很简单。

使用 flutter Test 运行测试,然后传递 - 机器参数以生成JSON报告。
使用 junitreport软件包生成Junit XML报告。
然后,您可以将其添加到您的命令中:

flutter Test -machine | tojunit -o junit.xml

如果将其重定向到文件,则可以将其提交给XRAY的报告。
对于XRAY SERVER/DATACENTER,您需要调用,类似:

curl -h“ content-type:multipart/form-data” -u用户名:password -f“ [email  procearted]

对于语法略有不同。您必须制作“ noreferrer”> authentication请求提交JUNIT XML报告。

token=$(curl -H "Content-Type: application/json" -X POST --data '{ "client_id": "32A27E69B0AC4E5000000...","client_secret": "d62f81eb9ed859e1....." }'  https://xray.cloud.getxray.app/api/v2/authenticate)
curl -H "Content-Type: text/xml" -X POST -H "Authorization: Bearer $token"  --data @"junit.xml" https://xray.cloud.getxray.app/api/v2/import/execution/junit?projectKey=XTP

For Xray, there's no tutorial yet. However, it should be fairly simple.

Run your tests using flutter test and pass the --machine argument to generate a JSON report.
Use the junitreport package to generate a JUnit XML report.
Then you can add it to your command as such:

flutter test --machine | tojunit -o junit.xml

If you redirect this to a file, then you have the report that you can submit to Xray for example.
For Xray server/datacenter, you need to call the REST API endpoint, something like:

curl -H "Content-Type: multipart/form-data" -u username:password -F "[email protected]" http://yourserver/rest/raven/1.0/import/execution/junit?projectKey=JIRAPROJECTKEY

For Xray on Jira Cloud, the syntax is slightly different. You have to make an authentication request first, and then do another submiting the JUnit XML report.

token=$(curl -H "Content-Type: application/json" -X POST --data '{ "client_id": "32A27E69B0AC4E5000000...","client_secret": "d62f81eb9ed859e1....." }'  https://xray.cloud.getxray.app/api/v2/authenticate)
curl -H "Content-Type: text/xml" -X POST -H "Authorization: Bearer $token"  --data @"junit.xml" https://xray.cloud.getxray.app/api/v2/import/execution/junit?projectKey=XTP

金兰素衣 2025-02-06 15:27:01

对于“颤振集成测试”中的报告,您可以使用 testrail 的第三方工具。

我创建了软件包,以轻松地将测试限制在颤音中:
flutter_testrail

eg检查此 flutter_testrail示例

现在创建了testrail帐户后,然后在我们的测试设置中配置:

    TestRail.configure(
      username: 'USERNAME',
      password: 'PASSWORD',
      /// The url that points to the test rail server => https://example.testrail.com
      serverDomain: 'https://YOUR_SERVER.testrail.com',
    )

在测试文件中定义您的初始测试状态:

 TestStatus testStatusResults= TestStatus(
          caseId: 1758,
          statusId: 3,
          comment: 'Verify that user is able to see the splash screen',
        ),
        

,然后在测试仪上更新您的测试状态:

  /// Equivalent Status Code:
  /// 1: Passed
  /// 2: Blocked
  /// 3: Untested (not allowed when adding a new result)
  /// 4: Retest
  /// 5: Failed
  ///
  ///  So Pass Status Code according to your test status
  static Future<void> reportMultipleTestCaseResults(
    List<TestStatus> testStatusResults,
  ) async {
    final testRun = await TestRun.get(3); //replace 3 with your own Run Id.
    await testRun.addResultsForCases(
      testStatusResults,
    );
  }

For Report in flutter integration testing you can use 3rd party tools like TESTRAIL.

I created Package to easily integrate TESTRAIL in flutter:
flutter_testrail

For E.g Check this Flutter_TestRail Example

Now once you created your TestRail Account then configure in our test setup:

    TestRail.configure(
      username: 'USERNAME',
      password: 'PASSWORD',
      /// The url that points to the test rail server => https://example.testrail.com
      serverDomain: 'https://YOUR_SERVER.testrail.com',
    )

Define your initial test status in test file:

 TestStatus testStatusResults= TestStatus(
          caseId: 1758,
          statusId: 3,
          comment: 'Verify that user is able to see the splash screen',
        ),
        

And then update your test status on TESTRAIL:

  /// Equivalent Status Code:
  /// 1: Passed
  /// 2: Blocked
  /// 3: Untested (not allowed when adding a new result)
  /// 4: Retest
  /// 5: Failed
  ///
  ///  So Pass Status Code according to your test status
  static Future<void> reportMultipleTestCaseResults(
    List<TestStatus> testStatusResults,
  ) async {
    final testRun = await TestRun.get(3); //replace 3 with your own Run Id.
    await testRun.addResultsForCases(
      testStatusResults,
    );
  }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文