如何从空手道特征文件中集成 Cassandra 以删除测试数据

How to integrate Cassandra from karate feature file to delete test data

我正在空手道功能文件中执行不同的测试场景,但在测试结束时我想从 Cassandra 数据库中删除我的测试数据。你能建议我如何从空手道连接 Cassandra 以及如何在所有测试用例执行后仅执行一次数据清理 activity 吗?

1) 编写一个Java实用程序并从空手道调用它,参考:https://github.com/intuit/karate#calling-java

2) 通常在 测试之前清理 更安全,您可以使用 karate.callSingle() for this. To do something at the end of a test-suite, it is simplest to do it in the Java runner, similar to how HTML reports are generated: https://github.com/intuit/karate#parallel-execution