Skip to content

Commit 7f61dbf

Browse files
committed
add TakeAndCompareScreenshot method
1 parent 5b4501a commit 7f61dbf

File tree

1 file changed

+36
-15
lines changed

1 file changed

+36
-15
lines changed

proto/decentraland/kernel/apis/testing.proto

Lines changed: 36 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,49 @@
11
syntax = "proto3";
22
package decentraland.kernel.apis;
33

4+
import "decentraland/common/vectors.proto";
5+
46
service TestingService {
57
// sends a test result to the test runner
68
rpc LogTestResult(TestResult) returns (TestResultResponse) {}
79
// send a list of all planned tests to the test runner
810
rpc Plan(TestPlan) returns (TestPlanResponse) {}
911
// sets the camera position and rotation in the engine
1012
rpc SetCameraTransform (SetCameraTransformTestCommand) returns (SetCameraTransformTestCommandResponse) {}
13+
// take a screenshot and compare it with a stored one
14+
// it hides the explorer hud and ui, primary player and players of avatar scenes
15+
rpc TakeAndCompareScreenshot (TakeAndCompareScreenshotRequest) returns (TakeAndCompareScreenshotResponse) {}
1116
}
1217

18+
message TakeAndCompareScreenshotRequest {
19+
// the source path in the scene where the screenshot is stored,
20+
// the snapshot taken is compared with the stored one
21+
string src_stored_snapshot = 1;
22+
// the camera position where is set before and while taking the screenshot, relative to base scene
23+
decentraland.common.Vector3 camera_position = 2;
24+
// the camera position where is target to before and while taking the screenshot, relative to base scene
25+
decentraland.common.Vector3 camera_target = 3;
26+
// width x height screenshot size
27+
decentraland.common.Vector2 screenshot_size = 4;
28+
// comparison method choice and parameters values
29+
oneof comparison_method {
30+
ComparisonMethodGreyPixelDiff grey_pixel_diff = 5;
31+
}
32+
33+
message ComparisonMethodGreyPixelDiff {}
34+
}
35+
36+
37+
message TakeAndCompareScreenshotRequest {
38+
bool stored_snapshot_found = 1;
39+
oneof comparison_method_result {
40+
ComparisonMethodGreyPixelDiffResult grey_pixel_diff = 2;
41+
}
42+
43+
message ComparisonMethodGreyPixelDiffResult {
44+
float similarity = 1;
45+
}
46+
}
1347

1448
message TestResult {
1549
string name = 1;
@@ -35,21 +69,8 @@ message TestPlan {
3569
message TestPlanResponse {}
3670

3771
message SetCameraTransformTestCommand {
38-
Vector3 position = 1;
39-
Quaternion rotation = 2;
40-
41-
message Vector3 {
42-
float x = 1;
43-
float y = 2;
44-
float z = 3;
45-
}
46-
47-
message Quaternion {
48-
float x = 1;
49-
float y = 2;
50-
float z = 3;
51-
float w = 4;
52-
}
72+
decentraland.common.Vector3 position = 1;
73+
decentraland.common.Quaternion rotation = 2;
5374
}
5475
message SetCameraTransformTestCommandResponse {}
5576

0 commit comments

Comments
 (0)