{"id":471448,"date":"2025-08-21T15:00:13","date_gmt":"2025-08-21T15:00:13","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=471448"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=471448","title":{"rendered":"<span>\u0425\u043e\u043b\u0441\u0442 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0430: \u0424\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u044b \u0441 Canvas<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u043a\u043e\u0433\u0434\u0430-\u043b\u0438\u0431\u043e \u043f\u0438\u0441\u0430\u043b\u0438 \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u044b \u0434\u043b\u044f \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0441 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c canvas, \u0442\u043e \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u0437\u043d\u0430\u0435\u0442\u0435, \u043a\u0430\u043a \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u043f\u0440\u043e\u0441\u0442\u043e. Canvas \u2014 \u044d\u0442\u043e &#171;\u0447\u0451\u0440\u043d\u044b\u0439 \u044f\u0449\u0438\u043a&#187;, \u0433\u0434\u0435 \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b UI-\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0435\u0441\u0441\u0438\u043b\u044c\u043d\u044b: \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0435\u0442 DOM-\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, \u0437\u0430 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0446\u0435\u043f\u0438\u0442\u044c\u0441\u044f. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435 canvas \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0447\u0442\u043e \u0443\u0433\u043e\u0434\u043d\u043e \u2014 \u043e\u0442 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432 \u0441 \u043e\u0441\u044f\u043c\u0438 X \u0438 Y \u0434\u043e \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0439.<\/p>\n<p>\u0425\u043e\u0442\u0438\u0442\u0435 \u0443\u0437\u043d\u0430\u0442\u044c, \u043a\u0430\u043a \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 canvas \u0431\u0435\u0437 \u043b\u0438\u0448\u043d\u0435\u0439 \u0431\u043e\u043b\u0438? \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c\u0441\u044f \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d21\/03e\/cc9\/d2103ecc92d110aceb8b076b1f6d86af.png\" alt=\"\u041f\u0440\u0438\u043c\u0435\u0440 \u0433\u0440\u0430\u0444\u0438\u043a\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0432 canvas\" title=\"\u041f\u0440\u0438\u043c\u0435\u0440 \u0433\u0440\u0430\u0444\u0438\u043a\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0432 canvas\" width=\"1644\" height=\"858\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/d21\/03e\/cc9\/d2103ecc92d110aceb8b076b1f6d86af.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d21\/03e\/cc9\/d2103ecc92d110aceb8b076b1f6d86af.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u041f\u0440\u0438\u043c\u0435\u0440 \u0433\u0440\u0430\u0444\u0438\u043a\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0432 canvas<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/75e\/4aa\/23f\/75e4aa23fff81e9c3d787318491e1051.png\" alt=\"html \u043a\u043e\u0434 canvas \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\" title=\"html \u043a\u043e\u0434 canvas \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\" width=\"2500\" height=\"948\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/75e\/4aa\/23f\/75e4aa23fff81e9c3d787318491e1051.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/75e\/4aa\/23f\/75e4aa23fff81e9c3d787318491e1051.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>html \u043a\u043e\u0434 canvas \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430<\/figcaption><\/div>\n<\/figure>\n<h2>\ud83d\udcf8 \u0412 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c: \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435\/\u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u043d\u043e\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/h2>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a canvas \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u0433\u0440\u0430\u0444\u0438\u043a\u0438, \u043e\u0447\u0435\u043d\u044c \u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u043d\u044b\u043c \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c. <br \/>\u0415\u0441\u043b\u0438 \u0432\u044b, \u043a\u0430\u043a \u0438 \u044f, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 TS \u0438 Playwright, \u0442\u043e <a href=\"https:\/\/playwright.dev\/docs\/test-snapshots\" rel=\"noopener noreferrer nofollow\">\u0432\u043e\u0442 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043d\u0430 \u044d\u0442\u0443 \u0442\u0435\u043c\u0443<\/a>.<br \/>\u0422\u0430\u043a \u0436\u0435, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u0432\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u043c\u0435\u043d\u0438\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u044b \u0431\u0435\u043a\u0430, \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0431\u044b \u0438\u043c\u0435\u0442\u044c \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435 \u0438 <a href=\"https:\/\/playwright.dev\/docs\/mock#modify-api-responses\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0432\u0430\u0448\u0438\u0445 \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u0430\u0445<\/a>.<br \/>\u041d\u0430 \u0441\u043b\u0443\u0447\u0430\u0439, <a href=\"https:\/\/playwright.dev\/docs\/mock#mock-websockets\" rel=\"noopener noreferrer nofollow\">\u0435\u0441\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0433\u0440\u0430\u0444\u0438\u043a\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0435 \u043f\u043e web socket<\/a>.<\/p>\n<h2>\ud83e\udd14 \u0427\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c, \u043a\u043e\u0433\u0434\u0430 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0439 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e<\/h2>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430, \u044f \u043f\u043e\u043a\u0430\u0436\u0443 \u043f\u0440\u0438\u043c\u0435\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0441 \u043d\u0430\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u043c\/\u043a\u043b\u0438\u043a\u0430\u043c\u0438 \u043f\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u0432\u043d\u0443\u0442\u0440\u0438 \u0433\u0440\u0430\u0444\u0438\u043a\u0430:<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/95c\/f31\/728\/95cf317285149be707d76c0bf83e5117.gif\" alt=\"\u0412\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435\u043c \u0441 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 canvas\" title=\"\u0412\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435\u043c \u0441 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 canvas\" width=\"848\" height=\"432\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/95c\/f31\/728\/95cf317285149be707d76c0bf83e5117.gif 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/95c\/f31\/728\/95cf317285149be707d76c0bf83e5117.gif 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u0412\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435\u043c \u0441 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 canvas<\/figcaption><\/div>\n<\/figure>\n<p>\u0422\u0443\u043b\u0442\u0438\u043f \u0438 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u043e\u0435 \u043c\u0435\u043d\u044e &#8212; \u043e\u0431\u044b\u0447\u043d\u044b\u0435 \u0432\u0435\u0431 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0432 DOM, \u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0431\u044b \u0438\u0445 \u0432\u044b\u0437\u0432\u0430\u0442\u044c, \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 canvas.<\/p>\n<p>\u0418\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 Playwright, \u043a\u0430\u043a \u0432\u043f\u0440\u043e\u0447\u0435\u043c, \u0438 \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f UI \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f &#8212; \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442 \u0432\u0430\u043c \u043d\u0438\u0447\u0435\u0433\u043e \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442\u044c, \u043a\u0440\u043e\u043c\u0435 \u043d\u0430\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043a\u0443\u0440\u0441\u043e\u0440\u0430 \u043f\u043e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c. <br \/>\u0421\u0440\u0430\u0437\u0443 \u043e\u0442\u043c\u0435\u0447\u0443, \u0447\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0445\u0430\u0440\u0434\u043a\u043e\u0434\u043d\u043e \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0437\u0432\u0443\u0447\u0438\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043d\u0435\u043d\u0430\u0434\u0435\u0436\u043d\u043e, \u0438 \u044f \u043c\u044b\u0441\u043b\u0435\u043d\u043d\u043e \u0443\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043b, \u043a\u0430\u043a \u043d\u0430 \u043c\u043e\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043b\u043e\u0436\u043d\u043e \u0443\u043f\u0430\u043b\u0438 50-100 \u0442\u0435\u0441\u0442\u043e\u0432, \u0438\u0437-\u0437\u0430 \u043d\u0435\u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 \u0433\u0440\u0430\u0444\u0438\u043a\u0435 \u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b.<\/p>\n<p>\u0410 \u0432\u0432\u043e\u0434 \u0447\u0435\u0440\u0435\u0437 API canvas \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0447\u0435\u0440\u0435\u0437 JavaScript \u043d\u0435 \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435  \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. <\/p>\n<h2>\u2705 \u0415\u0441\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435! <\/h2>\n<p>\u0412\u043e\u0442 \u043c\u044b \u043f\u043b\u0430\u0432\u043d\u043e \u0438 \u043f\u043e\u0434\u043e\u0448\u043b\u0438 \u043a \u0442\u043e\u043c\u0443, \u043a\u0430\u043a \u044f \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0440\u0435\u0448\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 &#8212; \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <a href=\"https:\/\/github.com\/old-door\/qa-playground\/blob\/main\/tests\/src\/utils\/color\/color.utils.ts#L71\" rel=\"noopener noreferrer nofollow\">findColorCoordinates<\/a> , \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0430 \u0432\u0445\u043e\u0434 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043e\u043f\u0446\u0438\u0438, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u043b\u043e\u043a\u0430\u0442\u043e\u0440, \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0446\u0432\u0435\u0442 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 canvas \u0438 \u0440\u044f\u0434 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u043f\u043e\u0438\u0441\u043a\u0430 \u0438\u043b\u0438 \u043f\u043e\u0433\u0440\u0435\u0448\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0438 \u043f\u043e\u0438\u0441\u043a\u0435 \u0446\u0432\u0435\u0442\u0430, \u0430 \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u0434\u0430\u0435\u0442 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b &#171;x&#187; \u0438 &#171;y&#187;:  <\/p>\n<pre><code class=\"typescript\">import { expect } from '@playwright\/test' import sharp from 'sharp' import { test } from '..\/..\/fixtures' import { ColorSearchPatternOptions, FindColorCoordinatesOptions, RgbaColor, RgbColor } from '.\/types'  export function findColorCoordinates(   options: FindColorCoordinatesOptions, ): Promise&lt;{ x: number; y: number } | null&gt; {   const {     targetColorRgb,     paddingPercent = {       top: 2,       bottom: 2,       left: 2,       right: 2,     },     locator,     colorDiffThreshold = 6,     searchPattern = 'adaptiveStep',     stepSize   } = options ?? {}    return test.step(`Find color: \"${targetColorRgb}\" coords`, async () =&gt; {     const targetColor = stringToRgb(targetColorRgb)     \/\/ Get bounding box of the element     const boundingBox = (await locator.boundingBox())!     expect(boundingBox, `Locator bounding box not to be null`).not.toBeNull()      const dataURL = await locator.evaluate((element) =&gt; {       const canvas = element as HTMLCanvasElement       return canvas.toDataURL('image\/png') \/\/ PNG as Data URL     })      \/\/ Data URL -&gt; Buffer     const buffer = Buffer.from(dataURL.split(',')[1], 'base64')      const { data: imageData, info } = await sharp(buffer)       .ensureAlpha()       .raw()       .toBuffer({ resolveWithObject: true })      const width = info.width     const height = info.height     const paddingXLeft = Math.floor(width * ((paddingPercent.left ?? 0) \/ 100))     const paddingXRight = Math.floor(width * ((paddingPercent.right ?? 0) \/ 100))     const paddingYTop = Math.floor(height * ((paddingPercent.top ?? 0) \/ 100))     const paddingYBottom = Math.floor(height * ((paddingPercent.bottom ?? 0) \/ 100))      const searchPatternOptions: ColorSearchPatternOptions = {       imageData,       targetColor,       width,       height,       colorDiffThreshold,       startX: Math.max(paddingXLeft, 0),       startY: Math.max(paddingYTop, 0),       endX: width - paddingXRight,       endY: height - paddingYBottom,       offsetX: boundingBox.x,       offsetY: boundingBox.y,     }      switch (searchPattern) {       case 'spiral':         return spiralSearchPattern(searchPatternOptions)       case 'vertical':         return verticalSearchPattern(searchPatternOptions)       case 'horizontal':         return horizontalSearchPattern(searchPatternOptions)       case 'adaptiveStep':         return adaptiveStepSearchPattern({...searchPatternOptions, stepSize})       default:         return null     }   }) }<\/code><\/pre>\n<p>\u0418 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u0432 \u043f\u043e\u0438\u0441\u043a\u0430:<\/p>\n<pre><code class=\"typescript\">function horizontalSearchPattern(options: ColorSearchPatternOptions) {   const {      imageData, targetColor, width, startX, endX, startY, endY, offsetX, offsetY, colorDiffThreshold    } = options   for (let y = startY; y &lt; endY; y++) {     for (let x = startX; x &lt; endX; x++) {       const index = (y * width + x) * 4 \/\/ 4 bytes per pixel (RGBA)       const color = {         r: imageData[index],         g: imageData[index + 1],         b: imageData[index + 2],         a: imageData[index + 3],       }       const diff = deltaE(color, targetColor)       if (diff &lt; colorDiffThreshold) {         return { x: x + offsetX, y: y + offsetY }       }     }   }   return null }<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u043c, \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c API canvas \u0434\u043b\u044f \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u044e\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <a href=\"https:\/\/www.npmjs.com\/package\/sharp\" rel=\"noopener noreferrer nofollow\">sharp<\/a>, \u043a \u0441\u043b\u043e\u0432\u0443, \u043e\u043d\u0430 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u0430, \u0434\u043b\u044f \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 imageData: Buffer&lt;<em>ArrayBufferLike<\/em>&gt; , \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0446\u0432\u0435\u0442\u0430\u0445 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u0438\u043a\u0441\u0435\u043b\u044f \u043d\u0430 canvas.<\/p>\n<p>\u042f \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b \u0440\u0430\u0437\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 (\u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u0435 image data \u0438\u0437 API Canvas) \u0438 <a href=\"https:\/\/www.npmjs.com\/package\/sharp\" rel=\"noopener noreferrer nofollow\">sharp<\/a> \u0437\u0430\u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u043e\u0432\u0430\u043b \u0441\u0435\u0431\u044f, \u043a\u0430\u043a \u0441\u0430\u043c\u044b\u0439 \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0438 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u0439.  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0434\u0440\u0443\u0433 \u0432\u044b \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442\u0435\u0441\u044c, \u043f\u043e\u0447\u0435\u043c\u0443 \u044f \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u044e \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430, \u0442\u043e \u043e\u0442\u0432\u0435\u0442 \u043e\u043f\u044f\u0442\u044c \u0436\u0435 \u0432 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f &#8212; \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c \u043f\u043e\u0440\u044f\u0434\u043a\u0430 <strong>80ms<\/strong>. \u0412 \u043c\u043e\u0435\u043c \u0436\u0435 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f, \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0438 800&#215;400, \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f <strong>20-40ms<\/strong>, \u0447\u0442\u043e \u0432\u043f\u043e\u043b\u043d\u0435 \u043f\u0440\u0438\u0435\u043c\u043b\u0435\u043c\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442.<\/p>\n<h2>\ud83e\uddea \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0432 \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u0430\u0445<\/h2>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1d9\/16f\/b96\/1d916fb96f05e69677193e9f446d5cef.gif\" alt=\"findColorCoordinates \u043f\u0440\u043e\u0442\u0438\u0432 canvas\" title=\"findColorCoordinates \u043f\u0440\u043e\u0442\u0438\u0432 canvas\" width=\"848\" height=\"528\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1d9\/16f\/b96\/1d916fb96f05e69677193e9f446d5cef.gif 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1d9\/16f\/b96\/1d916fb96f05e69677193e9f446d5cef.gif 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption><a href=\"https:\/\/github.com\/old-door\/qa-playground\/blob\/main\/tests\/src\/utils\/color\/color.utils.ts#L71\" rel=\"noopener noreferrer nofollow\">findColorCoordinates<\/a> \u043f\u0440\u043e\u0442\u0438\u0432 canvas<\/figcaption><\/div>\n<\/figure>\n<p>\u0412 \u043b\u0435\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u044d\u043a\u0440\u0430\u043d\u0430 &#8212; \u0442\u0435\u0441\u0442 \u0448\u0430\u0433\u0438, \u0430 \u0441\u043f\u0440\u0430\u0432\u0430 \u0432\u0435\u0431 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0442\u0435\u0441\u0442 \u0448\u0430\u0433\u043e\u0432, \u0442\u0430\u043a \u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043a\u0440\u0430\u0441\u043d\u044b\u0435 \u0442\u043e\u0447\u043a\u0438 &#8212; \u0438\u043c\u0438 \u043e\u0442\u043c\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u043a\u0443\u0440\u0441\u043e\u0440, \u043f\u0440\u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438 \u0441 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u044f\u0445 \u043c\u044b\u0448\u043a\u0438. \u041d\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b\u0445 \u043a\u0430\u0434\u0440\u0430\u0445 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u044b \u0431\u0435\u0437 \u0442\u0440\u0443\u0434\u0430 \u043d\u0430\u0445\u043e\u0434\u044f\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0435.<\/p>\n<p>\u0420\u0430\u0437\u0431\u0435\u0440\u0435\u043c\u0441\u044f, \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 Playwright \u0442\u0435\u0441\u0442 \u0441\u043f\u0435\u043a\u0438 <a href=\"https:\/\/github.com\/old-door\/qa-playground\/blob\/main\/tests\/specs\/chart.spec.ts\" rel=\"noopener noreferrer nofollow\">chart.spec.ts<\/a>. \u041d\u0438\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043a\u043e\u0434 \u0442\u0435\u0441\u0442\u0430:<\/p>\n<pre><code class=\"typescript\">const defaultItem = 'Item1' const allItems = [defaultItem, 'Item2', 'Item3'] const screenshotName = 'empty.png'  test(`Disable all items via context menu`, async ({ chartPage }) =&gt; {     for (const item of allItems) {       await chartPage.locators.legendItemCheckbox(item).check()       await chartPage.validateItemIsVisible(item)       await chartPage.openItemContextMenu(item)       await chartPage.locators.hideItemContexMenuOption().click()       await chartPage.validateItemIsHidden(item)     }     await expect(chartPage.locators.chart()).toHaveScreenshot(screenshotName)   })<\/code><\/pre>\n<p><a href=\"https:\/\/github.com\/old-door\/qa-playground\/blob\/main\/tests\/src\/fixtures\/pages.fixtures.ts\" rel=\"noopener noreferrer nofollow\">chartPage<\/a> &#8212; \u0444\u0438\u043a\u0441\u0442\u0443\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0442\u0440\u044b\u0432\u0430\u0435\u0442 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0441 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u043c.<br \/>\u041b\u043e\u0433\u0438\u043a\u0430 \u043f\u043e \u043f\u043e\u0438\u0441\u043a\u0443 \u0446\u0432\u0435\u0442\u0430, \u043b\u0435\u0436\u0438\u0442 \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0430\u043c\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b <a href=\"https:\/\/github.com\/old-door\/qa-playground\/blob\/main\/tests\/src\/pages\/chart\/chart.page.ts\" rel=\"noopener noreferrer nofollow\">ChartPage<\/a>.<br \/>\u0422.\u043a. \u0437\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u0443 \u0433\u0440\u0430\u0444\u0438\u043a\u0430 \u0435\u0441\u0442\u044c \u043b\u0435\u0433\u0435\u043d\u0434\u0430, \u0430 \u0432 \u043b\u0435\u0433\u0435\u043d\u0434\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0446\u0432\u0435\u0442\u0430, \u0442\u043e \u0442\u0430\u043a \u0436\u0435 \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u0438 \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0438 \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043b\u0435\u0433\u0435\u043d\u0434\u044b, \u043c\u044b \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c \u0446\u0432\u0435\u0442 \u0438 \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u043c, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043a\u0430\u0442\u044c \u043d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0435:<\/p>\n<pre><code class=\"typescript\">export class ChartPage extends BasePage {   \/\/ ...   private getItemColor(name: string): Promise&lt;string&gt; {       return test.step(`Get \"${name}\" legend item color`, ()=&gt; {         return this.locators.legendItem()           .filter({hasText: name})           .evaluate((element) =&gt; {             const styles = window.getComputedStyle(element)             return styles.color           })       })     }        private async getItemCoordinates(name: string): Promise&lt;{ x: number; y: number } | null&gt; {       const targetColorRgb = await this.getItemColor(name)       return findColorCoordinates({         targetColorRgb,         locator: this.locators.chart()       })     }   \/\/ ...   }<\/code><\/pre>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/5e7\/0b6\/841\/5e70b684100b37e05ad002f412b2561a.png\" alt=\"\u041b\u0435\u0433\u0435\u043d\u0434\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0446\u0432\u0435\u0442\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432\" title=\"\u041b\u0435\u0433\u0435\u043d\u0434\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0446\u0432\u0435\u0442\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432\" width=\"2492\" height=\"1052\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/5e7\/0b6\/841\/5e70b684100b37e05ad002f412b2561a.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/5e7\/0b6\/841\/5e70b684100b37e05ad002f412b2561a.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u041b\u0435\u0433\u0435\u043d\u0434\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0446\u0432\u0435\u0442\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432<\/figcaption><\/div>\n<\/figure>\n<p>\u041e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u043a\u043b\u0430\u0441\u0441\u0430 <a href=\"https:\/\/github.com\/old-door\/qa-playground\/blob\/main\/tests\/src\/pages\/chart\/chart.page.ts\" rel=\"noopener noreferrer nofollow\">ChartPage<\/a> \u0442\u0430\u043a \u0438\u043b\u0438 \u0438\u043d\u0430\u0447\u0435 \u0437\u0430\u0432\u044f\u0437\u0430\u043d\u044b, \u0437\u0430 \u043f\u043e\u0438\u0441\u043a \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0432 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <code>getItemCoordinates<\/code>, \u0438 \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0438\u043b\u0438 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e \u0441 \u043d\u0438\u043c\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043d\u0430\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043a\u0443\u0440\u0441\u043e\u0440\u0430 \u0438\u043b\u0438 \u043a\u043b\u0438\u043a \u043f\u0440\u0430\u0432\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u0438 \u043c\u044b\u0448\u0438:<\/p>\n<pre><code class=\"typescript\">export class ChartPage extends BasePage { \/\/ ... async openItemContextMenu(name: string): Promise&lt;void&gt; {     await test.step(`Open \"${name}\" item's context menu on the chart`, async ()=&gt; {       const coords = await this.getItemCoordinates(name)       expect(         coords,         `To find ${name} coordinates`       ).not.toBeNull()       await this.page.mouse.click(coords!.x, coords!.y, { button: 'right'})     })   } \/\/ ... }<\/code><\/pre>\n<h3>\ud83d\udce2 \u041f\u043e\u0434\u0432\u0435\u0434\u0435\u043c \u0438\u0442\u043e\u0433\u0438<\/h3>\n<p>\u041e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043a \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e canvas \u043d\u0435 \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435\/\u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b , \u0430 \u0434\u043e\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0438\u0445. <\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0435\u0433\u043e \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445:<\/p>\n<ul>\n<li>\n<p>\u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0433\u0440\u0430\u0444\u0438\u043a\u0430 (\u043d\u0430\u0432\u0435\u0434\u0435\u043d\u0438\u0435, \u043a\u043b\u0438\u043a\u0438, drag-and-drop).<\/p>\n<\/li>\n<li>\n<p>\u042d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043d\u0430 canvas \u0438\u043c\u0435\u044e\u0442 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0446\u0432\u0435\u0442\u0430.<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u0446\u0432\u0435\u0442\u0430\u0445 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0438\u0437 \u043b\u0435\u0433\u0435\u043d\u0434\u044b, \u043a\u043e\u043d\u0444\u0438\u0433\u0430 \u0438\u043b\u0438 \u043f\u0430\u043b\u0438\u0442\u0440\u044b). <\/p>\n<\/li>\n<\/ul>\n<p>\u042d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u0430\u043c, \u0433\u0434\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 UI-\u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0431\u0435\u0441\u0441\u0438\u043b\u044c\u043d\u044b, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044f \u0437\u0430\u0434\u0430\u0447\u0443 \u0431\u044b\u0441\u0442\u0440\u043e \u0438 \u0442\u043e\u0447\u043d\u043e, \u0430 \u0442\u0430\u043a \u0436\u0435 \u043d\u0435 \u043d\u0443\u0436\u0434\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0435. <\/p>\n<p>\ud83d\udcac <strong>\u0412\u0430\u0448\u0435 \u043c\u043d\u0435\u043d\u0438\u0435?<\/strong><br \/>\u0421\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u043b\u0438 \u0432\u044b \u0441 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c canvas? \u041a\u0430\u043a\u0438\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435? \u0414\u0435\u043b\u0438\u0442\u0435\u0441\u044c \u043e\u043f\u044b\u0442\u043e\u043c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445!<\/p>\n<p>\ud83e\udde9 <strong>\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0441\u0430\u043c\u0438!<\/strong><br \/>\u0414\u043b\u044f \u0437\u0430\u043a\u0440\u0435\u043f\u043b\u0435\u043d\u0438\u044f \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430 \u044f \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043b \u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0441 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u043c \u043d\u0430 canvas. \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434, \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043f\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0443 \u0441\u0430\u0439\u0442\u0430 \u0438 \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u043e\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043d\u0430 <a href=\"https:\/\/github.com\/old-door\/qa-playground\/tree\/main\" rel=\"noopener noreferrer nofollow\">GitHub<\/a>. <\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/939206\/\"> https:\/\/habr.com\/ru\/articles\/939206\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u043a\u043e\u0433\u0434\u0430-\u043b\u0438\u0431\u043e \u043f\u0438\u0441\u0430\u043b\u0438 \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u044b \u0434\u043b\u044f \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0441 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c canvas, \u0442\u043e \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u0437\u043d\u0430\u0435\u0442\u0435, \u043a\u0430\u043a \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u043f\u0440\u043e\u0441\u0442\u043e. Canvas \u2014 \u044d\u0442\u043e &#171;\u0447\u0451\u0440\u043d\u044b\u0439 \u044f\u0449\u0438\u043a&#187;, \u0433\u0434\u0435 \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b UI-\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0435\u0441\u0441\u0438\u043b\u044c\u043d\u044b: \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0435\u0442 DOM-\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, \u0437\u0430 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0446\u0435\u043f\u0438\u0442\u044c\u0441\u044f. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435 canvas \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0447\u0442\u043e \u0443\u0433\u043e\u0434\u043d\u043e \u2014 \u043e\u0442 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432 \u0441 \u043e\u0441\u044f\u043c\u0438 X \u0438 Y \u0434\u043e \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0439.<\/p>\n<p>\u0425\u043e\u0442\u0438\u0442\u0435 \u0443\u0437\u043d\u0430\u0442\u044c, \u043a\u0430\u043a \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 canvas \u0431\u0435\u0437 \u043b\u0438\u0448\u043d\u0435\u0439 \u0431\u043e\u043b\u0438? \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c\u0441\u044f \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u041f\u0440\u0438\u043c\u0435\u0440 \u0433\u0440\u0430\u0444\u0438\u043a\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0432 canvas<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\">\n<div><figcaption>html \u043a\u043e\u0434 canvas \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430<\/figcaption><\/div>\n<\/figure>\n<h2>\ud83d\udcf8 \u0412 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c: \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435\/\u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u043d\u043e\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/h2>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a canvas \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u0433\u0440\u0430\u0444\u0438\u043a\u0438, \u043e\u0447\u0435\u043d\u044c \u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u043d\u044b\u043c \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c. <br \/>\u0415\u0441\u043b\u0438 \u0432\u044b, \u043a\u0430\u043a \u0438 \u044f, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 TS \u0438 Playwright, \u0442\u043e <a href=\"https:\/\/playwright.dev\/docs\/test-snapshots\" rel=\"noopener noreferrer nofollow\">\u0432\u043e\u0442 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043d\u0430 \u044d\u0442\u0443 \u0442\u0435\u043c\u0443<\/a>.<br \/>\u0422\u0430\u043a \u0436\u0435, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u0432\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u043c\u0435\u043d\u0438\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u044b \u0431\u0435\u043a\u0430, \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0431\u044b \u0438\u043c\u0435\u0442\u044c \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435 \u0438 <a href=\"https:\/\/playwright.dev\/docs\/mock#modify-api-responses\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0432\u0430\u0448\u0438\u0445 \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u0430\u0445<\/a>.<br \/>\u041d\u0430 \u0441\u043b\u0443\u0447\u0430\u0439, <a href=\"https:\/\/playwright.dev\/docs\/mock#mock-websockets\" rel=\"noopener noreferrer nofollow\">\u0435\u0441\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0433\u0440\u0430\u0444\u0438\u043a\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0435 \u043f\u043e web socket<\/a>.<\/p>\n<h2>\ud83e\udd14 \u0427\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c, \u043a\u043e\u0433\u0434\u0430 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0439 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e<\/h2>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430, \u044f \u043f\u043e\u043a\u0430\u0436\u0443 \u043f\u0440\u0438\u043c\u0435\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0441 \u043d\u0430\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u043c\/\u043a\u043b\u0438\u043a\u0430\u043c\u0438 \u043f\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u0432\u043d\u0443\u0442\u0440\u0438 \u0433\u0440\u0430\u0444\u0438\u043a\u0430:<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0412\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435\u043c \u0441 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 canvas<\/figcaption><\/div>\n<\/figure>\n<p>\u0422\u0443\u043b\u0442\u0438\u043f \u0438 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u043e\u0435 \u043c\u0435\u043d\u044e &#8212; \u043e\u0431\u044b\u0447\u043d\u044b\u0435 \u0432\u0435\u0431 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0432 DOM, \u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0431\u044b \u0438\u0445 \u0432\u044b\u0437\u0432\u0430\u0442\u044c, \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 canvas.<\/p>\n<p>\u0418\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 Playwright, \u043a\u0430\u043a \u0432\u043f\u0440\u043e\u0447\u0435\u043c, \u0438 \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f UI \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f &#8212; \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442 \u0432\u0430\u043c \u043d\u0438\u0447\u0435\u0433\u043e \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442\u044c, \u043a\u0440\u043e\u043c\u0435 \u043d\u0430\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043a\u0443\u0440\u0441\u043e\u0440\u0430 \u043f\u043e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c. <br \/>\u0421\u0440\u0430\u0437\u0443 \u043e\u0442\u043c\u0435\u0447\u0443, \u0447\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0445\u0430\u0440\u0434\u043a\u043e\u0434\u043d\u043e \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0437\u0432\u0443\u0447\u0438\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043d\u0435\u043d\u0430\u0434\u0435\u0436\u043d\u043e, \u0438 \u044f \u043c\u044b\u0441\u043b\u0435\u043d\u043d\u043e \u0443\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043b, \u043a\u0430\u043a \u043d\u0430 \u043c\u043e\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043b\u043e\u0436\u043d\u043e \u0443\u043f\u0430\u043b\u0438 50-100 \u0442\u0435\u0441\u0442\u043e\u0432, \u0438\u0437-\u0437\u0430 \u043d\u0435\u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 \u0433\u0440\u0430\u0444\u0438\u043a\u0435 \u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b.<\/p>\n<p>\u0410 \u0432\u0432\u043e\u0434 \u0447\u0435\u0440\u0435\u0437 API canvas \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0447\u0435\u0440\u0435\u0437 JavaScript \u043d\u0435 \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435  \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. <\/p>\n<h2>\u2705 \u0415\u0441\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435! <\/h2>\n<p>\u0412\u043e\u0442 \u043c\u044b \u043f\u043b\u0430\u0432\u043d\u043e \u0438 \u043f\u043e\u0434\u043e\u0448\u043b\u0438 \u043a \u0442\u043e\u043c\u0443, \u043a\u0430\u043a \u044f \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0440\u0435\u0448\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 &#8212; \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <a href=\"https:\/\/github.com\/old-door\/qa-playground\/blob\/main\/tests\/src\/utils\/color\/color.utils.ts#L71\" rel=\"noopener noreferrer nofollow\">findColorCoordinates<\/a> , \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0430 \u0432\u0445\u043e\u0434 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043e\u043f\u0446\u0438\u0438, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u043b\u043e\u043a\u0430\u0442\u043e\u0440, \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0446\u0432\u0435\u0442 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 canvas \u0438 \u0440\u044f\u0434 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u043f\u043e\u0438\u0441\u043a\u0430 \u0438\u043b\u0438 \u043f\u043e\u0433\u0440\u0435\u0448\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0438 \u043f\u043e\u0438\u0441\u043a\u0435 \u0446\u0432\u0435\u0442\u0430, \u0430 \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u0434\u0430\u0435\u0442 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b &#171;x&#187; \u0438 &#171;y&#187;:  <\/p>\n<pre><code class=\"typescript\">import { expect } from '@playwright\/test' import sharp from 'sharp' import { test } from '..\/..\/fixtures' import { ColorSearchPatternOptions, FindColorCoordinatesOptions, RgbaColor, RgbColor } from '.\/types'  export function findColorCoordinates(   options: FindColorCoordinatesOptions, ): Promise&lt;{ x: number; y: number } | null&gt; {   const {     targetColorRgb,     paddingPercent = {       top: 2,       bottom: 2,       left: 2,       right: 2,     },     locator,     colorDiffThreshold = 6,     searchPattern = 'adaptiveStep',     stepSize   } = options ?? {}    return test.step(`Find color: \"${targetColorRgb}\" coords`, async () =&gt; {     const targetColor = stringToRgb(targetColorRgb)     \/\/ Get bounding box of the element     const boundingBox = (await locator.boundingBox())!     expect(boundingBox, `Locator bounding box not to be null`).not.toBeNull()      const dataURL = await locator.evaluate((element) =&gt; {       const canvas = element as HTMLCanvasElement       return canvas.toDataURL('image\/png') \/\/ PNG as Data URL     })      \/\/ Data URL -&gt; Buffer     const buffer = Buffer.from(dataURL.split(',')[1], 'base64')      const { data: imageData, info } = await sharp(buffer)       .ensureAlpha()       .raw()       .toBuffer({ resolveWithObject: true })      const width = info.width     const height = info.height     const paddingXLeft = Math.floor(width * ((paddingPercent.left ?? 0) \/ 100))     const paddingXRight = Math.floor(width * ((paddingPercent.right ?? 0) \/ 100))     const paddingYTop = Math.floor(height * ((paddingPercent.top ?? 0) \/ 100))     const paddingYBottom = Math.floor(height * ((paddingPercent.bottom ?? 0) \/ 100))      const searchPatternOptions: ColorSearchPatternOptions = {       imageData,       targetColor,       width,       height,       colorDiffThreshold,       startX: Math.max(paddingXLeft, 0),       startY: Math.max(paddingYTop, 0),       endX: width - paddingXRight,       endY: height - paddingYBottom,       offsetX: boundingBox.x,       offsetY: boundingBox.y,     }      switch (searchPattern) {       case 'spiral':         return spiralSearchPattern(searchPatternOptions)       case 'vertical':         return verticalSearchPattern(searchPatternOptions)       case 'horizontal':         return horizontalSearchPattern(searchPatternOptions)       case 'adaptiveStep':         return adaptiveStepSearchPattern({...searchPatternOptions, stepSize})       default:         return null     }   }) }<\/code><\/pre>\n<p>\u0418 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u0432 \u043f\u043e\u0438\u0441\u043a\u0430:<\/p>\n<pre><code class=\"typescript\">function horizontalSearchPattern(options: ColorSearchPatternOptions) {   const {      imageData, targetColor, width, startX, endX, startY, endY, offsetX, offsetY, colorDiffThreshold    } = options   for (let y = startY; y &lt; endY; y++) {     for (let x = startX; x &lt; endX; x++) {       const index = (y * width + x) * 4 \/\/ 4 bytes per pixel (RGBA)       const color = {         r: imageData[index],         g: imageData[index + 1],         b: imageData[index + 2],         a: imageData[index + 3],       }       const diff = deltaE(color, targetColor)       if (diff &lt; colorDiffThreshold) {         return { x: x + offsetX, y: y + offsetY }       }     }   }   return null }<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u043c, \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c API canvas \u0434\u043b\u044f \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u044e\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <a href=\"https:\/\/www.npmjs.com\/package\/sharp\" rel=\"noopener noreferrer nofollow\">sharp<\/a>, \u043a \u0441\u043b\u043e\u0432\u0443, \u043e\u043d\u0430 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u0430, \u0434\u043b\u044f \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 imageData: Buffer&lt;<em>ArrayBufferLike<\/em>&gt; , \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0446\u0432\u0435\u0442\u0430\u0445 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u0438\u043a\u0441\u0435\u043b\u044f \u043d\u0430 canvas.<\/p>\n<p>\u042f \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b \u0440\u0430\u0437\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 (\u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u0435 image data \u0438\u0437 API Canvas) \u0438 <a href=\"https:\/\/www.npmjs.com\/package\/sharp\" rel=\"noopener noreferrer nofollow\">sharp<\/a> \u0437\u0430\u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u043e\u0432\u0430\u043b \u0441\u0435\u0431\u044f, \u043a\u0430\u043a \u0441\u0430\u043c\u044b\u0439 \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0438 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u0439.  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0434\u0440\u0443\u0433 \u0432\u044b \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442\u0435\u0441\u044c, \u043f\u043e\u0447\u0435\u043c\u0443 \u044f \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u044e \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430, \u0442\u043e \u043e\u0442\u0432\u0435\u0442 \u043e\u043f\u044f\u0442\u044c \u0436\u0435 \u0432 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f &#8212; \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c \u043f\u043e\u0440\u044f\u0434\u043a\u0430 <strong>80ms<\/strong>. \u0412 \u043c\u043e\u0435\u043c \u0436\u0435 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f, \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0438 800&#215;400, \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f <strong>20-40ms<\/strong>, \u0447\u0442\u043e \u0432\u043f\u043e\u043b\u043d\u0435 \u043f\u0440\u0438\u0435\u043c\u043b\u0435\u043c\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442.<\/p>\n<h2>\ud83e\uddea \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0432 \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u0430\u0445<\/h2>\n<figure class=\"full-width\">\n<div><figcaption><a href=\"https:\/\/github.com\/old-door\/qa-playground\/blob\/main\/tests\/src\/utils\/color\/color.utils.ts#L71\" rel=\"noopener noreferrer nofollow\">findColorCoordinates<\/a> \u043f\u0440\u043e\u0442\u0438\u0432 canvas<\/figcaption><\/div>\n<\/figure>\n<p>\u0412 \u043b\u0435\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u044d\u043a\u0440\u0430\u043d\u0430 &#8212; \u0442\u0435\u0441\u0442 \u0448\u0430\u0433\u0438, \u0430 \u0441\u043f\u0440\u0430\u0432\u0430 \u0432\u0435\u0431 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0442\u0435\u0441\u0442 \u0448\u0430\u0433\u043e\u0432, \u0442\u0430\u043a \u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043a\u0440\u0430\u0441\u043d\u044b\u0435 \u0442\u043e\u0447\u043a\u0438 &#8212; \u0438\u043c\u0438 \u043e\u0442\u043c\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u043a\u0443\u0440\u0441\u043e\u0440, \u043f\u0440\u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438 \u0441 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u044f\u0445 \u043c\u044b\u0448\u043a\u0438. \u041d\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b\u0445 \u043a\u0430\u0434\u0440\u0430\u0445 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u044b \u0431\u0435\u0437 \u0442\u0440\u0443\u0434\u0430 \u043d\u0430\u0445\u043e\u0434\u044f\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0435.<\/p>\n<p>\u0420\u0430\u0437\u0431\u0435\u0440\u0435\u043c\u0441\u044f, \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 Playwright \u0442\u0435\u0441\u0442 \u0441\u043f\u0435\u043a\u0438 <a href=\"https:\/\/github.com\/old-door\/qa-playground\/blob\/main\/tests\/specs\/chart.spec.ts\" rel=\"noopener noreferrer nofollow\">chart.spec.ts<\/a>. \u041d\u0438\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043a\u043e\u0434 \u0442\u0435\u0441\u0442\u0430:<\/p>\n<pre><code class=\"typescript\">const defaultItem = 'Item1' const allItems = [defaultItem, 'Item2', 'Item3'] const screenshotName = 'empty.png'  test(`Disable all items via context menu`, async ({ chartPage }) =&gt; {     for (const item of allItems) {       await chartPage.locators.legendItemCheckbox(item).check()       await chartPage.validateItemIsVisible(item)       await chartPage.openItemContextMenu(item)       await chartPage.locators.hideItemContexMenuOption().click()       await chartPage.validateItemIsHidden(item)     }     await expect(chartPage.locators.chart()).toHaveScreenshot(screenshotName)   })<\/code><\/pre>\n<p><a href=\"https:\/\/github.com\/old-door\/qa-playground\/blob\/main\/tests\/src\/fixtures\/pages.fixtures.ts\" rel=\"noopener noreferrer nofollow\">chartPage<\/a> &#8212; \u0444\u0438\u043a\u0441\u0442\u0443\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0442\u0440\u044b\u0432\u0430\u0435\u0442 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0441 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u043c.<br \/>\u041b\u043e\u0433\u0438\u043a\u0430 \u043f\u043e \u043f\u043e\u0438\u0441\u043a\u0443 \u0446\u0432\u0435\u0442\u0430, \u043b\u0435\u0436\u0438\u0442 \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0430\u043c\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b <a href=\"https:\/\/github.com\/old-door\/qa-playground\/blob\/main\/tests\/src\/pages\/chart\/chart.page.ts\" rel=\"noopener noreferrer nofollow\">ChartPage<\/a>.<br \/>\u0422.\u043a. \u0437\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u0443 \u0433\u0440\u0430\u0444\u0438\u043a\u0430 \u0435\u0441\u0442\u044c \u043b\u0435\u0433\u0435\u043d\u0434\u0430, \u0430 \u0432 \u043b\u0435\u0433\u0435\u043d\u0434\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0446\u0432\u0435\u0442\u0430, \u0442\u043e \u0442\u0430\u043a \u0436\u0435 \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u0438 \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0438 \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043b\u0435\u0433\u0435\u043d\u0434\u044b, \u043c\u044b \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c \u0446\u0432\u0435\u0442 \u0438 \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u043c, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043a\u0430\u0442\u044c \u043d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0435:<\/p>\n<pre><code class=\"typescript\">export class ChartPage extends BasePage {   \/\/ ...   private getItemColor(name: string): Promise&lt;string&gt; {       return test.step(`Get \"${name}\" legend item color`, ()=&gt; {         return this.locators.legendItem()           .filter({hasText: name})           .evaluate((element) =&gt; {             const styles = window.getComputedStyle(element)             return styles.color           })       })     }        private async getItemCoordinates(name: string): Promise&lt;{ x: number; y: number } | null&gt; {       const targetColorRgb = await this.getItemColor(name)       return findColorCoordinates({         targetColorRgb,         locator: this.locators.chart()       })     }   \/\/ ...   }<\/code><\/pre>\n<figure class=\"full-width\">\n<div><figcaption>\u041b\u0435\u0433\u0435\u043d\u0434\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0446\u0432\u0435\u0442\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432<\/figcaption><\/div>\n<\/figure>\n<p>\u041e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u043a\u043b\u0430\u0441\u0441\u0430 <a href=\"https:\/\/github.com\/old-door\/qa-playground\/blob\/main\/tests\/src\/pages\/chart\/chart.page.ts\" rel=\"noopener noreferrer nofollow\">ChartPage<\/a> \u0442\u0430\u043a \u0438\u043b\u0438 \u0438\u043d\u0430\u0447\u0435 \u0437\u0430\u0432\u044f\u0437\u0430\u043d\u044b, \u0437\u0430 \u043f\u043e\u0438\u0441\u043a \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0432 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <code>getItemCoordinates<\/code>, \u0438 \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0438\u043b\u0438 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e \u0441 \u043d\u0438\u043c\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043d\u0430\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043a\u0443\u0440\u0441\u043e\u0440\u0430 \u0438\u043b\u0438 \u043a\u043b\u0438\u043a \u043f\u0440\u0430\u0432\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u0438 \u043c\u044b\u0448\u0438:<\/p>\n<pre><code class=\"typescript\">export class ChartPage extends BasePage { \/\/ ... async openItemContextMenu(name: string): Promise&lt;void&gt; {     await test.step(`Open \"${name}\" item's context menu on the chart`, async ()=&gt; {       const coords = await this.getItemCoordinates(name)       expect(         coords,         `To find ${name} coordinates`       ).not.toBeNull()       await this.page.mouse.click(coords!.x, coords!.y, { button: 'right'})     })   } \/\/ ... }<\/code><\/pre>\n<h3>\ud83d\udce2 \u041f\u043e\u0434\u0432\u0435\u0434\u0435\u043c \u0438\u0442\u043e\u0433\u0438<\/h3>\n<p>\u041e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043a \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e canvas \u043d\u0435 \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435\/\u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b , \u0430 \u0434\u043e\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0438\u0445. <\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0435\u0433\u043e \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445:<\/p>\n<ul>\n<li>\n<p>\u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0433\u0440\u0430\u0444\u0438\u043a\u0430 (\u043d\u0430\u0432\u0435\u0434\u0435\u043d\u0438\u0435, \u043a\u043b\u0438\u043a\u0438, drag-and-drop).<\/p>\n<\/li>\n<li>\n<p>\u042d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043d\u0430 canvas \u0438\u043c\u0435\u044e\u0442 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0446\u0432\u0435\u0442\u0430.<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u0446\u0432\u0435\u0442\u0430\u0445 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0438\u0437 \u043b\u0435\u0433\u0435\u043d\u0434\u044b, \u043a\u043e\u043d\u0444\u0438\u0433\u0430 \u0438\u043b\u0438 \u043f\u0430\u043b\u0438\u0442\u0440\u044b). <\/p>\n<\/li>\n<\/ul>\n<p>\u042d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u0430\u043c, \u0433\u0434\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 UI-\u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0431\u0435\u0441\u0441\u0438\u043b\u044c\u043d\u044b, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044f \u0437\u0430\u0434\u0430\u0447\u0443 \u0431\u044b\u0441\u0442\u0440\u043e \u0438 \u0442\u043e\u0447\u043d\u043e, \u0430 \u0442\u0430\u043a \u0436\u0435 \u043d\u0435 \u043d\u0443\u0436\u0434\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0435. <\/p>\n<p>\ud83d\udcac <strong>\u0412\u0430\u0448\u0435 \u043c\u043d\u0435\u043d\u0438\u0435?<\/strong><br \/>\u0421\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u043b\u0438 \u0432\u044b \u0441 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c canvas? \u041a\u0430\u043a\u0438\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435? \u0414\u0435\u043b\u0438\u0442\u0435\u0441\u044c \u043e\u043f\u044b\u0442\u043e\u043c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445!<\/p>\n<p>\ud83e\udde9 <strong>\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0441\u0430\u043c\u0438!<\/strong><br \/>\u0414\u043b\u044f \u0437\u0430\u043a\u0440\u0435\u043f\u043b\u0435\u043d\u0438\u044f \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430 \u044f \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043b \u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0441 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u043c \u043d\u0430 canvas. \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434, \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043f\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0443 \u0441\u0430\u0439\u0442\u0430 \u0438 \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u043e\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043d\u0430 <a href=\"https:\/\/github.com\/old-door\/qa-playground\/tree\/main\" rel=\"noopener noreferrer nofollow\">GitHub<\/a>. <\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/939206\/\"> https:\/\/habr.com\/ru\/articles\/939206\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-471448","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/471448","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=471448"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/471448\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=471448"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=471448"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=471448"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}