{"id":301997,"date":"2020-04-16T15:01:04","date_gmt":"2020-04-16T15:01:04","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=301997"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=301997","title":{"rendered":"Cypress + Storybook. \u0425\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f, \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/497544\/\">\n<p>\u0421\u043f\u0435\u0440\u0432\u0430 Cypress \u0432\u043e\u0441\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u043b\u0441\u044f \u043a\u0430\u043a \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 e2e-\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0411\u044b\u043b\u043e \u043b\u044e\u0431\u043e\u043f\u044b\u0442\u043d\u043e \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u0437\u0430 \u0440\u043e\u0441\u0442\u043e\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0430 front-end \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u043e\u0432 \u043a \u0442\u0435\u043c\u0435, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u0441\u044e \u0436\u0438\u0437\u043d\u044c \u043f\u0440\u0430\u0432\u0438\u043b Selenium. \u0412 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u0442\u0438\u043f\u0438\u0447\u043d\u043e\u0435 \u0432\u0438\u0434\u0435\u043e \u0438\u043b\u0438 \u0441\u0442\u0430\u0442\u044c\u044f, \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u044e\u0449\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 Cypress, \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0431\u043b\u0443\u0436\u0434\u0430\u043d\u0438\u0435\u043c \u043f\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u043c\u0443 \u0441\u0430\u0439\u0442\u0443 \u0438 \u0437\u0430\u0441\u043b\u0443\u0436\u0435\u043d\u043d\u044b\u043c\u0438 \u043b\u0435\u0441\u0442\u043d\u044b\u043c\u0438 \u043e\u0442\u0437\u044b\u0432\u0430\u043c\u0438 \u043e\u0431 API \u0434\u043b\u044f \u0432\u0432\u043e\u0434\u0430 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>  <\/p>\n<p>\u041c\u043d\u043e\u0433\u0438\u0435 \u0438\u0437 \u043d\u0430\u0441 \u0434\u043e\u0433\u0430\u0434\u0430\u043b\u0438\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Cypress \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0432 \u0438\u0437\u043e\u043b\u044f\u0446\u0438\u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u043e\u0439 \u0442\u0430\u043a\u0438\u043c\u0438 \u0441\u0440\u0435\u0434\u0430\u043c\u0438 \u043a\u0430\u043a Storybook\/Styleguidist\/Docz. \u0425\u043e\u0440\u043e\u0448\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u2014 \u0441\u0442\u0430\u0442\u044c\u044f Stefano Magni <a href=\"https:\/\/itnext.io\/testing-a-virtual-list-component-with-cypress-and-storybook-494dc2d1d26b\">&quot;Testing a Virtual List component with Cypress and Storybook&quot;<\/a>. \u0412 \u043d\u0435\u0439 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0442\u044c Storybook Story, \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u043d\u0435\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0438 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u044b \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0430. \u042d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u0445\u043e\u0440\u043e\u0448, \u043d\u043e \u0432 \u043d\u0451\u043c \u0442\u0435\u0441\u0442 \u0440\u0430\u0437\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u0435\u0436\u0434\u0443 Storybook \u0438 Cypress. \u0415\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u043c\u043d\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u0442\u0430\u043a\u0438\u0435 \u0442\u0435\u0441\u0442\u044b \u0431\u0443\u0434\u0435\u0442 \u0441\u043b\u043e\u0436\u043d\u043e \u0447\u0438\u0442\u0430\u0442\u044c \u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c.<\/p>\n<p>  <\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u043e\u043f\u044b\u0442\u0430\u044e\u0441\u044c \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0430\u043a \u043f\u043e\u0439\u0442\u0438 \u0447\u0443\u0442\u044c \u0434\u0430\u043b\u044c\u0448\u0435 \u0438 \u0432\u0437\u044f\u0442\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c \u043e\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0442\u044c JavaScript \u0432 Cypress. \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043f\u0440\u043e\u0448\u0443 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c <a href=\"https:\/\/github.com\/daedalius\/article-exposing-component-from-storybook-to-handle-them-in-cypress\">\u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434<\/a> \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b <strong>npm i<\/strong> \u0438 <strong>npm run test<\/strong>.<\/p>\n<p>  <\/p>\n<p>tl; dr:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0438\u0437 Storybook Story \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0446\u0435\u043b\u0438\u043a\u043e\u043c \u0441\u0438\u043b\u0430\u043c\u0438 Cypress (\u043d\u0435 \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u044f \u043b\u043e\u0433\u0438\u043a\u0443 \u0442\u0435\u0441\u0442\u0430 \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0447\u0430\u0441\u0442\u0435\u0439).<\/li>\n<li>Cypress \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043d\u0430\u0448\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u0435 \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043a\u043e \u043c\u043e\u0449\u043d\u044b\u043c, \u0447\u0442\u043e \u043c\u044b \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u0442\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u043e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0445 js-dom \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f UI-\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432.<a name=\"habracut\"><\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<h2 id=\"postanovka-zadachi\">\u041f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u0430\u0434\u0430\u0447\u0438<\/h2>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c, \u0447\u0442\u043e \u043c\u044b \u043f\u0438\u0448\u0435\u043c \u0430\u0434\u0430\u043f\u0442\u0435\u0440 \u0434\u043b\u044f \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 Datepicker \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0432\u0441\u0435\u0445 \u0441\u0430\u0439\u0442\u0430\u0445 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438. \u0427\u0442\u043e\u0431\u044b \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u043d\u0435 \u0441\u043b\u043e\u043c\u0430\u0442\u044c \u043d\u0438 \u043e\u0434\u0438\u043d \u0441\u0430\u0439\u0442, \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u043a\u0440\u044b\u0442\u044c \u0435\u0433\u043e \u0442\u0435\u0441\u0442\u0430\u043c\u0438. <\/p>\n<p>  <\/p>\n<h2 id=\"storybook\">Storybook<\/h2>\n<p>  <\/p>\n<p>\u0421\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b Storybook \u0432\u0441\u0451, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u2014 \u043f\u0443\u0441\u0442\u0430\u044f Story \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442. \u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u0431\u044b\u0442\u044c \u0441\u043e\u0432\u0441\u0435\u043c \u0431\u0435\u0441\u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439, \u044d\u0442\u0430 Story \u043d\u0430\u043c \u043e\u0442\u0440\u0438\u0441\u0443\u0435\u0442 \u043e\u0434\u0438\u043d DOM-\u0443\u0437\u0435\u043b. \u0415\u0433\u043e \u0440\u043e\u043b\u044c \u2014 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043c\u0435\u0441\u0442\u043e \u043f\u043e\u0434 \u043f\u043e\u043b\u0438\u0433\u043e\u043d, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c Cypress \u0431\u0443\u0434\u0435\u0442 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442.<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">import React from 'react'; import Datepicker from '.\/Datepicker.jsx';  export default {   component: Datepicker,   title: 'Datepicker', };  export const emptyStory = () =&gt; {     \/\/ Reference to retrieve it in Cypress during the test     window.Datepicker = Datepicker;      \/\/ Just a mount point     return (         &lt;div id=&quot;component-test-mount-point&quot;&gt;&lt;\/div&gt;     ) }; <\/code><\/pre>\n<p>  <\/p>\n<p>\u041c\u044b \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0438 \u0441\u043e Storybook. \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u043c \u0432\u0441\u0451 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 Cypress.<\/p>\n<p>  <\/p>\n<h2 id=\"cypress\">Cypress<\/h2>\n<p>  <\/p>\n<p>\u042f \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u044e \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u043d\u0430\u0434 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u043c \u0441 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u043e\u0432. \u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u043c\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b\u0438\u0441\u044c \u0441 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u043c \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u0435\u043c, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0437\u0430\u0433\u043e\u0442\u043e\u0432\u043a\u0443:<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">\/\/\/ &lt;reference types=&quot;cypress&quot; \/&gt;  import React from 'react'; import ReactDOM from 'react-dom';  \/**  * &lt;Datepicker \/&gt;  * * renders text field.  * * renders desired placeholder text.  * * renders chosen date.  * * opens calendar after clicking on text field.  *\/  context('&lt;Datepicker \/&gt;', () =&gt; {     it('renders text field.', () =&gt; { });      it('renders desired placeholder text.', () =&gt; { });      it('renders chosen date.', () =&gt; { });      it('opens calendar after clicking on text field.', () =&gt; { }); })<\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u043a\u0435\u0439. \u0414\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0442\u0435\u0441\u0442\u0430 \u043d\u0443\u0436\u043d\u0430 \u0441\u0440\u0435\u0434\u0430. \u0412\u0441\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u043c \u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u043e\u043c Storybook. \u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043a \u043f\u0443\u0441\u0442\u043e\u0439 Story, \u043e\u0442\u043a\u0440\u044b\u0432 \u0435\u0451 \u0432 \u043d\u043e\u0432\u043e\u043c \u043e\u043a\u043d\u0435 \u043f\u043e \u043a\u043b\u0438\u043a\u0443 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0435 &quot;Open canvas in new tab&quot; \u043d\u0430 sidebar. \u0421\u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c URL \u0438 \u043d\u0430\u0446\u0435\u043b\u0438\u043c \u0442\u0443\u0434\u0430 Cypress:<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">const rootToMountSelector = '#component-test-mount-point';  before(() =&gt; {     cy.visit('http:\/\/localhost:12345\/iframe.html?id=datepicker--empty-story');     cy.get(rootToMountSelector); });<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0432\u044b \u043c\u043e\u0433\u043b\u0438 \u0434\u043e\u0433\u0430\u0434\u0430\u0442\u044c\u0441\u044f, \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0435\u0435 \u043d\u0430\u0441 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0442\u0435\u0441\u0442\u0435 \u0432 \u043e\u0434\u043d\u043e\u043c \u0438 \u0442\u043e\u043c \u0436\u0435 div \u0441 id=component-test-mount-point. \u0427\u0442\u043e\u0431\u044b \u0442\u0435\u0441\u0442\u044b \u043d\u0435 \u0432\u043b\u0438\u044f\u043b\u0438 \u0434\u0440\u0443\u0433 \u043d\u0430 \u0434\u0440\u0443\u0433\u0430, \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0437\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043f\u043e\u0441\u043b\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043a\u043e\u0434 \u043e\u0447\u0438\u0441\u0442\u043a\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">afterEach(() =&gt; {     cy.document()         .then((doc) =&gt; {             ReactDOM.unmountComponentAtNode(doc.querySelector(rootToMountSelector));         }); });<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0435\u0441\u0442. \u0414\u043e\u0441\u0442\u0430\u043d\u0435\u043c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442, \u043e\u0442\u0440\u0438\u0441\u0443\u0435\u043c \u0435\u0433\u043e \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0435\u0435 \u043d\u0430\u0441 \u0443\u0441\u043b\u043e\u0432\u0438\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">const selectors = {     innerInput: '.react-datepicker__input-container input', };  it('renders text field.', () =&gt; {     cy.window().then((win) =&gt; {         ReactDOM.render(             &lt;win.Datepicker \/&gt;,             win.document.querySelector(rootToMountSelector)         );     });      cy         .get(selectors.innerInput)         .should('be.visible'); });<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u0438\u0434\u0438\u0442\u0435? \u041d\u0438\u0447\u0442\u043e \u043d\u0435 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u043d\u0430\u0441 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043b\u044e\u0431\u043e\u0439 props. \u041b\u044e\u0431\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435. \u041b\u044e\u0431\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435. \u0418 \u0432\u0441\u0451 \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u2014 \u0432 Cypress!<\/p>\n<p>  <\/p>\n<h2 id=\"testy-v-neskolko-etapov-testirovanie-s-obyortkoy\">\u0422\u0435\u0441\u0442\u044b \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u0430\u043f\u043e\u0432, \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441 \u043e\u0431\u0451\u0440\u0442\u043a\u043e\u0439<\/h2>\n<p>  <\/p>\n<p>\u0418\u043d\u043e\u0433\u0434\u0430 \u043d\u0430\u043c \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0432\u0435\u0434\u0451\u0442 \u0441\u0435\u0431\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u043f\u0440\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 props.<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 &lt;Popup \/&gt; c props \u043f\u043e \u0438\u043c\u0435\u043d\u0438 &quot;showed&quot;. \u041a\u043e\u0433\u0434\u0430 &quot;showed&quot; true, &lt;Popup \/&gt; \u0432\u0438\u0434\u0438\u043c. \u041f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 &quot;showed&quot; c true \u043d\u0430 false, &lt;Popup \/&gt; \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043a\u0440\u044b\u0442\u044c\u0441\u044f.<br \/>  \u041a\u0430\u043a \u044d\u0442\u043e \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c?<\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0440\u043d\u043e \u0440\u0435\u0448\u0430\u044e\u0442\u0441\u044f \u0438\u043c\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e, \u043e\u0434\u043d\u0430\u043a\u043e \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u043c React \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0447\u0442\u043e-\u0442\u043e \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u0442\u044c. <\/p>\n<p>  <\/p>\n<p>\u0412 \u043d\u0430\u0448\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u0435 \u043c\u044b \u043e\u0431\u044b\u0447\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0441\u043e state. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 state \u044d\u0442\u043e boolean, \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0449\u0438\u0439 \u0437\u0430 &quot;showed&quot; props.<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">let setPopupTestWrapperState = null; const PopupTestWrapper = ({ showed, win }) =&gt; {     const [isShown, setState] = React.useState(showed);     setPopupTestWrapperState = setState;     return &lt;win.Popup showed={isShown} \/&gt; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u043d\u0438\u0432 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u0443\u044e \u043e\u0431\u0451\u0440\u0442\u043a\u0443, \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u0443 \u043d\u0430\u0434 \u0442\u0435\u0441\u0442\u043e\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">it('becomes hidden after being shown when showed=false passed.', () =&gt; {     \/\/ arrange     cy.window().then((win) =&gt; {         \/\/ initial state - popup is visible         ReactDOM.render(             &lt;PopupTestWrapper                 showed={true}                 win={win}             \/&gt;,             win.document.querySelector(rootToMountSelector)         );     });      \/\/ act     cy.then(() =&gt; { setPopupTestWrapperState(false); })      \/\/ assert     cy         .get(selectors.popupWindow)         .should('not.be.visible'); });<\/code><\/pre>\n<p>  <\/p>\n<blockquote><p>\u0421\u043e\u0432\u0435\u0442: \u0415\u0441\u043b\u0438 hook \u0443 \u0432\u0430\u043c \u043d\u0435 \u0437\u0430\u0432\u0451\u043b\u0441\u044f \u0438\u043b\u0438 \u0432\u044b \u043f\u0440\u043e\u0442\u0438\u0432 \u0432\u044b\u0437\u043e\u0432\u0430 setState \u0438\u0437\u0432\u043d\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430, \u043f\u0435\u0440\u0435\u043f\u0438\u0448\u0438\u0442\u0435 \u043d\u0430 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 class.<\/p><\/blockquote>\n<p>  <\/p>\n<h2 id=\"testirovanie-metodov-komponenta\">\u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430<\/h2>\n<p>  <\/p>\n<p>\u0427\u0435\u0441\u0442\u043d\u043e \u0433\u043e\u0432\u043e\u0440\u044f, \u044f \u043d\u0435 \u043f\u0438\u0441\u0430\u043b \u0442\u0430\u043a\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u043f\u0440\u0435\u0436\u0434\u0435, \u0430 \u0438\u0434\u0435\u044f \u043f\u0440\u0438\u0448\u043b\u0430 \u0432 \u0433\u043e\u043b\u043e\u0432\u0443 \u0443\u0436\u0435 \u043f\u0435\u0440\u0435\u0434 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0438. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043a\u043e\u043c\u0443-\u0442\u043e \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u044e\u043d\u0438\u0442-\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p>  <\/p>\n<p>\u0421\u0434\u0435\u043b\u0430\u0442\u044c \u0432 Cypress \u044d\u0442\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e. \u0414\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c ref \u043d\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442. \u0414\u043b\u044f \u043f\u043e\u043b\u043d\u043e\u0442\u044b \u043a\u0430\u0440\u0442\u0438\u043d\u044b \u0441\u0442\u043e\u0438\u0442 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044c, \u0447\u0442\u043e ref \u0434\u0430\u0451\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a state \u0438 \u0434\u0440\u0443\u0433\u0438\u043c \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430.<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0432 &lt;Popup \/&gt; \u043c\u0435\u0442\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u043d\u0443\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0435\u0433\u043e \u0441\u043a\u0440\u044b\u0432\u0430\u0435\u0442 (\u043f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0434\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u0430). \u0422\u0435\u0441\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">it('closes via method call.', () =&gt; {     \/\/ arrange     let popup = React.createRef();     cy.window().then((win) =&gt; {         \/\/ initial state - popup is visible         ReactDOM.render(             &lt;win.Popup                 showed={true}                 ref={popup}             \/&gt;,             win.document.querySelector(rootToMountSelector)         );     });      \/\/ act     cy.then(() =&gt; { popup.current.hide(); })      \/\/ assert     cy         .get(selectors.popupWindow)         .should('not.be.visible'); })<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"podytog-roli-kazhdogo-iz-uchastnikov\">\u041f\u043e\u0434\u044b\u0442\u043e\u0433: \u0440\u043e\u043b\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u043e\u0432<\/h2>\n<p>  <\/p>\n<p>Storybook:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u041f\u043e\u0434\u043d\u0438\u043c\u0430\u0435\u0442 Storybook Stories \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0435 \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0435 React \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0434\u043b\u044f \u0446\u0435\u043b\u0435\u0439 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/li>\n<li>\u041f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0440\u0435\u0430\u043b\u044c\u043d\u0443\u044e \u043d\u0435\u0441\u0438\u043d\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0441\u0440\u0435\u0434\u0443 \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u0435\u0441\u0442\u043e\u0432.<\/li>\n<li>\u041a\u0430\u0436\u0434\u0430\u044f Story \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0443\u044e \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0432 window (\u0447\u0442\u043e\u0431\u044b \u0437\u0430\u0442\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0435\u0451 \u0432 Cypress).<\/li>\n<li>\u041a\u0430\u0436\u0434\u0430\u044f Story \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0442\u043e\u0447\u043a\u0443 \u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0437\u0430\u0442\u0435\u043c \u0431\u0443\u0434\u0435\u0442 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u0442\u0441\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 (\u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0442\u0435\u0441\u0442\u0430).<\/li>\n<li>\u0421\u043f\u043e\u0441\u043e\u0431\u0435\u043d \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0432 \u0438\u0437\u043e\u043b\u044f\u0446\u0438\u0438 \u0432 \u0447\u0438\u0441\u0442\u043e\u0439 \u043d\u043e\u0432\u043e\u0439 \u0432\u043a\u043b\u0430\u0434\u043a\u0435.<\/li>\n<\/ul>\n<p>  <\/p>\n<blockquote><p>\u0421\u043e\u0432\u0435\u0442: \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 Storybook \u0434\u043b\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432. \u041d\u0435 \u0441\u043c\u0435\u0448\u0438\u0432\u0430\u0439\u0442\u0435 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0435 Stories \u0441 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u043c\u0438.<\/p><\/blockquote>\n<p>Cypress:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0421\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0442\u0435\u0441\u0442\u044b \u0438 JavaScript \u0434\u043b\u044f \u043d\u0438\u0445.<\/li>\n<li>\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442 \u043a \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c Stories, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0438\u0437 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439.<\/li>\n<li>\u041e\u0442\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0435\u0442 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043b\u043e\u0433\u0438\u043a\u0435 \u0442\u0435\u0441\u0442\u0430 \u0441 \u043d\u0443\u0436\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u043c \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0438).<\/li>\n<li>\u0412\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u0441 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u043c \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435.<\/li>\n<li>\u041f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 UI \u0434\u043b\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/li>\n<\/ul>\n<p>  <\/p>\n<h2 id=\"zaklyuchenie\">\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  <\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u0432\u044b\u0440\u0430\u0437\u0438\u0442\u044c \u043b\u0438\u0447\u043d\u043e\u0435 \u043c\u043d\u0435\u043d\u0438\u0435 \u0438 \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043f\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u0430\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u043b\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u0443 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f. \u041d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0435 \u043d\u0438\u0436\u0435 \u043d\u0435 \u043f\u0440\u0435\u0442\u0435\u043d\u0434\u0443\u0435\u0442 \u043d\u0430 \u0438\u0441\u0442\u0438\u043d\u0443, \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0430\u0440\u0430\u0445\u0438\u0441.<\/p>\n<p>  <\/p>\n<h3 id=\"moi-utility-dlya-testirovaniya-ispolzuyut-js-dom-pod-kapotom-v-chem-ya-sebya-ogranichivayu\">\u041c\u043e\u0438 \u0443\u0442\u0438\u043b\u0438\u0442\u044b \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 js-dom \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c. \u0412 \u0447\u0435\u043c \u044f \u0441\u0435\u0431\u044f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u044e?<\/h3>\n<p>  <\/p>\n<ul>\n<li>Js-dom \u044d\u0442\u043e \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0441\u0440\u0435\u0434\u0430, \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u044e\u0449\u0430\u044f \u043e\u0445\u0432\u0430\u0442 \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u044f. \u041e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u043e\u044f\u0449\u0438\u0439 DOM \u044d\u0442\u043e \u043d\u0435 \u0432\u0435\u0441\u044c \u0431\u0440\u0430\u0443\u0437\u0435\u0440. <\/li>\n<li>\u041d\u0435 \u043e\u0447\u0435\u043d\u044c \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 js-dom \u0442\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u043b \u0431\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043a\u043e\u0433\u0434\u0430 \u0440\u0435\u0447\u044c \u0437\u0430\u0445\u043e\u0434\u0438\u0442 \u043e\u0431 \u0438\u043c\u0438\u0442\u0430\u0446\u0438\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0432\u0432\u043e\u0434\u0430. <\/li>\n<li>\u041c\u043d\u043e\u0433\u043e \u043b\u0438 \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0432\u0430\u043c \u0434\u0430\u0451\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u044e\u043d\u0438\u0442-\u0442\u0435\u0441\u0442, \u0435\u0441\u043b\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u043b\u043e\u043c\u0430\u043d \u0432 CSS \u043e\u0434\u043d\u0438\u043c \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u043c z-index? \u0415\u0441\u043b\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 Cypress, \u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435 \u043e\u0448\u0438\u0431\u043a\u0443. <\/li>\n<li>\u0412\u044b \u043f\u0438\u0448\u0438\u0442\u0435 \u044e\u043d\u0438\u0442-\u0442\u0435\u0441\u0442\u044b \u0432\u0441\u043b\u0435\u043f\u0443\u044e. \u041d\u043e \u0437\u0430\u0447\u0435\u043c? <\/li>\n<\/ul>\n<p>  <\/p>\n<h3 id=\"stoit-li-mne-vybrat-opisannyy-podhod-dlya-testirovaniya-komponentov\">\u0421\u0442\u043e\u0438\u0442 \u043b\u0438 \u043c\u043d\u0435 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432?<\/h3>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0432\u043e\u0441\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442\u0435 \u0442\u0435\u0441\u0442\u044b \u043a\u0430\u043a \u0441\u0440\u0435\u0434\u0443 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u2014 \u0442\u043e\u0447\u043d\u043e \u0414\u0430!<br \/>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0432\u043e\u0441\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442\u0435 \u0442\u0435\u0441\u0442\u044b \u043a\u0430\u043a <strong>\u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u0443\u044e<\/strong> \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u2014 \u0414\u0430.<br \/>  \u0415\u0441\u043b\u0438 \u0432\u044b \u043f\u0438\u0448\u0435\u0442\u0435 &quot;\u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0435&quot; \u044e\u043d\u0438\u0442-\u0442\u0435\u0441\u0442\u044b \u0441 \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u0435\u043c \u0434\u0435\u0442\u0430\u043b\u0435\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b react-lifecycle \u2014 \u2026 \u041d\u0435 \u0437\u043d\u0430\u044e. \u042f \u043d\u0435 \u043f\u0438\u0441\u0430\u043b \u0442\u0430\u043a\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u0443\u0436\u0435 \u0434\u0430\u0432\u043d\u043e. \u0412\u044b \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u0430\u044f \u043b\u043e\u0433\u0438\u043a\u0430 \u044d\u0442\u043e \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430? \u041c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c, \u0435\u0451 \u0441\u0442\u043e\u0438\u0442 \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e? <\/p>\n<p>  <\/p>\n<h3 id=\"pochemu-by-prosto-ne-ispolzovat-cypress-react-unit-test-zachem-mne-storybook\">\u041f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c cypress-react-unit-test? \u0417\u0430\u0447\u0435\u043c \u043c\u043d\u0435 Storybook?<\/h3>\n<p>  <\/p>\n<p>\u0412\u043d\u0435 \u0441\u043e\u043c\u043d\u0435\u043d\u0438\u0439 \u2014 \u0437\u0430 \u044d\u0442\u0438\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u043c \u0431\u0443\u0434\u0443\u0449\u0435\u0435. \u0417\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u043f\u0430\u0434\u0451\u0442 \u0441\u0430\u043c\u0430 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 Storybook, \u0442\u0435\u0441\u0442\u044b \u0431\u0443\u0434\u0443\u0442 \u0446\u0435\u043b\u0438\u043a\u043e\u043c \u043f\u043e\u0434 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e Cypress, \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u0441\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0438 \u0442.\u0434.<\/p>\n<p>  <\/p>\n<p>\u041d\u043e \u0441\u0435\u0439\u0447\u0430\u0441 \u044d\u0442\u043e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0438\u043c\u0435\u0435\u0442 <a href=\"https:\/\/github.com\/bahmutov\/cypress-react-unit-test\/issues\/34\">\u0440\u044f\u0434<\/a> <a href=\"https:\/\/github.com\/bahmutov\/cypress-react-unit-test\/issues\/52\">\u043f\u0440\u043e\u0431\u043b\u0435\u043c <\/a>\u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043a\u0430\u043a \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u0443\u044e \u0441\u0440\u0435\u0434\u0443 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0442\u0435\u0441\u0442\u043e\u0432. <\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u0434\u0435\u044e\u0441\u044c, Gleb Bahmutov \u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 Cypress \u0441\u043f\u0440\u0430\u0432\u044f\u0442\u0441\u044f \u0441 \u044d\u0442\u0438\u043c\u0438 \u0442\u0440\u0443\u0434\u043d\u043e\u0441\u0442\u044f\u043c\u0438.<\/p>\n<p>  <\/p>\n<p>P.S.: \u041c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u0438 \u043c\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u043b\u043b\u0435\u0433 \u0441\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0435\u0440\u0435\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043c\u043e\u043d\u043e\u043f\u043e\u043b\u0438\u044e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0445 js-dom. \u0427\u0442\u043e \u0432\u044b \u0434\u0443\u043c\u0430\u0435\u0442\u0435 \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0432\u043e\u0434\u0443?<\/p>\n<\/div>\n<p> \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\/post\/497544\/\"> https:\/\/habr.com\/ru\/post\/497544\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/497544\/\">\n<p>\u0421\u043f\u0435\u0440\u0432\u0430 Cypress \u0432\u043e\u0441\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u043b\u0441\u044f \u043a\u0430\u043a \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 e2e-\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0411\u044b\u043b\u043e \u043b\u044e\u0431\u043e\u043f\u044b\u0442\u043d\u043e \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u0437\u0430 \u0440\u043e\u0441\u0442\u043e\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0430 front-end \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u043e\u0432 \u043a \u0442\u0435\u043c\u0435, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u0441\u044e \u0436\u0438\u0437\u043d\u044c \u043f\u0440\u0430\u0432\u0438\u043b Selenium. \u0412 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u0442\u0438\u043f\u0438\u0447\u043d\u043e\u0435 \u0432\u0438\u0434\u0435\u043e \u0438\u043b\u0438 \u0441\u0442\u0430\u0442\u044c\u044f, \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u044e\u0449\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 Cypress, \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0431\u043b\u0443\u0436\u0434\u0430\u043d\u0438\u0435\u043c \u043f\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u043c\u0443 \u0441\u0430\u0439\u0442\u0443 \u0438 \u0437\u0430\u0441\u043b\u0443\u0436\u0435\u043d\u043d\u044b\u043c\u0438 \u043b\u0435\u0441\u0442\u043d\u044b\u043c\u0438 \u043e\u0442\u0437\u044b\u0432\u0430\u043c\u0438 \u043e\u0431 API \u0434\u043b\u044f \u0432\u0432\u043e\u0434\u0430 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>  <\/p>\n<p>\u041c\u043d\u043e\u0433\u0438\u0435 \u0438\u0437 \u043d\u0430\u0441 \u0434\u043e\u0433\u0430\u0434\u0430\u043b\u0438\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Cypress \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0432 \u0438\u0437\u043e\u043b\u044f\u0446\u0438\u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u043e\u0439 \u0442\u0430\u043a\u0438\u043c\u0438 \u0441\u0440\u0435\u0434\u0430\u043c\u0438 \u043a\u0430\u043a Storybook\/Styleguidist\/Docz. \u0425\u043e\u0440\u043e\u0448\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u2014 \u0441\u0442\u0430\u0442\u044c\u044f Stefano Magni <a href=\"https:\/\/itnext.io\/testing-a-virtual-list-component-with-cypress-and-storybook-494dc2d1d26b\">&quot;Testing a Virtual List component with Cypress and Storybook&quot;<\/a>. \u0412 \u043d\u0435\u0439 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0442\u044c Storybook Story, \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u043d\u0435\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0438 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u044b \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0430. \u042d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u0445\u043e\u0440\u043e\u0448, \u043d\u043e \u0432 \u043d\u0451\u043c \u0442\u0435\u0441\u0442 \u0440\u0430\u0437\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u0435\u0436\u0434\u0443 Storybook \u0438 Cypress. \u0415\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u043c\u043d\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u0442\u0430\u043a\u0438\u0435 \u0442\u0435\u0441\u0442\u044b \u0431\u0443\u0434\u0435\u0442 \u0441\u043b\u043e\u0436\u043d\u043e \u0447\u0438\u0442\u0430\u0442\u044c \u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c.<\/p>\n<p>  <\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u043e\u043f\u044b\u0442\u0430\u044e\u0441\u044c \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0430\u043a \u043f\u043e\u0439\u0442\u0438 \u0447\u0443\u0442\u044c \u0434\u0430\u043b\u044c\u0448\u0435 \u0438 \u0432\u0437\u044f\u0442\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c \u043e\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0442\u044c JavaScript \u0432 Cypress. \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043f\u0440\u043e\u0448\u0443 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c <a href=\"https:\/\/github.com\/daedalius\/article-exposing-component-from-storybook-to-handle-them-in-cypress\">\u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434<\/a> \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b <strong>npm i<\/strong> \u0438 <strong>npm run test<\/strong>.<\/p>\n<p>  <\/p>\n<p>tl; dr:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0438\u0437 Storybook Story \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0446\u0435\u043b\u0438\u043a\u043e\u043c \u0441\u0438\u043b\u0430\u043c\u0438 Cypress (\u043d\u0435 \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u044f \u043b\u043e\u0433\u0438\u043a\u0443 \u0442\u0435\u0441\u0442\u0430 \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0447\u0430\u0441\u0442\u0435\u0439).<\/li>\n<li>Cypress \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043d\u0430\u0448\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u0435 \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043a\u043e \u043c\u043e\u0449\u043d\u044b\u043c, \u0447\u0442\u043e \u043c\u044b \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u0442\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u043e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0445 js-dom \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f UI-\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432.<br \/>\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-301997","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/301997","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=301997"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/301997\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=301997"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=301997"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=301997"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}