mirror of
https://github.com/divkit/divkit.git
synced 2026-05-07 20:02:32 +00:00
201be941c9
commit_hash:fd6e36a8ea96d96b9a00bac60a72f213c5f2dc0e
172 lines
3.7 KiB
JSON
172 lines
3.7 KiB
JSON
{
|
|
"description": "TODO: https://nda.ya.ru/t/MMvpmt855oXgre",
|
|
"platforms": [
|
|
"android",
|
|
"ios",
|
|
"web"
|
|
],
|
|
"div_data": {
|
|
"templates": {
|
|
"text_block": {
|
|
"type": "text",
|
|
"font_size": 14,
|
|
"text_alignment_horizontal": "center",
|
|
"text_alignment_vertical": "center",
|
|
"alignment_horizontal": "center",
|
|
"text_color": "#1ABC9C",
|
|
"paddings": {
|
|
"top": 4,
|
|
"bottom": 4,
|
|
"left": 8,
|
|
"right": 8
|
|
},
|
|
"margins": {
|
|
"bottom": 4
|
|
},
|
|
"width": {
|
|
"type": "fixed",
|
|
"value": 200
|
|
},
|
|
"height": {
|
|
"type": "fixed",
|
|
"value": 80
|
|
},
|
|
"background": [
|
|
{
|
|
"type": "solid",
|
|
"color": "#34495E"
|
|
}
|
|
],
|
|
"border": {
|
|
"corner_radius": 6
|
|
}
|
|
}
|
|
},
|
|
"card": {
|
|
"log_id": "sample_card",
|
|
"variables": [
|
|
{
|
|
"name": "total_likes",
|
|
"type": "integer",
|
|
"value": 0
|
|
},
|
|
{
|
|
"name": "trigger_state",
|
|
"type": "string",
|
|
"value": "unset"
|
|
}
|
|
],
|
|
"variable_triggers": [
|
|
{
|
|
"condition": "@{total_likes > 100}",
|
|
"mode": "on_variable",
|
|
"actions": [
|
|
{
|
|
"log_id": "trigger_invoke",
|
|
"url": "div-action://set_variable?name=trigger_state&value=activated"
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"states": [
|
|
{
|
|
"state_id": 0,
|
|
"div": {
|
|
"type": "container",
|
|
"orientation": "vertical",
|
|
"margins": {
|
|
"bottom": 48
|
|
},
|
|
"items": [
|
|
{
|
|
"type": "text_block",
|
|
"text": "Total likes: @{total_likes}"
|
|
},
|
|
{
|
|
"type": "text_block",
|
|
"text": "Var mode trigger count > 100: @{trigger_state}"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"steps": [
|
|
{
|
|
"expected_screenshot": "step0.png"
|
|
},
|
|
{
|
|
"div_actions": [
|
|
{
|
|
"url": "div-action://set_variable?name=total_likes&value=50",
|
|
"log_id": "set_50"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"div_actions": [
|
|
{
|
|
"url": "div-action://set_variable?name=total_likes&value=110",
|
|
"log_id": "set_110"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"div_actions": [
|
|
{
|
|
"url": "div-action://set_variable?name=trigger_state&value=unset",
|
|
"log_id": "reset_trigger_state"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"div_actions": [
|
|
{
|
|
"url": "div-action://set_variable?name=total_likes&value=130",
|
|
"log_id": "set_130"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"div_actions": [
|
|
{
|
|
"url": "div-action://set_variable?name=trigger_state&value=unset",
|
|
"log_id": "reset_trigger_state"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"div_actions": [
|
|
{
|
|
"url": "div-action://set_variable?name=total_likes&value=50",
|
|
"log_id": "repeat_set_50 (to trigger variable change)"
|
|
},
|
|
{
|
|
"url": "div-action://set_variable?name=total_likes&value=130",
|
|
"log_id": "repeat_set_130"
|
|
}
|
|
],
|
|
"expected_screenshot": "step4.png"
|
|
},
|
|
{
|
|
"div_actions": [
|
|
{
|
|
"url": "div-action://set_variable?name=trigger_state&value=unset",
|
|
"log_id": "reset_trigger_state"
|
|
}
|
|
],
|
|
"expected_screenshot": "step5.png"
|
|
},
|
|
{
|
|
"div_actions": [
|
|
{
|
|
"url": "div-action://set_variable?name=total_likes&value=50",
|
|
"log_id": "set_50"
|
|
}
|
|
],
|
|
"expected_screenshot": "step1.png"
|
|
}
|
|
]
|
|
}
|