|
1 | 1 | *** Settings ***
|
2 |
| -Library AltTesterLibrary |
3 |
| -Library BuiltIn |
4 |
| -Library Collections |
5 |
| -Suite Setup Initialize AltDriver With Custom Host And Port |
6 |
| -Test Setup SetUp Tests |
| 2 | +Library AltTesterLibrary |
| 3 | +Library BuiltIn |
| 4 | +Library Collections |
| 5 | +Suite Setup Initialize AltDriver With Custom Host And Port |
| 6 | +Test Setup SetUp Tests |
7 | 7 | Suite Teardown Stop Altdriver
|
8 |
| -Resource utils_keywords.robot |
| 8 | +Resource utils_keywords.robot |
9 | 9 |
|
10 | 10 | *** Test Cases ***
|
11 | 11 | Test Pointer Enter And Exit
|
12 |
| - ${alt_object}= Find Object NAME Drop Image |
13 |
| - ${color1}= Get Component Property ${alt_object} AltExampleScriptDropMe highlightColor Assembly-CSharp |
14 |
| - Pointer Enter ${alt_object} |
15 |
| - ${color2}= Get Component Property ${alt_object} AltExampleScriptDropMe highlightColor Assembly-CSharp |
16 |
| - ${color1_r}= Get Percent From Specific Color ${color1} r |
17 |
| - ${color1_g}= Get Percent From Specific Color ${color1} g |
18 |
| - ${color1_b}= Get Percent From Specific Color ${color1} b |
19 |
| - ${color1_a}= Get Percent From Specific Color ${color1} a |
20 |
| - ${color2_r}= Get Percent From Specific Color ${color2} r |
21 |
| - ${color2_g}= Get Percent From Specific Color ${color2} g |
22 |
| - ${color2_b}= Get Percent From Specific Color ${color2} b |
23 |
| - ${color2_a}= Get Percent From Specific Color ${color2} a |
24 |
| - Evaluate ${color1_r}!=${color2_r} or ${color1_g}!=${color2_g} or ${color1_b}!=${color2_b} or ${color1_a}!=${color2_a} |
25 |
| - Pointer Exit ${alt_object} |
26 |
| - ${color3}= Get Component Property ${alt_object} AltExampleScriptDropMe highlightColor Assembly-CSharp |
27 |
| - ${color3_r}= Get Percent From Specific Color ${color3} r |
28 |
| - ${color3_g}= Get Percent From Specific Color ${color3} g |
29 |
| - ${color3_b}= Get Percent From Specific Color ${color3} b |
30 |
| - ${color3_a}= Get Percent From Specific Color ${color3} a |
31 |
| - Evaluate ${color3_r}!=${color2_r} or ${color3_g}!=${color2_g} or ${color3_b}!=${color2_b} or ${color3_a}!=${color2_a} |
32 |
| - Evaluate ${color1_r}!=${color3_r} or ${color1_g}!=${color3_g} or ${color1_b}!=${color3_b} or ${color1_a}!=${color3_a} |
| 12 | + ${alt_object}= Find Object NAME Drop Image |
| 13 | + ${color1}= Get Component Property ${alt_object} AltExampleScriptDropMe highlightColor Assembly-CSharp |
| 14 | + Pointer Enter ${alt_object} |
| 15 | + ${color2}= Get Component Property ${alt_object} AltExampleScriptDropMe highlightColor Assembly-CSharp |
| 16 | + ${color1_r}= Get Percent From Specific Color ${color1} r |
| 17 | + ${color1_g}= Get Percent From Specific Color ${color1} g |
| 18 | + ${color1_b}= Get Percent From Specific Color ${color1} b |
| 19 | + ${color1_a}= Get Percent From Specific Color ${color1} a |
| 20 | + ${color2_r}= Get Percent From Specific Color ${color2} r |
| 21 | + ${color2_g}= Get Percent From Specific Color ${color2} g |
| 22 | + ${color2_b}= Get Percent From Specific Color ${color2} b |
| 23 | + ${color2_a}= Get Percent From Specific Color ${color2} a |
| 24 | + Evaluate ${color1_r}!=${color2_r} or ${color1_g}!=${color2_g} or ${color1_b}!=${color2_b} or ${color1_a}!=${color2_a} |
| 25 | + Pointer Exit ${alt_object} |
| 26 | + ${color3}= Get Component Property ${alt_object} AltExampleScriptDropMe highlightColor Assembly-CSharp |
| 27 | + ${color3_r}= Get Percent From Specific Color ${color3} r |
| 28 | + ${color3_g}= Get Percent From Specific Color ${color3} g |
| 29 | + ${color3_b}= Get Percent From Specific Color ${color3} b |
| 30 | + ${color3_a}= Get Percent From Specific Color ${color3} a |
| 31 | + Evaluate ${color3_r}!=${color2_r} or ${color3_g}!=${color2_g} or ${color3_b}!=${color2_b} or ${color3_a}!=${color2_a} |
| 32 | + Evaluate ${color1_r}!=${color3_r} or ${color1_g}!=${color3_g} or ${color1_b}!=${color3_b} or ${color1_a}!=${color3_a} |
33 | 33 |
|
34 | 34 | Test Multiple Swipes
|
35 |
| - Drop Image Drag Image2 Drop Box2 1 ${False} |
36 |
| - Drop Image Drag Image2 Drop Box1 1 ${False} |
37 |
| - Drop Image Drag Image1 Drop Box1 2 ${False} |
38 |
| - Wait For Swipe To Finish |
39 |
| - ${image_source} ${image_source_drop_zone}= Get Sprite Name Drag Image1 Drop Image |
40 |
| - Should Be Equal ${image_source} ${image_source_drop_zone} |
41 |
| - ${image_source} ${image_source_drop_zone}= Get Sprite Name Drag Image2 Drop |
42 |
| - Should Be Equal ${image_source} ${image_source_drop_zone} |
| 35 | + Drop Image Drag Image2 Drop Box2 1 ${False} |
| 36 | + Drop Image Drag Image2 Drop Box1 1 ${False} |
| 37 | + Drop Image Drag Image1 Drop Box1 2 ${False} |
| 38 | + Wait For Swipe To Finish |
| 39 | + ${image_source} ${image_source_drop_zone}= Get Sprite Name Drag Image1 Drop Image |
| 40 | + Should Be Equal ${image_source} ${image_source_drop_zone} |
| 41 | + ${image_source} ${image_source_drop_zone}= Get Sprite Name Drag Image2 Drop |
| 42 | + Should Be Equal ${image_source} ${image_source_drop_zone} |
43 | 43 |
|
44 | 44 | Test Multiple Swipe And Waits
|
45 |
| - Drop Image Drag Image2 Drop Box2 1 ${True} |
46 |
| - Drop Image Drag Image2 Drop Box1 1 ${True} |
47 |
| - Drop Image Drag Image1 Drop Box1 1 ${True} |
48 |
| - ${image_source} ${image_source_drop_zone}= Get Sprite Name Drag Image1 Drop Image |
49 |
| - Should Be Equal ${image_source} ${image_source_drop_zone} |
50 |
| - ${image_source} ${image_source_drop_zone}= Get Sprite Name Drag Image2 Drop |
51 |
| - Should Be Equal ${image_source} ${image_source_drop_zone} |
| 45 | + Drop Image Drag Image2 Drop Box2 1 ${True} |
| 46 | + Drop Image Drag Image2 Drop Box1 1 ${True} |
| 47 | + Drop Image Drag Image1 Drop Box1 1 ${True} |
| 48 | + ${image_source} ${image_source_drop_zone}= Get Sprite Name Drag Image1 Drop Image |
| 49 | + Should Be Equal ${image_source} ${image_source_drop_zone} |
| 50 | + ${image_source} ${image_source_drop_zone}= Get Sprite Name Drag Image2 Drop |
| 51 | + Should Be Equal ${image_source} ${image_source_drop_zone} |
52 | 52 |
|
53 | 53 | Test Multiple Swipe With Multipoint Swipe
|
54 |
| - ${list1}= Create List Drag Image1 Drop Box1 |
55 |
| - ${list2}= Create List Drag Image2 Drop Box1 Drop Box2 |
56 |
| - Drop Image With Multipoint Swipe ${list1} 1 ${False} |
57 |
| - Drop Image With Multipoint Swipe ${list2} 1 ${False} |
58 |
| - ${image_source} ${image_source_drop_zone}= Get Sprite Name Drag Image1 Drop Image |
59 |
| - Should Be Equal ${image_source} ${image_source_drop_zone} |
60 |
| - ${image_source} ${image_source_drop_zone}= Get Sprite Name Drag Image2 Drop |
61 |
| - Should Be Equal ${image_source} ${image_source_drop_zone} |
| 54 | + ${list1}= Create List Drag Image1 Drop Box1 |
| 55 | + ${list2}= Create List Drag Image2 Drop Box1 Drop Box2 |
| 56 | + Drop Image With Multipoint Swipe ${list1} 1 ${False} |
| 57 | + Drop Image With Multipoint Swipe ${list2} 1 ${True} |
| 58 | + ${image_source} ${image_source_drop_zone}= Get Sprite Name Drag Image1 Drop Image |
| 59 | + Should Be Equal ${image_source} ${image_source_drop_zone} |
| 60 | + ${image_source} ${image_source_drop_zone}= Get Sprite Name Drag Image2 Drop |
| 61 | + Should Be Equal ${image_source} ${image_source_drop_zone} |
62 | 62 |
|
63 | 63 | Test Multiple Swipe And Waits With Multipoint Swipe
|
64 |
| - ${list1}= Create List Drag Image1 Drop Box1 |
65 |
| - ${list2}= Create List Drag Image2 Drop Box1 Drop Box2 |
66 |
| - Drop Image With Multipoint Swipe ${list1} 1 ${True} |
67 |
| - Drop Image With Multipoint Swipe ${list2} 1 ${True} |
68 |
| - ${image_source} ${image_source_drop_zone}= Get Sprite Name Drag Image1 Drop Image |
69 |
| - Should Be Equal ${image_source} ${image_source_drop_zone} |
70 |
| - ${image_source} ${image_source_drop_zone}= Get Sprite Name Drag Image2 Drop |
71 |
| - Should Be Equal ${image_source} ${image_source_drop_zone} |
| 64 | + ${list1}= Create List Drag Image1 Drop Box1 |
| 65 | + ${list2}= Create List Drag Image2 Drop Box1 Drop Box2 |
| 66 | + Drop Image With Multipoint Swipe ${list1} 1 ${True} |
| 67 | + Drop Image With Multipoint Swipe ${list2} 1 ${True} |
| 68 | + ${image_source} ${image_source_drop_zone}= Get Sprite Name Drag Image1 Drop Image |
| 69 | + Should Be Equal ${image_source} ${image_source_drop_zone} |
| 70 | + ${image_source} ${image_source_drop_zone}= Get Sprite Name Drag Image2 Drop |
| 71 | + Should Be Equal ${image_source} ${image_source_drop_zone} |
72 | 72 |
|
73 | 73 | Test Begin Move End Touch
|
74 |
| - ${alt_object1}= Find Object NAME Drag Image1 |
75 |
| - ${alt_object2}= Find Object NAME Drop Box1 |
76 |
| - ${coordinates_begin}= Get Screen Position ${alt_object1} |
77 |
| - ${coordinates_finish}= Get Screen Position ${alt_object2} |
78 |
| - ${id}= Begin Touch ${coordinates_begin} |
79 |
| - Move Touch ${id} ${coordinates_finish} |
80 |
| - End Touch ${id} |
81 |
| - ${image_source}= Get Component Property ${alt_object1} UnityEngine.UI.Image sprite.name UnityEngine.UI |
82 |
| - ${alt_object}= Find Object NAME Drop Image |
83 |
| - ${image_source_drop_zone}= Get Component Property ${alt_object} UnityEngine.UI.Image sprite.name UnityEngine.UI |
84 |
| - Should Be Equal ${image_source} ${image_source_drop_zone} |
| 74 | + ${alt_object1}= Find Object NAME Drag Image1 |
| 75 | + ${alt_object2}= Find Object NAME Drop Box1 |
| 76 | + ${coordinates_begin}= Get Screen Position ${alt_object1} |
| 77 | + ${coordinates_finish}= Get Screen Position ${alt_object2} |
| 78 | + ${id}= Begin Touch ${coordinates_begin} |
| 79 | + Move Touch ${id} ${coordinates_finish} |
| 80 | + End Touch ${id} |
| 81 | + ${image_source}= Get Component Property ${alt_object1} UnityEngine.UI.Image sprite.name UnityEngine.UI |
| 82 | + ${alt_object}= Find Object NAME Drop Image |
| 83 | + ${image_source_drop_zone}= Get Component Property ${alt_object} UnityEngine.UI.Image sprite.name UnityEngine.UI |
| 84 | + Should Be Equal ${image_source} ${image_source_drop_zone} |
85 | 85 |
|
86 | 86 | *** Keywords ***
|
87 | 87 | SetUp Tests
|
88 |
| - Reset Input |
89 |
| - Load Scene ${scene3} |
| 88 | + Reset Input |
| 89 | + Load Scene ${scene3} |
90 | 90 |
|
91 | 91 | Wait For Swipe To Finish
|
92 |
| - Wait For Object To Not Be Present NAME icon |
| 92 | + Wait For Object To Not Be Present NAME icon |
93 | 93 |
|
94 | 94 | Drop Image
|
95 |
| - [Arguments] ${drag_location_name} ${drop_location_name} ${duration} ${wait} |
96 |
| - ${drag_location}= Find Object NAME ${drag_location_name} |
97 |
| - ${drop_location}= Find Object NAME ${drop_location_name} |
98 |
| - ${drag_location_position}= Get Screen Position ${drag_location} |
99 |
| - ${drop_location_position}= Get Screen Position ${drop_location} |
100 |
| - Swipe ${drag_location_position} ${drop_location_position} duration=${duration} wait=${wait} |
| 95 | + [Arguments] ${drag_location_name} ${drop_location_name} ${duration} ${wait} |
| 96 | + ${drag_location}= Find Object NAME ${drag_location_name} |
| 97 | + ${drop_location}= Find Object NAME ${drop_location_name} |
| 98 | + ${drag_location_position}= Get Screen Position ${drag_location} |
| 99 | + ${drop_location_position}= Get Screen Position ${drop_location} |
| 100 | + Swipe ${drag_location_position} ${drop_location_position} duration=${duration} wait=${wait} |
101 | 101 |
|
102 | 102 | Get Percent From Specific Color
|
103 |
| - [Arguments] ${alt_object} ${color} |
104 |
| - ${percent}= Collections.Get From Dictionary ${alt_object} ${color} |
105 |
| - Return From Keyword ${percent} |
| 103 | + [Arguments] ${alt_object} ${color} |
| 104 | + ${percent}= Collections.Get From Dictionary ${alt_object} ${color} |
| 105 | + Return From Keyword ${percent} |
0 commit comments