{"id":414036,"date":"2024-06-29T23:30:47","date_gmt":"2024-06-29T23:30:47","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=414036"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-06-29T23:30:47","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=414036","title":{"rendered":"<span>\u041f\u0435\u0440\u0435\u0445\u043e\u0434 \u0441 Puppeteer \u043d\u0430 Playwright<\/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<h2>Puppeteer \u0438 Playwright \u0441\u0435\u0433\u043e\u0434\u043d\u044f<\/h2>\n<p>\u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0443 \u044d\u0442\u0438\u0445 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432 \u043c\u043d\u043e\u0433\u043e \u043e\u0431\u0449\u0435\u0433\u043e,\u00a0<a href=\"https:\/\/pptr.dev\/\" rel=\"noopener noreferrer nofollow\"><u>Puppeteer<\/u><\/a>\u00a0\u0438\u00a0<a href=\"https:\/\/playwright.dev\/\" rel=\"noopener noreferrer nofollow\"><u>Playwright<\/u><\/a>\u00a0\u0440\u0430\u0437\u0432\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0441 \u0440\u0430\u0437\u043d\u043e\u0439 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c\u044e, \u0438 \u0441\u0435\u0439\u0447\u0430\u0441 Playwright \u043d\u0430\u0431\u0440\u0430\u043b \u043e\u0431\u043e\u0440\u043e\u0442\u044b \u0438 \u043e\u0441\u0442\u0430\u0432\u0438\u043b Puppeteer \u043f\u043e\u0437\u0430\u0434\u0438.<\/p>\n<p>\u042d\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u043b\u043e \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043c\u043d\u043e\u0433\u0438\u0435 \u043f\u0435\u0440\u0435\u0448\u043b\u0438 \u0441 Puppeteer \u043d\u0430 Playwright. \u042d\u0442\u043e \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u043a\u0430\u043a\u0438\u0435 \u043d\u0443\u0436\u043d\u044b \u0448\u0430\u0433\u0438 \u0438 \u043a\u0430\u043a\u0438\u0435 \u043d\u043e\u0432\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u044d\u0442\u043e\u0442 \u043f\u0435\u0440\u0435\u0445\u043e\u0434. \u041f\u0443\u0441\u0442\u044c \u0432\u0430\u0441 \u043d\u0435 \u0441\u043c\u0443\u0449\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043c \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438, \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0431\u044b\u0441\u0442\u0440\u043e \u0438 \u0431\u0435\u0437\u0431\u043e\u043b\u0435\u0437\u043d\u0435\u043d\u043d\u043e.<\/p>\n<h3>\u0417\u0430\u0447\u0435\u043c \u043d\u0443\u0436\u0435\u043d \u043f\u0435\u0440\u0435\u0445\u043e\u0434?<\/h3>\n<p>\u0414\u043b\u044f \u043f\u043e\u043b\u043d\u043e\u0433\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 \u0432\u044b\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0435\u0433\u043e \u043f\u043b\u044e\u0441\u043e\u0432 \u0438 \u043c\u0438\u043d\u0443\u0441\u043e\u0432 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f (<a href=\"https:\/\/blog.checklyhq.com\/cypress-vs-selenium-vs-playwright-vs-puppeteer-speed-comparison\/\" rel=\"noopener noreferrer nofollow\"><u>\u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f<\/u><\/a>\u00a0\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432), \u0430 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u043d\u0430 Playwright \u0432\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043c\u0430\u043b\u043e \u0443\u0441\u0438\u043b\u0438\u0439.<\/p>\n<ol>\n<li>\n<p>\u041d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u044c\u0438, \u043a\u043e\u043c\u0430\u043d\u0434\u0430 Playwright \u0447\u0430\u0441\u0442\u043e \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u043b\u0438 \u043a\u0440\u0443\u043f\u043d\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0438 \u0440\u044b\u043d\u043e\u043a \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438, \u0430 Puppeteer, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0432\u044b\u043f\u0443\u0441\u043a\u0430\u043b \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u043b \u043e\u0448\u0438\u0431\u043a\u0438.<\/p>\n<\/li>\n<li>\n<p>Playwright \u0438\u043c\u0435\u0435\u0442 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0432 E2E \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f\u0445, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043c\u0435\u043d\u044c\u0448\u0435\u043c\u0443 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u0435\u0441\u0442\u043e\u0432 \u0438 \u0431\u043e\u043b\u0435\u0435 \u0431\u044b\u0441\u0442\u0440\u043e\u043c\u0443 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p>\u0422\u0435\u0441\u0442\u044b Playwright, \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0434\u0430\u0436\u0435 \u0431\u043e\u043b\u0435\u0435 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e, \u0447\u0435\u043c \u0438\u0445 \u0443\u0436\u0435 \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0435 \u0430\u043d\u0430\u043b\u043e\u0433\u0438 \u0438\u0437 Puppeteer.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e Playwright \u043d\u0430 GitHub, Twitter, Slack \u043e\u0447\u0435\u043d\u044c \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0435, \u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e Puppeteer \u2014 \u0432\u0441\u0435 \u0442\u0438\u0448\u0435 \u0438 \u0442\u0438\u0448\u0435.<\/p>\n<\/li>\n<\/ol>\n<h2>\u041a\u0430\u043a\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0434\u043e \u0432\u043d\u0435\u0441\u0442\u0438 \u0432 \u0432\u0430\u0448\u0438\u0445 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u2014 \u043a\u0440\u0430\u0442\u043a\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f<\/h2>\n<p>\u041d\u0438\u0436\u0435 \u0432\u044b\u00a0\u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0439\u0442\u0438 \u0448\u043f\u0430\u0440\u0433\u0430\u043b\u043a\u0443 \u0441 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438 Puppeteer \u0438 \u0430\u043d\u0430\u043b\u043e\u0433 \u043a\u043e\u043c\u0430\u043d\u0434 Playwright.<\/p>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p><strong>PUPPETEER<\/strong><\/p>\n<\/th>\n<th>\n<p><strong>PLAYWRIGHT<\/strong><\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p>require(&#8216;puppeteer&#8217;)<\/p>\n<\/td>\n<td>\n<p>require(&#8216;playwright&#8217;)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>puppeteer.launch(&#8230;)<\/p>\n<\/td>\n<td>\n<p>playwright.chromium.launch(&#8230;)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>browser.createIncognitoBrowserContext(&#8230;)<\/p>\n<\/td>\n<td>\n<p>browser.newContext(&#8230;)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>page.setViewport(&#8230;)<\/p>\n<\/td>\n<td>\n<p>page.setViewportSize(&#8230;)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>page.waitForSelector(selector) page.click(selector);<\/p>\n<\/td>\n<td>\n<p>page.click(selector)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>page.waitForXPath(XPathSelector)<\/p>\n<\/td>\n<td>\n<p>page.waitForSelector(XPathSelector)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>page.$x(xpath_selector)<\/p>\n<\/td>\n<td>\n<p>page.$(xpath_selector)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>page.waitForNetworkIdle(&#8230;)<\/p>\n<\/td>\n<td>\n<p>page.waitForLoadState({ state: &#8216;networkidle&#8217; }})<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>page.waitForFileChooser(&#8230;)<\/p>\n<\/td>\n<td>\n<p>Removed handled differently.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>page.waitFor(timeout)<\/p>\n<\/td>\n<td>\n<p>page.waitForTimeout(timeout)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>page.type(selector, text)<\/p>\n<\/td>\n<td>\n<p>page.fill(selector, text)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>page.cookies([&#8230;urls])<\/p>\n<\/td>\n<td>\n<p>browserContext.cookies([urls])<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>page.deleteCookie(&#8230;cookies)<\/p>\n<\/td>\n<td>\n<p>browserContext.clearCookies()<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>page.setCookie(&#8230;cookies)<\/p>\n<\/td>\n<td>\n<p>browserContext.addCookies(cookies)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>page.on(&#8216;request&#8217;, &#8230;)<\/p>\n<\/td>\n<td>\n<p>\u041e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 page.route.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>elementHandle.uploadFile(&#8230;)<\/p>\n<\/td>\n<td>\n<p>elementHandle.setInputFiles(&#8230;)<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h2>\u0427\u0442\u043e \u043d\u0430\u0434\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u0445 \u2014 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e<\/h2>\n<h3>\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0412 Puppeteer \u043f\u0435\u0440\u0432\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432\u0430\u0448\u0435\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u0438 \u0431\u044b \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"javascript\">const puppeteer = require('puppeteer');  (async () => {   const browser = await puppeteer.launch();   const page = await browser.newPage();    \/\/ ...<\/code><\/pre>\n<p>\u0412 Playwright \u0432\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0441\u0438\u043b\u044c\u043d\u043e \u043c\u0435\u043d\u044f\u0442\u044c \u043a\u043e\u0434:<\/p>\n<pre><code class=\"javascript\">const { chromium } = require('playwright');  (async () => {   const browser = await chromium.launch();   const page = await browser.newPage();    \/\/ ...<\/code><\/pre>\n<p>Playwright \u0438\u043c\u0435\u0435\u0442 \u043a\u0440\u043e\u0441\u0441\u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043d\u0443\u044e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438, \u0438 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u044b\u0431\u0440\u0430\u0442\u044c, \u0441 \u043a\u0430\u043a\u0438\u043c \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043e\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440\u00a0<code>const { webkit } = require('playwright');<\/code>\u00a0\u0412 Puppeteer \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430:<br \/><code>const browser = await puppeteer.launch({ product: 'firefox' })<\/code><\/p>\n<h3>browser context<\/h3>\n<p><a href=\"https:\/\/playwright.dev\/docs\/api\/class-browsercontext\" rel=\"noopener noreferrer nofollow\"><u>Browser contexts<\/u><\/a>\u00a0\u0443\u0436\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 Puppeteer:<\/p>\n<pre><code class=\"javascript\">const browser = await puppeteer.launch(); const context = await browser.createIncognitoBrowserContext(); const page = await context.newPage();<\/code><\/pre>\n<p>API Playwright \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0435\u0433\u043e \u043f\u043e \u0434\u0440\u0443\u0433\u043e\u043c\u0443:<\/p>\n<pre><code class=\"javascript\">const browser = await chromium.launch(); const context = await browser.newContext(); const page = await context.newPage();<\/code><\/pre>\n<p>\u041a\u0430\u043a \u0438 \u0432 Puppeteer, \u0434\u043b\u044f \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u0438 \u043e\u0434\u043d\u043e\u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043d\u044b\u0445 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e:<\/p>\n<pre><code class=\"javascript\">const browser = await chromium.launch(); const page = await browser.newPage();<\/code><\/pre>\n<blockquote>\n<p><em>\u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0441\u043e\u043c\u043d\u0435\u043d\u0438\u044f, \u044f\u0432\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043d\u043e\u0432\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0432\u0430\u0448\u0435\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430.<\/em><\/p>\n<\/blockquote>\n<h3>\u041e\u0436\u0438\u0434\u0430\u043d\u0438\u044f<\/h3>\n<p>\u041c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f \u0432 Playwright \u044d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0432\u0430\u043c, \u043d\u0435 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0431\u0435\u0441\u043f\u043e\u043a\u043e\u0438\u0442\u044c\u0441\u044f \u043e \u044f\u0432\u043d\u043e\u043c \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0438. \u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438, \u0432\u044b \u0437\u0430\u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0437\u043d\u0430\u0442\u044c \u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u0445 \u044f\u0432\u043d\u043e\u0433\u043e \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u0439.<\/p>\n<p>Playwright \u0432\u043d\u043e\u0441\u0438\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u043e\u043c\u043d\u0438\u0442\u044c:<\/p>\n<ol>\n<li>\n<p><code>page.waitForNavigation<\/code>\u00a0\u0438\u00a0<code>page.waitForSelector<\/code>\u00a0\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c, \u043d\u043e \u0432\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0432 \u043d\u0438\u0445 \u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0438\u0437-\u0437\u0430 \u0443\u043c\u043d\u043e\u0433\u043e \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f<\/p>\n<\/li>\n<li>\n<p><code>page.waitForEvent,<\/code>\u00a0\u0431\u044b\u043b \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d.<\/p>\n<\/li>\n<li>\n<p>Puppeteer\u2019s\u00a0<code>page.waitForXPath<\/code>\u00a0\u0431\u044b\u043b \u0432\u043a\u043b\u044e\u0447\u0435\u043d \u0432\u00a0<code>page.waitForSelector<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0435\u0442 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f XPath.<\/p>\n<\/li>\n<li>\n<p><code>page.waitForFileChooser<\/code>\u00a0\u0431\u044b\u043b \u0443\u0434\u0430\u043b\u0435\u043d(\u0441\u043c\u00a0<a href=\"https:\/\/playwright.dev\/docs\/input#upload-files\" rel=\"noopener noreferrer nofollow\"><u>\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443<\/u><\/a>\u00a0\u0438 \u043d\u0430\u0448\u00a0<a href=\"https:\/\/www.checklyhq.com\/learn\/headless\/e2e-account-settings\/\" rel=\"noopener noreferrer nofollow\"><u>\u043f\u0440\u0438\u043c\u0435\u0440 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0444\u0430\u0439\u043b\u0430<\/u><\/a>)<\/p>\n<\/li>\n<li>\n<p><code>page.waitForNetworkIdle<\/code>\u00a0\u0431\u044b\u043b \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d \u0441<code>page.waitForLoadState<\/code>(\u0441\u043c. \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u00a0<em>networkidle<\/em>, \u0447\u0442\u043e\u0431\u044b \u0432\u043e\u0441\u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435)<\/p>\n<\/li>\n<li>\n<p>\u0411\u044b\u043b \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u00a0<code>page.waitForUrl\u00a0<\/code>, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u0434\u043e\u0436\u0434\u0430\u0442\u044c\u0441\u044f, \u043f\u043e\u043a\u0430 URL-\u0430\u0434\u0440\u0435\u0441 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d \u0441 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c \u0444\u0440\u0435\u0439\u043c\u043e\u043c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b.<\/p>\n<\/li>\n<li>\n<p><code>page.waitFor(timeout)<\/code>\u00a0\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f\u00a0<code>page.waitForTimeout(timeout)<\/code><\/p>\n<\/li>\n<\/ol>\n<blockquote>\n<p><em>\u041d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u043c, \u0447\u0442\u043e\u00a0<\/em><code>page.waitForTimeout<\/code><em>\u00a0<\/em>\u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f\u0445! \u0416\u0435\u0441\u0442\u043a\u0438\u0435 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f \/\u0441\u043f\u044f\u0449\u0438\u0435 \u0440\u0435\u0436\u0438\u043c\u044b \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0446\u0435\u043b\u044f\u0445 \u043e\u0442\u043b\u0430\u0434\u043a\u0438.<\/p>\n<\/blockquote>\n<h3>Viewport<\/h3>\n<p>Puppeteer\u2019s\u00a0<code>page.setViewport<\/code>\u00a0\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f\u00a0<code>page.setViewportSize<\/code>\u00a0\u0432 Playwright.<\/p>\n<h3>\u0412\u0432\u043e\u0434 \u0442\u0435\u043a\u0441\u0442\u0430<\/h3>\n<p>\u0412 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a \u0443\u00a0<code>puppeteer<\/code><em>\u00a0page.type<\/em>, \u043e\u043d \u0436\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0432 Playwright \u0438 \u043f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0441 \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u044b, Playwright \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 page.fill \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0438 \u043e\u0447\u0438\u0441\u0442\u043a\u0438 \u0444\u043e\u0440\u043c.<\/p>\n<h3>Cookies<\/h3>\n<p>\u0421\u0442\u0430\u0440\u043e\u0435:<\/p>\n<ol>\n<li>\n<p><code>page.cookies([...urls])<\/code><\/p>\n<\/li>\n<li>\n<p><code>page.deleteCookie(...cookies)<\/code><\/p>\n<\/li>\n<li>\n<p><code>page.setCookie(...cookies)<\/code><\/p>\n<\/li>\n<\/ol>\n<p>\u041d\u043e\u0432\u043e\u0435:<\/p>\n<ol>\n<li>\n<p><code>browserContext.cookies([urls])<\/code><\/p>\n<\/li>\n<li>\n<p><code>browserContext.clearCookies()<\/code><\/p>\n<\/li>\n<li>\n<p><code>browserContext.addCookies(cookies)<\/code><\/p>\n<\/li>\n<\/ol>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u044f \u0432 \u043c\u0435\u0442\u043e\u0434\u0430\u0445 \u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u0445 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0444\u0430\u0439\u043b\u043e\u0432 cookie.<\/p>\n<h3>XPath selectors<\/h3>\n<p>XPath selectors \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442\u0441\u044f \u0441 (<code>\/\/<\/code>\u00a0\u0438\u043b\u0438\u00a0<code>..<\/code>) Playwright \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0438\u0445 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0435\u0442, \u0442\u043e\u0433\u0434\u0430 \u043a\u0430\u043a \u0443 Puppeteer \u0431\u044b\u043b\u0438 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u043b\u044f \u043d\u0438\u0445. \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0432\u0430\u043c \u043d\u0430\u0434\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c\u00a0<code>page.$(xpath_selector)<\/code>\u0432\u043c\u0435\u0441\u0442\u043e\u00a0<code>page.$x(xpath_selector)<\/code>, \u0438\u00a0<code>page.waitForSelector(xpath_selector)<\/code>\u00a0\u0432\u043c\u0435\u0441\u0442\u043e\u00a0<code>page.waitForXPath(xpath_selector)<\/code>. \u0422\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0434\u043b\u044f<code>page.click<\/code>\u00a0\u0438\u00a0<code>page.fill<\/code>.<\/p>\n<h3>\u042d\u043c\u0443\u043b\u044f\u0446\u0438\u044f \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430<\/h3>\n<p><a href=\"https:\/\/playwright.dev\/docs\/emulation\/\" rel=\"noopener noreferrer nofollow\"><u>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u044d\u043c\u0443\u043b\u044f\u0446\u0438\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430<\/u><\/a>\u00a0\u0432 Playwright \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 Browser Context, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"javascript\">const pixel2 = devices['Pixel 2']; const context = await browser.newContext({  ...pixel2,});<\/code><\/pre>\n<p>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0432\u0430\u043c \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b permission \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u0430, \u0433\u0435\u043e\u043b\u043e\u043a\u0430\u0446\u0438\u044f \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b.<\/p>\n<h3>\u0421\u043a\u0430\u0447\u0430\u0442\u044c \u0444\u0430\u0439\u043b<\/h3>\n<p>\u041f\u043e\u043f\u044b\u0442\u043a\u0430 \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b \u0432 Puppeteer \u0432 headles \u0440\u0435\u0436\u0438\u043c\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439. Playwright \u0434\u0435\u043b\u0430\u0435\u0442 \u044d\u0442\u043e \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u043c:<\/p>\n<pre><code class=\"javascript\">const [download] = await Promise.all([   page.waitForEvent('download'),   page.click('#orders > ul > li:nth-child(1) > a') ]); const path = await download.path();<\/code><\/pre>\n<h3>\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0444\u0430\u0439\u043b<\/h3>\n<p>Puppeteer\u2019s\u00a0<code>elementHandle.uploadFile<\/code>\u00a0\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f\u00a0<code>elementHandle.setInputFiles<\/code>.<\/p>\n<p>\u0421\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043d\u0430\u0448\u00a0<a href=\"https:\/\/www.checklyhq.com\/learn\/headless\/e2e-account-settings\/\" rel=\"noopener noreferrer nofollow\"><u>\u043f\u0440\u0438\u043c\u0435\u0440 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0444\u0430\u0439\u043b\u043e\u0432<\/u><\/a>.<\/p>\n<h3>Request interception<\/h3>\n<p>\u041f\u0435\u0440\u0435\u0445\u0432\u0430\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 Puppeteer \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437\u00a0<code>page.on('request', ...)<\/code>:<\/p>\n<pre><code class=\"javascript\">await page.setRequestInterception(true)  page.on('request', (request) => {   if (request.resourceType() === 'image') request.abort()   else request.continue() })<\/code><\/pre>\n<p>\u0412 Playwright,\u00a0<code>page.route<\/code>\u00a0\u0438\u0449\u0435\u0442 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0435 URL-\u0430\u0434\u0440\u0435\u0441\u043e\u043c \u043f\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u043c\u0443 \u0448\u0430\u0431\u043b\u043e\u043d\u0443:<\/p>\n<pre><code class=\"javascript\">await page.route('**\/*', (route) => {   return route.request().resourceType() === 'image'     ? route.abort()     : route.continue() })<\/code><\/pre>\n<p>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e \u044d\u0442\u043e\u0439 \u0442\u0435\u043c\u0435 \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435\u00a0<a href=\"https:\/\/www.checklyhq.com\/learn\/headless\/request-interception\/\" rel=\"noopener noreferrer nofollow\"><u>\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u0439 \u0440\u0430\u0437\u0431\u043e\u0440<\/u><\/a>\u00a0\u043f\u043e \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432<\/p>\n<blockquote>\n<p><em>\u0414\u043b\u044f \u043c\u043d\u043e\u0433\u0438\u0445 \u043f\u0443\u043d\u043a\u0442\u043e\u0432 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u0432\u044b\u0448\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u043e\u0434\u043d\u043e\u0439 \u0438 \u0442\u043e\u0439 \u0436\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435\u00a0<\/em><code>Page<\/code>,\u00a0<code>Frame<\/code>\u00a0and\u00a0<code>ElementHandle<\/code>\u00a0level. \u0414\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u043c\u044b \u0441\u043e\u043e\u0431\u0449\u0438\u043b\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0431 \u043e\u0434\u043d\u043e\u043c.<\/p>\n<\/blockquote>\n<h2>\u041d\u043e\u0432\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0443\u0436\u043d\u043e \u0437\u043d\u0430\u0442\u044c<\/h2>\n<p>\u041f\u0440\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0435 \u043e\u0442 Puppeteer \u043a Playwright \u0443\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u0432\u044b \u0437\u043d\u0430\u0435\u0442\u0435 \u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u043d\u043e\u0432\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 Playwright, \u043e\u043d\u0438 \u043f\u043e\u043c\u043e\u0433\u0443\u0442 \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0432\u0430\u0448\u0435\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u043b\u0438 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430.<\/p>\n<h3>\u041d\u043e\u0432\u044b\u0435 \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u044b<\/h3>\n<p>Playwright \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u044c \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0438 \u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0447\u0435\u0440\u0435\u0437 \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u044b, \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u044f \u0434\u0440\u0443\u0433\u0438\u0435 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u044b \u0432\u044b\u0431\u043e\u0440\u0430. \u041f\u043e\u043c\u0438\u043c\u043e CSS \u0438 XPath, \u043a\u043e\u043c\u0430\u043d\u0434\u0430 Playwright \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442:<\/p>\n<ol>\n<li>\n<p>Playwright \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u044b\u0439 \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440:\u00a0<code>:nth-match(:text(\"Buy\"), 3)<\/code><\/p>\n<\/li>\n<li>\n<p>\u0421\u0435\u043b\u0435\u043a\u0442\u043e\u0440 \u043f\u043e \u0442\u0435\u043a\u0441\u0442\u0443.:\u00a0<code>text=Add to Cart<\/code><\/p>\n<\/li>\n<li>\n<p>\u0421\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u044b:\u00a0<code>css=preview >> text=In stock<\/code><\/p>\n<\/li>\n<\/ol>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435\u00a0<a href=\"https:\/\/playwright.dev\/docs\/extensibility\/#custom-selector-engines\" rel=\"noopener noreferrer nofollow\"><u>\u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440<\/u><\/a><\/p>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u044b \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u0432\u00a0<a href=\"https:\/\/www.checklyhq.com\/learn\/headless\/basics-selectors\/\" rel=\"noopener noreferrer nofollow\"><u>\u043d\u0430\u0448\u0435\u043c \u043f\u043e\u043b\u043d\u043e\u043c \u0440\u0430\u0437\u0431\u043e\u0440<\/u><\/a>.<\/p>\n<h3>\u0421\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0438 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f<\/h3>\n<p>Playwright \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 (\u0444\u0430\u0439\u043b\u044b cookie \u0438 localStorage) \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u0435\u0430\u043d\u0441\u0430 \u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0434\u043b\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u0432 \u0442\u0435\u0441\u0442\u043e\u0432.<\/p>\n<p>\u041f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u00a0<a href=\"https:\/\/www.checklyhq.com\/learn\/headless\/valuable-tests\/#keep-tests-independent\" rel=\"noopener noreferrer nofollow\"><u>\u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f<\/u><\/a>\u00a0\u0432 \u0442\u0435\u0441\u0442\u0430\u0445, \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u044f \u044d\u0442\u0430\u043f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438, \u0433\u0434\u0435 \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c<\/p>\n<h3>Locator API<\/h3>\n<p>\u0412\u0430\u0441 \u0437\u0430\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 API-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 Playwright Locator, \u044d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u0434\u043b\u044f \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044f \u043b\u0435\u0433\u043a\u043e \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0442\u044c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 DOM \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432 \u0432\u0430\u0448\u0435\u043c \u0442\u0435\u0441\u0442\u0435. \u042d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u043e, \u0435\u0441\u043b\u0438 \u0432\u044b \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u0443\u0435\u0442\u0435 \u0441\u0432\u043e\u0438 \u0442\u0435\u0441\u0442\u044b \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441\u00a0<a href=\"https:\/\/martinfowler.com\/bliki\/PageObject.html\" rel=\"noopener noreferrer nofollow\"><u>Page Object Model<\/u><\/a>, \u0438\u043b\u0438 \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u044d\u0442\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c<\/p>\n<h3>Playwright Inspector<\/h3>\n<p>Playwright Inspector \u2014 \u044d\u0442\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0441 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u0434\u043e\u0431\u0435\u043d \u043f\u0440\u0438 \u043e\u0442\u043b\u0430\u0434\u043a\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044f \u043f\u043e\u0448\u0430\u0433\u043e\u0432\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043f\u043e \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044e, \u0438\u043b\u0438 \u043d\u0430\u0439\u0442\u0438 \u043f\u0440\u0438\u0447\u0438\u043d\u0443 \u0441\u0431\u043e\u044f.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/13c\/74a\/1c3\/13c74a1c30869b466d4cd79d2535042d.png\" alt=\"PLAYWRIGHT INSPECTOR\" title=\"PLAYWRIGHT INSPECTOR\" width=\"1400\" height=\"849\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/13c\/74a\/1c3\/13c74a1c30869b466d4cd79d2535042d.png\"\/><figcaption>PLAYWRIGHT INSPECTOR<\/figcaption><\/figure>\n<p>Inspector \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0441\u0432\u043e\u0435\u0439 \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0442\u044c \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u044b \u0434\u043b\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0438 \u0434\u0430\u0436\u0435 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u0441 \u043d\u0443\u043b\u044f.<\/p>\n<h3>Playwright test runner<\/h3>\n<p>Playwright \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f,\u00a0<a href=\"https:\/\/playwright.dev\/docs\/intro\" rel=\"noopener noreferrer nofollow\"><u>Playwright Test<\/u><\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f e2e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u0440\u0430\u0441\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u044f\u043c\u043e \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438, \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0445\u0443\u043a\u0438 \u0438 \u043c\u043d\u043e\u0433\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435.<\/p>\n<h3>Trace Viewer<\/h3>\n<p><a href=\"https:\/\/playwright.dev\/docs\/trace-viewer\" rel=\"noopener noreferrer nofollow\"><u>Playwright Trace Viewer<\/u><\/a>\u00a0\u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c trace, \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Playwright Test \u0438\u043b\u0438 BrowserContext Tracing API. \u0422\u0440\u0430\u0441\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u2014 \u044d\u0442\u043e \u0442\u043e \u043c\u0435\u0441\u0442\u043e, \u0433\u0434\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0432\u0430\u0448\u0435\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/8e0\/f6e\/98d\/8e0f6e98df98275d3340fdb915631273.png\" alt=\"TRACE INSPECTION WITH TRAVE VIEWER\" title=\"TRACE INSPECTION WITH TRAVE VIEWER\" width=\"1400\" height=\"857\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8e0\/f6e\/98d\/8e0f6e98df98275d3340fdb915631273.png\"\/><figcaption>TRACE INSPECTION WITH TRAVE VIEWER<\/figcaption><\/figure>\n<h3>\u0413\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0442\u0435\u0441\u0442\u043e\u0432<\/h3>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u00a0<a href=\"https:\/\/playwright.dev\/docs\/codegen\" rel=\"noopener noreferrer nofollow\"><u>Playwright Test Generator<\/u><\/a>\u00a0\u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0432 \u0432\u0430\u0448\u0435\u043c \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442, \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043a \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0443 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044e.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/1fc\/4a0\/289\/1fc4a02896cd889f8e2a45596ac4571a.png\" width=\"1400\" height=\"848\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1fc\/4a0\/289\/1fc4a02896cd889f8e2a45596ac4571a.png\"\/><figcaption><\/figcaption><\/figure>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><\/p>\n<div class=\"tm-article-poll-container\"><!--[--><\/p>\n<div class=\"tm-article-poll tm-article-poll_variant-bordered\">\n<div class=\"tm-notice tm-notice_positive tm-article-poll__notice\"><!----><\/p>\n<div class=\"tm-notice__inner\"><!----><\/p>\n<div class=\"tm-notice__content\" data-test-id=\"notice-content\"><!--[--><span>\u0422\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u043e\u043f\u0440\u043e\u0441\u0435. <a rel=\"nofollow\" href=\"\/kek\/v1\/auth\/habrahabr\/?back=\/ru\/articles\/594489\/&#038;hl=ru\">\u0412\u043e\u0439\u0434\u0438\u0442\u0435<\/a>, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430.<\/span><!--]--><\/div>\n<\/div>\n<\/div>\n<p><!--[--><\/p>\n<div class=\"tm-article-poll__header\">\u041d\u0430 \u043a\u0430\u043a\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0442\u044b?<\/div>\n<div class=\"tm-article-poll__answers\"><!--[--><\/p>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">24.62% <\/span><span class=\"tm-article-poll__answer-label\">Puppeteer<\/span><span class=\"tm-article-poll__answer-votes\">16<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width: 24.62%\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent tm-article-poll__answer-percent_winning\">56.92% <\/span><span class=\"tm-article-poll__answer-label\">Playwright<\/span><span class=\"tm-article-poll__answer-votes\">37<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress tm-article-poll__answer-progress_winning\" style=\"width: 56.92%\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">18.46% <\/span><span class=\"tm-article-poll__answer-label\">Selenium<\/span><span class=\"tm-article-poll__answer-votes\">12<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width: 18.46%\"><\/div>\n<\/div>\n<\/div>\n<p><!--]--><\/div>\n<div class=\"tm-article-poll__stats\"> \u041f\u0440\u043e\u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043b\u0438 65 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.   \u0412\u043e\u0437\u0434\u0435\u0440\u0436\u0430\u043b\u0441\u044f 31 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c. <\/div>\n<p><!--]--><\/div>\n<p><!--]--><\/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\/articles\/594489\/\"> https:\/\/habr.com\/ru\/articles\/594489\/<\/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<h2>Puppeteer \u0438 Playwright \u0441\u0435\u0433\u043e\u0434\u043d\u044f<\/h2>\n<p>\u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0443 \u044d\u0442\u0438\u0445 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432 \u043c\u043d\u043e\u0433\u043e \u043e\u0431\u0449\u0435\u0433\u043e,\u00a0<a href=\"https:\/\/pptr.dev\/\" rel=\"noopener noreferrer nofollow\"><u>Puppeteer<\/u><\/a>\u00a0\u0438\u00a0<a href=\"https:\/\/playwright.dev\/\" rel=\"noopener noreferrer nofollow\"><u>Playwright<\/u><\/a>\u00a0\u0440\u0430\u0437\u0432\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0441 \u0440\u0430\u0437\u043d\u043e\u0439 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c\u044e, \u0438 \u0441\u0435\u0439\u0447\u0430\u0441 Playwright \u043d\u0430\u0431\u0440\u0430\u043b \u043e\u0431\u043e\u0440\u043e\u0442\u044b \u0438 \u043e\u0441\u0442\u0430\u0432\u0438\u043b Puppeteer \u043f\u043e\u0437\u0430\u0434\u0438.<\/p>\n<p>\u042d\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u043b\u043e \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043c\u043d\u043e\u0433\u0438\u0435 \u043f\u0435\u0440\u0435\u0448\u043b\u0438 \u0441 Puppeteer \u043d\u0430 Playwright. \u042d\u0442\u043e \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u043a\u0430\u043a\u0438\u0435 \u043d\u0443\u0436\u043d\u044b \u0448\u0430\u0433\u0438 \u0438 \u043a\u0430\u043a\u0438\u0435 \u043d\u043e\u0432\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u044d\u0442\u043e\u0442 \u043f\u0435\u0440\u0435\u0445\u043e\u0434. \u041f\u0443\u0441\u0442\u044c \u0432\u0430\u0441 \u043d\u0435 \u0441\u043c\u0443\u0449\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043c \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438, \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0431\u044b\u0441\u0442\u0440\u043e \u0438 \u0431\u0435\u0437\u0431\u043e\u043b\u0435\u0437\u043d\u0435\u043d\u043d\u043e.<\/p>\n<h3>\u0417\u0430\u0447\u0435\u043c \u043d\u0443\u0436\u0435\u043d \u043f\u0435\u0440\u0435\u0445\u043e\u0434?<\/h3>\n<p>\u0414\u043b\u044f \u043f\u043e\u043b\u043d\u043e\u0433\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 \u0432\u044b\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0435\u0433\u043e \u043f\u043b\u044e\u0441\u043e\u0432 \u0438 \u043c\u0438\u043d\u0443\u0441\u043e\u0432 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f (<a href=\"https:\/\/blog.checklyhq.com\/cypress-vs-selenium-vs-playwright-vs-puppeteer-speed-comparison\/\" rel=\"noopener noreferrer nofollow\"><u>\u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f<\/u><\/a>\u00a0\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432), \u0430 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u043d\u0430 Playwright \u0432\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043c\u0430\u043b\u043e \u0443\u0441\u0438\u043b\u0438\u0439.<\/p>\n<ol>\n<li>\n<p>\u041d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u044c\u0438, \u043a\u043e\u043c\u0430\u043d\u0434\u0430 Playwright \u0447\u0430\u0441\u0442\u043e \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u043b\u0438 \u043a\u0440\u0443\u043f\u043d\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0438 \u0440\u044b\u043d\u043e\u043a \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438, \u0430 Puppeteer, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0432\u044b\u043f\u0443\u0441\u043a\u0430\u043b \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u043b \u043e\u0448\u0438\u0431\u043a\u0438.<\/p>\n<\/li>\n<li>\n<p>Playwright \u0438\u043c\u0435\u0435\u0442 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0432 E2E \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f\u0445, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043c\u0435\u043d\u044c\u0448\u0435\u043c\u0443 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u0435\u0441\u0442\u043e\u0432 \u0438 \u0431\u043e\u043b\u0435\u0435 \u0431\u044b\u0441\u0442\u0440\u043e\u043c\u0443 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p>\u0422\u0435\u0441\u0442\u044b Playwright, \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0434\u0430\u0436\u0435 \u0431\u043e\u043b\u0435\u0435 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e, \u0447\u0435\u043c \u0438\u0445 \u0443\u0436\u0435 \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0435 \u0430\u043d\u0430\u043b\u043e\u0433\u0438 \u0438\u0437 Puppeteer.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e Playwright \u043d\u0430 GitHub, Twitter, Slack \u043e\u0447\u0435\u043d\u044c \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0435, \u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e Puppeteer \u2014 \u0432\u0441\u0435 \u0442\u0438\u0448\u0435 \u0438 \u0442\u0438\u0448\u0435.<\/p>\n<\/li>\n<\/ol>\n<h2>\u041a\u0430\u043a\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0434\u043e \u0432\u043d\u0435\u0441\u0442\u0438 \u0432 \u0432\u0430\u0448\u0438\u0445 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u2014 \u043a\u0440\u0430\u0442\u043a\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f<\/h2>\n<p>\u041d\u0438\u0436\u0435 \u0432\u044b\u00a0\u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0439\u0442\u0438 \u0448\u043f\u0430\u0440\u0433\u0430\u043b\u043a\u0443 \u0441 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438 Puppeteer \u0438 \u0430\u043d\u0430\u043b\u043e\u0433 \u043a\u043e\u043c\u0430\u043d\u0434 Playwright.<\/p>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p><strong>PUPPETEER<\/strong><\/p>\n<\/th>\n<th>\n<p><strong>PLAYWRIGHT<\/strong><\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p>require(&#8216;puppeteer&#8217;)<\/p>\n<\/td>\n<td>\n<p>require(&#8216;playwright&#8217;)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>puppeteer.launch(&#8230;)<\/p>\n<\/td>\n<td>\n<p>playwright.chromium.launch(&#8230;)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>browser.createIncognitoBrowserContext(&#8230;)<\/p>\n<\/td>\n<td>\n<p>browser.newContext(&#8230;)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>page.setViewport(&#8230;)<\/p>\n<\/td>\n<td>\n<p>page.setViewportSize(&#8230;)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>page.waitForSelector(selector) page.click(selector);<\/p>\n<\/td>\n<td>\n<p>page.click(selector)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>page.waitForXPath(XPathSelector)<\/p>\n<\/td>\n<td>\n<p>page.waitForSelector(XPathSelector)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>page.$x(xpath_selector)<\/p>\n<\/td>\n<td>\n<p>page.$(xpath_selector)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>page.waitForNetworkIdle(&#8230;)<\/p>\n<\/td>\n<td>\n<p>page.waitForLoadState({ state: &#8216;networkidle&#8217; }})<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>page.waitForFileChooser(&#8230;)<\/p>\n<\/td>\n<td>\n<p>Removed handled differently.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>page.waitFor(timeout)<\/p>\n<\/td>\n<td>\n<p>page.waitForTimeout(timeout)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>page.type(selector, text)<\/p>\n<\/td>\n<td>\n<p>page.fill(selector, text)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>page.cookies([&#8230;urls])<\/p>\n<\/td>\n<td>\n<p>browserContext.cookies([urls])<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>page.deleteCookie(&#8230;cookies)<\/p>\n<\/td>\n<td>\n<p>browserContext.clearCookies()<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>page.setCookie(&#8230;cookies)<\/p>\n<\/td>\n<td>\n<p>browserContext.addCookies(cookies)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>page.on(&#8216;request&#8217;, &#8230;)<\/p>\n<\/td>\n<td>\n<p>\u041e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 page.route.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>elementHandle.uploadFile(&#8230;)<\/p>\n<\/td>\n<td>\n<p>elementHandle.setInputFiles(&#8230;)<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h2>\u0427\u0442\u043e \u043d\u0430\u0434\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u0445 \u2014 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e<\/h2>\n<h3>\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0412 Puppeteer \u043f\u0435\u0440\u0432\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432\u0430\u0448\u0435\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u0438 \u0431\u044b \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"javascript\">const puppeteer = require('puppeteer');  (async () => {   const browser = await puppeteer.launch();   const page = await browser.newPage();    \/\/ ...<\/code><\/pre>\n<p>\u0412 Playwright \u0432\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0441\u0438\u043b\u044c\u043d\u043e \u043c\u0435\u043d\u044f\u0442\u044c \u043a\u043e\u0434:<\/p>\n<pre><code class=\"javascript\">const { chromium } = require('playwright');  (async () => {   const browser = await chromium.launch();   const page = await browser.newPage();    \/\/ ...<\/code><\/pre>\n<p>Playwright \u0438\u043c\u0435\u0435\u0442 \u043a\u0440\u043e\u0441\u0441\u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043d\u0443\u044e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438, \u0438 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u044b\u0431\u0440\u0430\u0442\u044c, \u0441 \u043a\u0430\u043a\u0438\u043c \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043e\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440\u00a0<code>const { webkit } = require('playwright');<\/code>\u00a0\u0412 Puppeteer \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430:<br \/><code>const browser = await puppeteer.launch({ product: 'firefox' })<\/code><\/p>\n<h3>browser context<\/h3>\n<p><a href=\"https:\/\/playwright.dev\/docs\/api\/class-browsercontext\" rel=\"noopener noreferrer nofollow\"><u>Browser contexts<\/u><\/a>\u00a0\u0443\u0436\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 Puppeteer:<\/p>\n<pre><code class=\"javascript\">const browser = await puppeteer.launch(); const context = await browser.createIncognitoBrowserContext(); const page = await context.newPage();<\/code><\/pre>\n<p>API Playwright \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0435\u0433\u043e \u043f\u043e \u0434\u0440\u0443\u0433\u043e\u043c\u0443:<\/p>\n<pre><code class=\"javascript\">const browser = await chromium.launch(); const context = await browser.newContext(); const page = await context.newPage();<\/code><\/pre>\n<p>\u041a\u0430\u043a \u0438 \u0432 Puppeteer, \u0434\u043b\u044f \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u0438 \u043e\u0434\u043d\u043e\u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043d\u044b\u0445 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e:<\/p>\n<pre><code class=\"javascript\">const browser = await chromium.launch(); const page = await browser.newPage();<\/code><\/pre>\n<blockquote>\n<p><em>\u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0441\u043e\u043c\u043d\u0435\u043d\u0438\u044f, \u044f\u0432\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043d\u043e\u0432\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0432\u0430\u0448\u0435\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430.<\/em><\/p>\n<\/blockquote>\n<h3>\u041e\u0436\u0438\u0434\u0430\u043d\u0438\u044f<\/h3>\n<p>\u041c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f \u0432 Playwright \u044d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0432\u0430\u043c, \u043d\u0435 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0431\u0435\u0441\u043f\u043e\u043a\u043e\u0438\u0442\u044c\u0441\u044f \u043e \u044f\u0432\u043d\u043e\u043c \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0438. \u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438, \u0432\u044b \u0437\u0430\u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0437\u043d\u0430\u0442\u044c \u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u0445 \u044f\u0432\u043d\u043e\u0433\u043e \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u0439.<\/p>\n<p>Playwright \u0432\u043d\u043e\u0441\u0438\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u043e\u043c\u043d\u0438\u0442\u044c:<\/p>\n<ol>\n<li>\n<p><code>page.waitForNavigation<\/code>\u00a0\u0438\u00a0<code>page.waitForSelector<\/code>\u00a0\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c, \u043d\u043e \u0432\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0432 \u043d\u0438\u0445 \u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0438\u0437-\u0437\u0430 \u0443\u043c\u043d\u043e\u0433\u043e \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f<\/p>\n<\/li>\n<li>\n<p><code>page.waitForEvent,<\/code>\u00a0\u0431\u044b\u043b \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d.<\/p>\n<\/li>\n<li>\n<p>Puppeteer\u2019s\u00a0<code>page.waitForXPath<\/code>\u00a0\u0431\u044b\u043b \u0432\u043a\u043b\u044e\u0447\u0435\u043d \u0432\u00a0<code>page.waitForSelector<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0435\u0442 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f XPath.<\/p>\n<\/li>\n<li>\n<p><code>page.waitForFileChooser<\/code>\u00a0\u0431\u044b\u043b \u0443\u0434\u0430\u043b\u0435\u043d(\u0441\u043c\u00a0<a href=\"https:\/\/playwright.dev\/docs\/input#upload-files\" rel=\"noopener noreferrer nofollow\"><u>\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443<\/u><\/a>\u00a0\u0438 \u043d\u0430\u0448\u00a0<a href=\"https:\/\/www.checklyhq.com\/learn\/headless\/e2e-account-settings\/\" rel=\"noopener noreferrer nofollow\"><u>\u043f\u0440\u0438\u043c\u0435\u0440 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0444\u0430\u0439\u043b\u0430<\/u><\/a>)<\/p>\n<\/li>\n<li>\n<p><code>page.waitForNetworkIdle<\/code>\u00a0\u0431\u044b\u043b \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d \u0441<code>page.waitForLoadState<\/code>(\u0441\u043c. \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u00a0<em>networkidle<\/em>, \u0447\u0442\u043e\u0431\u044b \u0432\u043e\u0441\u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435)<\/p>\n<\/li>\n<li>\n<p>\u0411\u044b\u043b \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u00a0<code>page.waitForUrl\u00a0<\/code>, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u0434\u043e\u0436\u0434\u0430\u0442\u044c\u0441\u044f, \u043f\u043e\u043a\u0430 URL-\u0430\u0434\u0440\u0435\u0441 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d \u0441 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c \u0444\u0440\u0435\u0439\u043c\u043e\u043c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b.<\/p>\n<\/li>\n<li>\n<p><code>page.waitFor(timeout)<\/code>\u00a0\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f\u00a0<code>page.waitForTimeout(timeout)<\/code><\/p>\n<\/li>\n<\/ol>\n<blockquote>\n<p><em>\u041d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u043c, \u0447\u0442\u043e\u00a0<\/em><code>page.waitForTimeout<\/code><em>\u00a0<\/em>\u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f\u0445! \u0416\u0435\u0441\u0442\u043a\u0438\u0435 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f \/\u0441\u043f\u044f\u0449\u0438\u0435 \u0440\u0435\u0436\u0438\u043c\u044b \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0446\u0435\u043b\u044f\u0445 \u043e\u0442\u043b\u0430\u0434\u043a\u0438.<\/p>\n<\/blockquote>\n<h3>Viewport<\/h3>\n<p>Puppeteer\u2019s\u00a0<code>page.setViewport<\/code>\u00a0\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f\u00a0<code>page.setViewportSize<\/code>\u00a0\u0432 Playwright.<\/p>\n<h3>\u0412\u0432\u043e\u0434 \u0442\u0435\u043a\u0441\u0442\u0430<\/h3>\n<p>\u0412 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a \u0443\u00a0<code>puppeteer<\/code><em>\u00a0page.type<\/em>, \u043e\u043d \u0436\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0432 Playwright \u0438 \u043f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0441 \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u044b, Playwright \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 page.fill \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0438 \u043e\u0447\u0438\u0441\u0442\u043a\u0438 \u0444\u043e\u0440\u043c.<\/p>\n<h3>Cookies<\/h3>\n<p>\u0421\u0442\u0430\u0440\u043e\u0435:<\/p>\n<ol>\n<li>\n<p><code>page.cookies([...urls])<\/code><\/p>\n<\/li>\n<li>\n<p><code>page.deleteCookie(...cookies)<\/code><\/p>\n<\/li>\n<li>\n<p><code>page.setCookie(...cookies)<\/code><\/p>\n<\/li>\n<\/ol>\n<p>\u041d\u043e\u0432\u043e\u0435:<\/p>\n<ol>\n<li>\n<p><code>browserContext.cookies([urls])<\/code><\/p>\n<\/li>\n<li>\n<p><code>browserContext.clearCookies()<\/code><\/p>\n<\/li>\n<li>\n<p><code>browserContext.addCookies(cookies)<\/code><\/p>\n<\/li>\n<\/ol>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u044f \u0432 \u043c\u0435\u0442\u043e\u0434\u0430\u0445 \u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u0445 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0444\u0430\u0439\u043b\u043e\u0432 cookie.<\/p>\n<h3>XPath selectors<\/h3>\n<p>XPath selectors \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442\u0441\u044f \u0441 (<code>\/\/<\/code>\u00a0\u0438\u043b\u0438\u00a0<code>..<\/code>) Playwright \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0438\u0445 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0435\u0442, \u0442\u043e\u0433\u0434\u0430 \u043a\u0430\u043a \u0443 Puppeteer \u0431\u044b\u043b\u0438 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u043b\u044f \u043d\u0438\u0445. \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0432\u0430\u043c \u043d\u0430\u0434\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c\u00a0<code>page.$(xpath_selector)<\/code>\u0432\u043c\u0435\u0441\u0442\u043e\u00a0<code>page.$x(xpath_selector)<\/code>, \u0438\u00a0<code>page.waitForSelector(xpath_selector)<\/code>\u00a0\u0432\u043c\u0435\u0441\u0442\u043e\u00a0<code>page.waitForXPath(xpath_selector)<\/code>. \u0422\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0434\u043b\u044f<code>page.click<\/code>\u00a0\u0438\u00a0<code>page.fill<\/code>.<\/p>\n<h3>\u042d\u043c\u0443\u043b\u044f\u0446\u0438\u044f \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430<\/h3>\n<p><a href=\"https:\/\/playwright.dev\/docs\/emulation\/\" rel=\"noopener noreferrer nofollow\"><u>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u044d\u043c\u0443\u043b\u044f\u0446\u0438\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430<\/u><\/a>\u00a0\u0432 Playwright \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 Browser Context, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"javascript\">const pixel2 = devices['Pixel 2']; const context = await browser.newContext({  ...pixel2,});<\/code><\/pre>\n<p>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0432\u0430\u043c \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b permission \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u0430, \u0433\u0435\u043e\u043b\u043e\u043a\u0430\u0446\u0438\u044f \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b.<\/p>\n<h3>\u0421\u043a\u0430\u0447\u0430\u0442\u044c \u0444\u0430\u0439\u043b<\/h3>\n<p>\u041f\u043e\u043f\u044b\u0442\u043a\u0430 \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b \u0432 Puppeteer \u0432 headles \u0440\u0435\u0436\u0438\u043c\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439. Playwright \u0434\u0435\u043b\u0430\u0435\u0442 \u044d\u0442\u043e \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u043c:<\/p>\n<pre><code class=\"javascript\">const [download] = await Promise.all([   page.waitForEvent('download'),   page.click('#orders > ul > li:nth-child(1) > a') ]); const path = await download.path();<\/code><\/pre>\n<h3>\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0444\u0430\u0439\u043b<\/h3>\n<p>Puppeteer\u2019s\u00a0<code>elementHandle.uploadFile<\/code>\u00a0\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f\u00a0<code>elementHandle.setInputFiles<\/code>.<\/p>\n<p>\u0421\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043d\u0430\u0448\u00a0<a href=\"https:\/\/www.checklyhq.com\/learn\/headless\/e2e-account-settings\/\" rel=\"noopener noreferrer nofollow\"><u>\u043f\u0440\u0438\u043c\u0435\u0440 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0444\u0430\u0439\u043b\u043e\u0432<\/u><\/a>.<\/p>\n<h3>Request interception<\/h3>\n<p>\u041f\u0435\u0440\u0435\u0445\u0432\u0430\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 Puppeteer \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437\u00a0<code>page.on('request', ...)<\/code>:<\/p>\n<pre><code class=\"javascript\">await page.setRequestInterception(true)  page.on('request', (request) => {   if (request.resourceType() === 'image') request.abort()   else request.continue() })<\/code><\/pre>\n<p>\u0412 Playwright,\u00a0<code>page.route<\/code>\u00a0\u0438\u0449\u0435\u0442 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0435 URL-\u0430\u0434\u0440\u0435\u0441\u043e\u043c \u043f\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u043c\u0443 \u0448\u0430\u0431\u043b\u043e\u043d\u0443:<\/p>\n<pre><code class=\"javascript\">await page.route('**\/*', (route) => {   return route.request().resourceType() === 'image'     ? route.abort()     : route.continue() })<\/code><\/pre>\n<p>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e \u044d\u0442\u043e\u0439 \u0442\u0435\u043c\u0435 \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435\u00a0<a href=\"https:\/\/www.checklyhq.com\/learn\/headless\/request-interception\/\" rel=\"noopener noreferrer nofollow\"><u>\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u0439 \u0440\u0430\u0437\u0431\u043e\u0440<\/u><\/a>\u00a0\u043f\u043e \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432<\/p>\n<blockquote>\n<p><em>\u0414\u043b\u044f \u043c\u043d\u043e\u0433\u0438\u0445 \u043f\u0443\u043d\u043a\u0442\u043e\u0432 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u0432\u044b\u0448\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u043e\u0434\u043d\u043e\u0439 \u0438 \u0442\u043e\u0439 \u0436\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435\u00a0<\/em><code>Page<\/code>,\u00a0<code>Frame<\/code>\u00a0and\u00a0<code>ElementHandle<\/code>\u00a0level. \u0414\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u043c\u044b \u0441\u043e\u043e\u0431\u0449\u0438\u043b\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0431 \u043e\u0434\u043d\u043e\u043c.<\/p>\n<\/blockquote>\n<h2>\u041d\u043e\u0432\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0443\u0436\u043d\u043e \u0437\u043d\u0430\u0442\u044c<\/h2>\n<p>\u041f\u0440\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0435 \u043e\u0442 Puppeteer \u043a Playwright \u0443\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u0432\u044b \u0437\u043d\u0430\u0435\u0442\u0435 \u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u043d\u043e\u0432\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 Playwright, \u043e\u043d\u0438 \u043f\u043e\u043c\u043e\u0433\u0443\u0442 \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0432\u0430\u0448\u0435\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u043b\u0438 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430.<\/p>\n<h3>\u041d\u043e\u0432\u044b\u0435 \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u044b<\/h3>\n<p>Playwright \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u044c \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0438 \u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0447\u0435\u0440\u0435\u0437 \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u044b, \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u044f \u0434\u0440\u0443\u0433\u0438\u0435 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u044b \u0432\u044b\u0431\u043e\u0440\u0430. \u041f\u043e\u043c\u0438\u043c\u043e CSS \u0438 XPath, \u043a\u043e\u043c\u0430\u043d\u0434\u0430 Playwright \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442:<\/p>\n<ol>\n<li>\n<p>Playwright \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u044b\u0439 \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440:\u00a0<code>:nth-match(:text(\"Buy\"), 3)<\/code><\/p>\n<\/li>\n<li>\n<p>\u0421\u0435\u043b\u0435\u043a\u0442\u043e\u0440 \u043f\u043e \u0442\u0435\u043a\u0441\u0442\u0443.:\u00a0<code>text=Add to Cart<\/code><\/p>\n<\/li>\n<li>\n<p>\u0421\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u044b:\u00a0<code>css=preview >> text=In stock<\/code><\/p>\n<\/li>\n<\/ol>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435\u00a0<a href=\"https:\/\/playwright.dev\/docs\/extensibility\/#custom-selector-engines\" rel=\"noopener noreferrer nofollow\"><u>\u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440<\/u><\/a><\/p>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u044b \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u0432\u00a0<a href=\"https:\/\/www.checklyhq.com\/learn\/headless\/basics-selectors\/\" rel=\"noopener noreferrer nofollow\"><u>\u043d\u0430\u0448\u0435\u043c \u043f\u043e\u043b\u043d\u043e\u043c \u0440\u0430\u0437\u0431\u043e\u0440<\/u><\/a>.<\/p>\n<h3>\u0421\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0438 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f<\/h3>\n<p>Playwright \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 (\u0444\u0430\u0439\u043b\u044b cookie \u0438 localStorage) \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u0435\u0430\u043d\u0441\u0430 \u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0434\u043b\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u0432 \u0442\u0435\u0441\u0442\u043e\u0432.<\/p>\n<p>\u041f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u00a0<a href=\"https:\/\/www.checklyhq.com\/learn\/headless\/valuable-tests\/#keep-tests-independent\" rel=\"noopener noreferrer nofollow\"><u>\u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f<\/u><\/a>\u00a0\u0432 \u0442\u0435\u0441\u0442\u0430\u0445, \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u044f \u044d\u0442\u0430\u043f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438, \u0433\u0434\u0435 \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c<\/p>\n<h3>Locator API<\/h3>\n<p>\u0412\u0430\u0441 \u0437\u0430\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 API-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 Playwright Locator, \u044d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u0434\u043b\u044f \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044f \u043b\u0435\u0433\u043a\u043e \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0442\u044c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 DOM \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432 \u0432\u0430\u0448\u0435\u043c \u0442\u0435\u0441\u0442\u0435. \u042d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u043e, \u0435\u0441\u043b\u0438 \u0432\u044b \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u0443\u0435\u0442\u0435 \u0441\u0432\u043e\u0438 \u0442\u0435\u0441\u0442\u044b \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441\u00a0<a href=\"https:\/\/martinfowler.com\/bliki\/PageObject.html\" rel=\"noopener noreferrer nofollow\"><u>Page Object Model<\/u><\/a>, \u0438\u043b\u0438 \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u044d\u0442\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c<\/p>\n<h3>Playwright Inspector<\/h3>\n<p>Playwright Inspector \u2014 \u044d\u0442\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0441 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u0434\u043e\u0431\u0435\u043d \u043f\u0440\u0438 \u043e\u0442\u043b\u0430\u0434\u043a\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044f \u043f\u043e\u0448\u0430\u0433\u043e\u0432\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043f\u043e \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044e, \u0438\u043b\u0438 \u043d\u0430\u0439\u0442\u0438 \u043f\u0440\u0438\u0447\u0438\u043d\u0443 \u0441\u0431\u043e\u044f.<\/p>\n<figure class=\"full-width\"><figcaption>PLAYWRIGHT INSPECTOR<\/figcaption><\/figure>\n<p>Inspector \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0441\u0432\u043e\u0435\u0439 \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0442\u044c \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u044b \u0434\u043b\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0438 \u0434\u0430\u0436\u0435 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u0441 \u043d\u0443\u043b\u044f.<\/p>\n<h3>Playwright test runner<\/h3>\n<p>Playwright \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f,\u00a0<a href=\"https:\/\/playwright.dev\/docs\/intro\" rel=\"noopener noreferrer nofollow\"><u>Playwright Test<\/u><\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f e2e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u0440\u0430\u0441\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u044f\u043c\u043e \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438, \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0445\u0443\u043a\u0438 \u0438 \u043c\u043d\u043e\u0433\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435.<\/p>\n<h3>Trace Viewer<\/h3>\n<p><a href=\"https:\/\/playwright.dev\/docs\/trace-viewer\" rel=\"noopener noreferrer nofollow\"><u>Playwright Trace Viewer<\/u><\/a>\u00a0\u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c trace, \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Playwright Test \u0438\u043b\u0438 BrowserContext Tracing API. \u0422\u0440\u0430\u0441\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u2014 \u044d\u0442\u043e \u0442\u043e \u043c\u0435\u0441\u0442\u043e, \u0433\u0434\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0432\u0430\u0448\u0435\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430.<\/p>\n<figure class=\"full-width\"><figcaption>TRACE INSPECTION WITH TRAVE VIEWER<\/figcaption><\/figure>\n<h3>\u0413\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0442\u0435\u0441\u0442\u043e\u0432<\/h3>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u00a0<a href=\"https:\/\/playwright.dev\/docs\/codegen\" rel=\"noopener noreferrer nofollow\"><u>Playwright Test Generator<\/u><\/a>\u00a0\u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0432 \u0432\u0430\u0448\u0435\u043c \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442, \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043a \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0443 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044e.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><\/p>\n<div class=\"tm-article-poll-container\"><!--[--><\/p>\n<div class=\"tm-article-poll tm-article-poll_variant-bordered\">\n<div class=\"tm-notice tm-notice_positive tm-article-poll__notice\"><!----><\/p>\n<div class=\"tm-notice__inner\"><!----><\/p>\n<div class=\"tm-notice__content\" data-test-id=\"notice-content\"><!--[--><span>\u0422\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u043e\u043f\u0440\u043e\u0441\u0435. <a rel=\"nofollow\" href=\"\/kek\/v1\/auth\/habrahabr\/?back=\/ru\/articles\/594489\/&#038;hl=ru\">\u0412\u043e\u0439\u0434\u0438\u0442\u0435<\/a>, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430.<\/span><!--]--><\/div>\n<\/div>\n<\/div>\n<p><!--[--><\/p>\n<div class=\"tm-article-poll__header\">\u041d\u0430 \u043a\u0430\u043a\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0442\u044b?<\/div>\n<div class=\"tm-article-poll__answers\"><!--[--><\/p>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">24.62% <\/span><span class=\"tm-article-poll__answer-label\">Puppeteer<\/span><span class=\"tm-article-poll__answer-votes\">16<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width: 24.62%\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent tm-article-poll__answer-percent_winning\">56.92% <\/span><span class=\"tm-article-poll__answer-label\">Playwright<\/span><span class=\"tm-article-poll__answer-votes\">37<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress tm-article-poll__answer-progress_winning\" style=\"width: 56.92%\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">18.46% <\/span><span class=\"tm-article-poll__answer-label\">Seleni<\/span><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-414036","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/414036","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=414036"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/414036\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=414036"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=414036"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=414036"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}