| 200 | } |
| 201 | |
| 202 | bool Parser::ParseWaitForScreenshot(const nlohmann::json &json, ComRef<ITestPass>& out) { |
| 203 | if (!json.contains("Path")) { |
| 204 | Log(registry, "Expected image path"); |
| 205 | return false; |
| 206 | } |
| 207 | |
| 208 | // Get threshold |
| 209 | int64_t threshold = json.value("Threshold", 4ll); |
| 210 | |
| 211 | // Negate value / default if requested |
| 212 | if (json.value("Negated", false)) { |
| 213 | threshold = -threshold; |
| 214 | } |
| 215 | |
| 216 | // Create pass |
| 217 | out = registry->New<WaitForScreenshotPass>( |
| 218 | ExpandPath(json["Path"].get<std::string>()).string(), |
| 219 | threshold |
| 220 | ); |
| 221 | return true; |
| 222 | } |
| 223 | |
| 224 | bool Parser::ParseWaitForPipelines(const nlohmann::json &json, ComRef<ITestPass> &out) { |
| 225 | out = registry->New<WaitForPipelinesPass>(); |
nothing calls this directly
no test coverage detected