{"id":328077,"date":"2022-01-16T09:00:12","date_gmt":"2022-01-16T09:00:12","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=328077"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=328077","title":{"rendered":"<span>\u041d\u0430\u0447\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Playwright (\u0427\u0430\u0441\u0442\u044c 2)<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h3><\/h3>\n<details class=\"spoiler\">\n<summary>End to End Testing c 30DaysOfPlaywright<\/summary>\n<div class=\"spoiler__content\">\n<ul>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/publication\/edit\/596873\/\" rel=\"noopener noreferrer nofollow\">\u0414\u0435\u043d\u044c 0. \u0423\u0447\u0438\u043c\u0441\u044f e2e-\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e \u0441 Playwright | #30DaysOfPlaywright<\/a><a href=\"https:\/\/habr.com\/ru\/post\/597293\/\" rel=\"noopener noreferrer nofollow\">\u0414\u0435\u043d\u044c 1. \u041d\u0430\u0447\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Playwright (\u0427\u0430\u0441\u0442\u044c 1)<\/a><\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0447\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Playwright (\u0427\u0430\u0441\u0442\u044c 2)<\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/details>\n<h2>? | \u0412\u0430\u0436\u043d\u044b\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b:<\/h2>\n<ul>\n<li>\n<p><a href=\"https:\/\/playwright.dev\/docs\/intro\" rel=\"noopener noreferrer nofollow\"><u>Getting Started<\/u><\/a> \u2013 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 \u0433\u0430\u0439\u0434 \u043f\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/playwright.dev\/docs\/actionability\" rel=\"noopener noreferrer nofollow\"><u>Auto-waiting<\/u><\/a> \u2013 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u044b \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u044f \u043d\u0430\u0434\u0435\u0436\u043d\u043e\u0441\u0442\u0438 \u0442\u0435\u0441\u0442\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/playwright.dev\/docs\/test-timeouts#expect-timeout\" rel=\"noopener noreferrer nofollow\"><u>Web-First Assertions<\/u><\/a> \u2013 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043f\u043e\u0432\u0442\u043e\u0440\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0432\u043f\u043b\u043e\u0442\u044c \u0434\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0436\u0435\u043b\u0430\u0435\u043c\u043e\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/playwright.dev\/docs\/test-fixtures#introduction-to-fixtures\" rel=\"noopener noreferrer nofollow\"><u>Test Fixtures<\/u><\/a> \u2013 \u043f\u043e\u043c\u043e\u0449\u044c \u0432 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/playwright.dev\/docs\/intro#using-test-hooks\" rel=\"noopener noreferrer nofollow\"><u>Test Hooks<\/u><\/a> \u2013 \u043f\u043e\u043c\u043e\u0449\u044c \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u0438 \u043e\u0447\u0438\u0441\u0442\u043a\u0435 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0439 \u0441\u0440\u0435\u0434\u044b \u0438\u043b\u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/youtu.be\/JjhY2aFBTTk\" rel=\"noopener noreferrer nofollow\"><u>Introduction to Playwright Test runner<\/u><\/a> \u2013 \u0432\u0432\u043e\u0434\u043d\u044b\u0439 \u0432\u0438\u0434\u0435\u043e\u0433\u0430\u0439\u0434 \u043f\u043e \u0432\u0441\u0435\u043c \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044f\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430.<\/p>\n<\/li>\n<\/ul>\n<h2>? \u0417\u0430\u0434\u0430\u0447\u0438 2-\u0433\u043e \u0434\u043d\u044f #30DaysOfPlaywright!<\/h2>\n<p>\u041c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0434\u043d\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043b \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043d\u0430\u0448\u0443 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u0441\u0440\u0435\u0434\u0443 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u041f\u0440\u0438\u0448\u043b\u0430 \u043f\u043e\u0440\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u043e\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e, \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0432 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438 Playwright, \u0432 \u0447\u0438\u0441\u043b\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0445:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/playwright.dev\/docs\/intro#writing-assertions\" rel=\"noopener noreferrer nofollow\"><u>\u041d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 assertions<\/u><\/a> \u2013 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e\u0433\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/playwright.dev\/docs\/intro#using-test-fixtures\" rel=\"noopener noreferrer nofollow\"><u>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 test fixtures<\/u><\/a> \u2013 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u043e\u0433\u043e page\/browser context \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0442\u0435\u0441\u0442\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/playwright.dev\/docs\/intro#using-test-hooks\" rel=\"noopener noreferrer nofollow\"><u>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 test hooks<\/u><\/a> \u2013 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0438 \u043e\u0447\u0438\u0441\u0442\u043a\u0430 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u043c\u0435\u0436\u0434\u0443 \u0442\u0435\u0441\u0442\u0430\u043c\u0438.<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0432\u044b \u043d\u0430\u0439\u0434\u0435\u0442\u0435 \u043a\u0440\u0430\u0442\u043a\u043e\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0438 \u0437\u0430\u0447\u0435\u043c \u043e\u043d \u043d\u0443\u0436\u0435\u043d. \u0412 \u0431\u0443\u0434\u0443\u0449\u0438\u0445 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f\u0445 \u043a\u0430\u0436\u0434\u0430\u044f \u0438\u0437 \u0442\u0435\u043c \u0431\u0443\u0434\u0435\u0442 \u0438\u0437\u0443\u0447\u0435\u043d\u0430 \u0443\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u043d\u043e. \u0418\u0442\u0430\u043a, \u043d\u0430\u0447\u043d\u0435\u043c!<\/p>\n<h3>\u041e\u0441\u043d\u043e\u0432\u044b Playwright<\/h3>\n<p>\u0412 <a href=\"https:\/\/habr.com\/ru\/post\/596873\/\" rel=\"noopener noreferrer nofollow\"><u>\u043c\u043e\u0435\u043c \u043f\u0435\u0440\u0432\u043e\u043c \u043f\u043e\u0441\u0442\u0435<\/u><\/a> \u044f \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u043e\u0432\u0430\u043b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0434\u043e\u043a\u043b\u0430\u0434 \u00a0<a href=\"https:\/\/youtu.be\/JjhY2aFBTTk\" rel=\"noopener noreferrer nofollow\"><u>Introduction to Playwright Test runner<\/u><\/a> \u043a\u0430\u043a \u0445\u043e\u0440\u043e\u0448\u0435\u0435 \u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0432 \u043e\u0441\u043d\u043e\u0432\u044b \u0440\u0430\u0431\u043e\u0442\u044b \u0441 <strong>Playwright<\/strong>. \u0421\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u043d\u0435\u0433\u043e \u0431\u0443\u0434\u0443\u0442 \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0442\u044c \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0440\u0430\u0437\u0434\u0435\u043b\u0430\u0445 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430.<\/p>\n<p>\u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u043d\u0438\u0436\u0435 \u0441\u043e\u0431\u0440\u0430\u043d \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u0441\u044b\u043b\u043e\u043a \u043d\u0430 \u0432\u0438\u0434\u0435\u043e \u0441 \u0442\u0430\u0439\u043c\u043a\u043e\u0434\u0430\u043c\u0438. \u0412\u043c\u0435\u0441\u0442\u0435 \u0441 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430\u043c\u0438 \u201c\u041d\u0430\u0447\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Playwright\u201d \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0434\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0437\u0430\u043d\u044f\u0442\u0438\u044f \u0438\u0437\u0443\u0447\u0438\u0442\u044c 1-3 \u0433\u043b\u0430\u0432\u0443 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430.<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/youtu.be\/JjhY2aFBTTk?t=121\" rel=\"noopener noreferrer nofollow\"><u>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435\u00a0 Playwright Test?<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/youtu.be\/JjhY2aFBTTk?t=149\" rel=\"noopener noreferrer nofollow\"><u>\u041f\u043e\u0447\u0435\u043c\u0443 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 Test runner?<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/youtu.be\/JjhY2aFBTTk?t=246\" rel=\"noopener noreferrer nofollow\"><u>\u0427\u0430\u0441\u0442\u044c 1: \u041d\u0430\u0447\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u044b &#8212; Demo<\/u><\/a> \u2013 Playwright Test \u0434\u0435\u043c\u043e.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/youtu.be\/JjhY2aFBTTk?t=560\" rel=\"noopener noreferrer nofollow\"><u>\u0427\u0430\u0441\u0442\u044c 1: \u041d\u0430\u0447\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u044b &#8212; Script<\/u><\/a> \u2013 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u0431\u043e\u0440 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/youtu.be\/JjhY2aFBTTk?t=609\" rel=\"noopener noreferrer nofollow\"><u>\u0427\u0430\u0441\u0442\u044c 2: \u041e\u0441\u043d\u043e\u0432\u044b<\/u><\/a> &#8212; \u0438\u0437\u043e\u043b\u044f\u0446\u0438\u044f \u0442\u0435\u0441\u0442\u043e\u0432, \u0443\u043c\u043d\u043e\u0435 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0435, \u0431\u0430\u0437\u043e\u0432\u044b\u0435 web-assertion.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/youtu.be\/JjhY2aFBTTk?t=971\" rel=\"noopener noreferrer nofollow\"><u>\u0427\u0430\u0441\u0442\u044c 3: \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f &#8212; Fixtures<\/u><\/a> \u2013 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u043e\u0442\u0447\u0435\u0442, \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/youtu.be\/JjhY2aFBTTk?t=1423\" rel=\"noopener noreferrer nofollow\"><u>\u0427\u0430\u0441\u0442\u044c 4: \u0418\u043d\u0441\u043f\u0435\u043a\u0442\u043e\u0440 \u0438 \u043a\u043e\u0434-\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440<\/u><\/a>.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/youtu.be\/JjhY2aFBTTk?t=1987\" rel=\"noopener noreferrer nofollow\"><u>\u0427\u0430\u0441\u0442\u044c 5: Playwright Tracing<\/u><\/a> \u2013 \u043e\u0442\u043b\u0430\u0434\u043a\u0430 \u043f\u043e\u0441\u043b\u0435 \u0442\u0435\u0441\u0442\u043e\u0432.\u00a0<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/youtu.be\/JjhY2aFBTTk?t=2548\" rel=\"noopener noreferrer nofollow\"><u>\u0420\u0435\u0437\u044e\u043c\u0435<\/u><\/a> \u2013 \u043d\u0430\u0447\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u044b, \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f, \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430, \u043e\u0442\u043b\u0430\u0434\u043a\u0430, trace.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/youtu.be\/JjhY2aFBTTk?t=2671\" rel=\"noopener noreferrer nofollow\"><u>Q&amp;A<\/u><\/a> \u2013 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u044f\u0437\u044b\u043a\u043e\u0432, \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u043c\u0438 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430\u043c\u0438.<\/p>\n<\/li>\n<\/ul>\n<h3>\u0420\u0430\u0437\u0431\u043e\u0440 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430<\/h3>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u043a \u043a\u043e\u0434\u0443 \u0438\u0437 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u0438 \u0432 \u043f\u0435\u0440\u0432\u044b\u0439 \u0434\u0435\u043d\u044c.<\/p>\n<pre><code class=\"javascript\">const { test, expect } = require('@playwright\/test');  test('basic test', async ({ page }) => {   await page.goto('https:\/\/playwright.dev\/');   const title = page.locator('.navbar__inner .navbar__title');   await expect(title).toHaveText('Playwright'); });<\/code><\/pre>\n<p>\u042d\u0442\u043e\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0444\u0443\u043d\u0434\u0430\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438 Playwright, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0442 \u043d\u0430\u0434\u0435\u0436\u043d\u043e\u0435 \u0441\u043a\u0432\u043e\u0437\u043d\u043e\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/playwright.dev\/docs\/actionability\" rel=\"noopener noreferrer nofollow\"><u>\u0423\u043c\u043d\u043e\u0435 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0435<\/u><\/a> \u2013 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u0435\u0440\u0435\u0434 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0448\u0435\u043d\u043d\u043e\u0433\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/playwright.dev\/docs\/test-timeouts#expect-timeout\" rel=\"noopener noreferrer nofollow\"><u>Web-First Assertions<\/u><\/a> \u2013 \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440, \u043f\u043e\u043a\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/playwright.dev\/docs\/test-fixtures#introduction-to-fixtures\" rel=\"noopener noreferrer nofollow\"><u>\u0422\u0435\u0441\u0442\u043e\u0432\u0430\u044f \u0438\u0437\u043e\u043b\u044f\u0446\u0438\u044f \u0441 fixtures<\/u><\/a> \u2013 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u0430\u0434\u0435\u0436\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u044b \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0440\u0430\u0441\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0432\u0430\u043d\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/playwright.dev\/docs\/intro#using-test-hooks\" rel=\"noopener noreferrer nofollow\"><u>Test Hooks<\/u><\/a> \u2013 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0438 \u043e\u0447\u0438\u0449\u0435\u043d\u0438\u0435 \u043e\u0431\u0449\u0438\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u043c\u0435\u0436\u0434\u0443 \u0442\u0435\u0441\u0442\u0430\u043c\u0438.<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0438\u0445 \u0432\u043a\u0440\u0430\u0442\u0446\u0435 \u043d\u0438\u0436\u0435.<\/p>\n<h4>Web Assertions<\/h4>\n<p>Playwright \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442<a href=\"https:\/\/jestjs.io\/docs\/expect\" rel=\"noopener noreferrer nofollow\"><u> \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 expect<\/u><\/a> \u0434\u043b\u044f \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0439. \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043b\u0438 \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e\u043c\u0443 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0443. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0449\u0430\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f. <\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"javascript\">expect(value).toEqual(0);<\/code><\/pre>\n<p>\u0421\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u043d\u044b, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0438\u0445 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f. \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0439 \u043c\u043e\u0436\u0435\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439, \u0435\u0441\u043b\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u0435\u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e. Playwright \u043f\u043e\u0432\u044b\u0448\u0430\u0435\u0442 \u043d\u0430\u0434\u0435\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430, \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 expect <a href=\"https:\/\/playwright.dev\/docs\/test-assertions\" rel=\"noopener noreferrer nofollow\"><u>\u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0443\u0434\u043e\u0431\u043d\u044b\u0445 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0445 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0439<\/u><\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0436\u0438\u0434\u0430\u044e\u0442, \u043f\u043e\u043a\u0430 \u0442\u0440\u0435\u0431\u0443\u044e\u0449\u0435\u0435\u0441\u044f \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043e.<\/p>\n<pre><code class=\"javascript\">await expect(page).toHaveTitle(\"Playwright\");<\/code><\/pre>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0439:<\/p>\n<pre><code class=\"javascript\">\/\/ assert.spec.js const { test, expect } = require('@playwright\/test');  test('my test', async ({ page }) => {   await page.goto('https:\/\/playwright.dev\/');    \/\/ Expect a title \"to contain\" a substring.   await expect(page).toHaveTitle(\/Playwright\/);    \/\/ Expect an attribute \"to be strictly equal\" to the value.   await expect(page.locator('text=Get Started').first()).toHaveAttribute('href', '\/docs\/intro');    \/\/ Expect an element \"to be visible\".   await expect(page.locator('text=Learn more').first()).toBeVisible();    await page.click('text=Get Started');   \/\/ Expect some text to be visible on the page.   await expect(page.locator('text=Introduction').first()).toBeVisible(); });<\/code><\/pre>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u0435\u0433\u043e \u0432 \u043d\u043e\u0432\u043e\u043c \u0444\u0430\u0439\u043b\u0435 (assert.spec.js) \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"bash\">$ npx playwright test assert.spec.js<\/code><\/pre>\n<p>\u0410\u0440\u0433\u0443\u043c\u0435\u043d\u0442 {page}, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0432 \u0442\u0435\u0441\u0442\u0435, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c <em>test fixture<\/em>. \u041e \u0442\u043e\u043c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0444\u0438\u043a\u0441\u0442\u0443\u0440\u044b, \u043c\u044b \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435.<\/p>\n<p>\u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u043f\u043e \u043a\u043b\u0430\u0441\u0441\u0443 page\u00a0 \u0438 \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u0447\u0442\u043e \u043e\u043d \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043c\u0435\u0442\u043e\u0434\u044b \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u043e\u0434\u043d\u043e\u0439 \u0432\u043a\u043b\u0430\u0434\u043a\u043e\u0439 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430 \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439.\u00a0\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<ul>\n<li>\n<p>\u043c\u0435\u0442\u043e\u0434\u00a0 <a href=\"https:\/\/playwright.dev\/docs\/api\/class-page#page-locator\" rel=\"noopener noreferrer nofollow\"><u>page.locator()<\/u><\/a> \u2013 \u044d\u0442\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430(\u043e\u0432) \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0441 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u043e\u0439 \u0434\u043b\u044f \u0435\u0433\u043e \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u0432 \u043d\u0443\u0436\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/playwright.dev\/docs\/api\/class-page#page-goto\" rel=\"noopener noreferrer nofollow\"><u>page.goto()<\/u><\/a> \u2013 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043d\u0430 \u043b\u044e\u0431\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/playwright.dev\/docs\/api\/class-page#page-click\" rel=\"noopener noreferrer nofollow\"><u>page.click()<\/u><\/a> \u2013 \u043a\u043b\u0438\u043a \u043f\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u0443.<\/p>\n<\/li>\n<\/ul>\n<p><a href=\"https:\/\/playwright.dev\/docs\/test-assertions\/\" rel=\"noopener noreferrer nofollow\"><u>\u0414\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044f \u0432 Playwright<\/u><\/a> \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u044b \u0432 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u043f\u043e\u0441\u0442\u043e\u0432.<\/p>\n<h4>Test Fixtures<\/h4>\n<p>\u0412\u0434\u043e\u0445\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 <a href=\"https:\/\/docs.pytest.org\/en\/latest\/explanation\/fixtures.html#about-fixtures\" rel=\"noopener noreferrer nofollow\"><u>pytest<\/u><\/a>-\u043e\u043c, test fixtures \u2013 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u0430\u0434\u0435\u0436\u043d\u043e\u0439 \u0438 \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0439 \u0441\u0440\u0435\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0442\u0435\u0441\u0442\u0430\u043c \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u043e, \u0447\u0442\u043e \u0438\u043c \u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 (\u0438 \u043d\u0435 \u0431\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e). Playwright Test \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0432\u0441\u0435 fixture, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u0442 \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u043e\u0434\u0438\u043d \u043e\u0431\u044a\u0435\u043a\u0442 \u0438 \u0434\u0435\u043b\u0430\u0435\u0442 \u0435\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c \u0434\u043b\u044f <em>test<\/em> \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430. \u041f\u043e \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u0438 \u0442\u0435\u0441\u0442\u0430 \u0444\u0438\u043a\u0441\u0442\u0443\u0440\u0430 \u0434\u0435\u043c\u043e\u043d\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f.<\/p>\n<p>\u041f\u043e\u0447\u0435\u043c\u0443 fixture? \u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043e\u043d\u0438 \u0441\u043e\u0437\u0434\u0430\u044e\u0442 \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0441\u0440\u0435\u0434\u0443 (\u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u043c\u043e\u0441\u0442\u044c \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f) \u0438 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0442 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0443\u044e \u0438\u0437\u043e\u043b\u044f\u0446\u0438\u044e \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430 \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430\u043c\u0438:<\/p>\n<ul>\n<li>\n<p>\u042d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c. \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0439\u0442\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u0441\u0442\u043e\u0432 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e, \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0438 \u0441 \u043c\u0435\u043d\u044c\u0448\u0438\u043c \u043e\u0431\u044a\u0435\u043c\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0422\u0430\u0440\u0433\u0435\u0442\u0438\u043d\u0433. \u041f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u043f\u0440\u043e\u0432\u0430\u043b\u0438\u0432\u0448\u0438\u0435\u0441\u044f \u0442\u0435\u0441\u0442\u044b \u0431\u0435\u0437 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0432\u0441\u0435\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430.<\/p>\n<\/li>\n<li>\n<p>\u0413\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0430. \u0413\u0440\u0443\u043f\u043f\u043e\u0432\u044b\u0435 \u0442\u0435\u0441\u0442\u044b \u043f\u0440\u043e\u0432\u043e\u0434\u044f\u0442\u0441\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043e\u0431\u0449\u0435\u0433\u043e \u0441\u043c\u044b\u0441\u043b\u0430, \u0430 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0439 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438.<\/p>\n<\/li>\n<\/ul>\n<p>Playwright \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441 \u0440\u044f\u0434\u043e\u043c <a href=\"https:\/\/playwright.dev\/docs\/api\/class-fixtures\/\" rel=\"noopener noreferrer nofollow\"><u>\u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 fixture<\/u><\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c.<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/playwright.dev\/docs\/api\/class-fixtures#fixtures-browser\" rel=\"noopener noreferrer nofollow\"><u>fixtures.browser<\/u><\/a> \u2013 \u043e\u0431\u0449\u0438\u0439 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430 (\u0434\u043b\u044f worker);<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/playwright.dev\/docs\/api\/class-fixtures#fixtures-browser-name\" rel=\"noopener noreferrer nofollow\"><u>fixtures.browserName<\/u><\/a> \u2013 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0437\u0430\u043f\u0443\u0441\u043a (chromium, firefox or webkit);<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/playwright.dev\/docs\/api\/class-fixtures#fixtures-context\" rel=\"noopener noreferrer nofollow\"><u>fixtures.context<\/u><\/a> \u2013 \u0438\u0437\u043e\u043b\u0438\u0440\u0443\u0435\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430 (\u0434\u043b\u044f test);<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/playwright.dev\/docs\/api\/class-fixtures#fixtures-page\" rel=\"noopener noreferrer nofollow\"><u>fixtures.page<\/u><\/a> \u2013 \u0438\u0437\u043e\u043b\u0438\u0440\u0443\u0435\u0442 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 (per test).<\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/playwright.dev\/docs\/test-fixtures\/#test-fixtures\" rel=\"noopener noreferrer nofollow\"><u>Test Fixture<\/u><\/a> \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u0434\u0435\u0442\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u043b\u0438 <a href=\"https:\/\/playwright.dev\/docs\/test-fixtures\/#worker-fixtures\" rel=\"noopener noreferrer nofollow\"><u>Worker Fixtures<\/u><\/a>, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u0438\u0445 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 (\u0432\u043e \u0432\u0441\u0435\u0445 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u0442\u0435\u0441\u0442\u0430\u0445).\u00a0<\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0444\u0438\u043a\u0441\u0442\u0443\u0440\u044b \u0441\u043f\u043e\u0441\u043e\u0431\u0441\u0442\u0432\u0443\u044e\u0442 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044e \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0438 \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0441\u0440\u0435\u0434 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432 Playwright \u0441 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u043d\u043e\u0439 \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u044c\u044e \u0438 \u043f\u0440\u0435\u0434\u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e \u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435.<\/p>\n<h4>Test Hooks<\/h4>\n<p>\u0412 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a \u0444\u0438\u043a\u0441\u0442\u0443\u0440\u044b \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u0440\u0435\u0434\u0443 \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u0435\u0441\u0442\u0430, \u0445\u0443\u043a\u0438 \u2013 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0438 \u0434\u0435\u043c\u043e\u043d\u0442\u0430\u0436\u0430 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432, \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0432 \u0433\u0440\u0443\u043f\u043f\u043e\u0432\u044b\u0445 \u0442\u0435\u0441\u0442\u0430\u0445 \u0438\u043b\u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e. \u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0437 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430 \u043f\u043e \u043d\u0430\u0447\u0430\u043b\u0443 \u0440\u0430\u0431\u043e\u0442\u044b:<\/p>\n<pre><code class=\"javascript\">\/\/ example.spec.js const { test, expect } = require('@playwright\/test');  test.describe('feature foo', () => {   test.beforeEach(async ({ page }) => {     \/\/ Go to the starting url before each test.     await page.goto('https:\/\/playwright.dev\/');   });    test('my test', async ({ page }) => {     \/\/ Assertions use the expect API.     await expect(page).toHaveURL('https:\/\/playwright.dev\/');   }); });<\/code><\/pre>\n<p>\u041c\u0435\u0442\u043e\u0434 test.describe \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0433\u0440\u0443\u043f\u043f\u044b \u0442\u0435\u0441\u0442\u043e\u0432. \u041a \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u043c \u0445\u0443\u043a\u0430\u043c, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f, \u043e\u0442\u043d\u043e\u0441\u044f\u0442\u0441\u044f:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/playwright.dev\/docs\/api\/class-test\/#test-before-each\" rel=\"noopener noreferrer nofollow\"><u>test.beforeEach<\/u><\/a> \u2013 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0434 \u043d\u0430\u0447\u0430\u043b\u043e\u043c \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430 \u0432 \u0433\u0440\u0443\u043f\u043f\u0435;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/playwright.dev\/docs\/api\/class-test\/#test-before-each\" rel=\"noopener noreferrer nofollow\"><u>test.afterEach<\/u><\/a> \u2013 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430 \u0432 \u0433\u0440\u0443\u043f\u043f\u0435;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/playwright.dev\/docs\/api\/class-test\/#test-before-all\" rel=\"noopener noreferrer nofollow\"><u>test.beforeAll<\/u><\/a> \u2013 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u044b \u043f\u0435\u0440\u0435\u0434 \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c \u043b\u044e\u0431\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/playwright.dev\/docs\/api\/class-test\/#test-after-all\" rel=\"noopener noreferrer nofollow\"><u>test.afterAll<\/u><\/a> \u2013 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u044b \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u0442\u0435\u0441\u0442\u043e\u0432.<\/p>\n<\/li>\n<\/ul>\n<h3>\u0414\u0435\u043d\u044c 2: \u0418\u0442\u043e\u0433 \u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u044b<\/h3>\n<ul>\n<li>\n<p>[X] \u0418\u0437\u0443\u0447\u0435\u043d\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 <a href=\"https:\/\/jestjs.io\/docs\/expect\" rel=\"noopener noreferrer nofollow\"><u>expect<\/u><\/a>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0430\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/p>\n<\/li>\n<li>\n<p>[X] \u0418\u0437\u0443\u0447\u0435\u043d\u044b\u00a0 <a href=\"https:\/\/playwright.dev\/docs\/test-assertions\/\" rel=\"noopener noreferrer nofollow\"><u>web assertions<\/u><\/a>, \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0432 Playwright.<\/p>\n<\/li>\n<li>\n<p>[X] \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u044b <a href=\"https:\/\/docs.pytest.org\/en\/latest\/explanation\/fixtures.html#about-fixtures\" rel=\"noopener noreferrer nofollow\"><u>fixtures<\/u><\/a> \u0432 pytest.<\/p>\n<\/li>\n<li>\n<p>[X] \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u044b <a href=\"https:\/\/aka.ms\/playwright\/fixtures\" rel=\"noopener noreferrer nofollow\"><u>fixtures<\/u><\/a>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0435\u0441\u044f \u0432 Playwright.<\/p>\n<\/li>\n<li>\n<p>[X] \u0418\u0437\u0443\u0447\u0435\u043d\u043e <a href=\"https:\/\/playwright.dev\/docs\/api\/class-test\/\" rel=\"noopener noreferrer nofollow\"><u>Playwright Test API<\/u><\/a> \u0434\u043b\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 test hooks.<\/p>\n<\/li>\n<li>\n<p>[X] \u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d <a href=\"https:\/\/playwright.dev\/docs\/intro\" rel=\"noopener noreferrer nofollow\"><u>Getting Started<\/u><\/a> \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b \u043f\u043e Playwright.<\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/645827\/\"> https:\/\/habr.com\/ru\/post\/645827\/<\/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_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h3><\/h3>\n<details class=\"spoiler\">\n<summary>End to End Testing c 30DaysOfPlaywright<\/summary>\n<div class=\"spoiler__content\">\n<ul>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/publication\/edit\/596873\/\" rel=\"noopener noreferrer nofollow\">\u0414\u0435\u043d\u044c 0. \u0423\u0447\u0438\u043c\u0441\u044f e2e-\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e \u0441 Playwright | #30DaysOfPlaywright<\/a><a href=\"https:\/\/habr.com\/ru\/post\/597293\/\" rel=\"noopener noreferrer nofollow\">\u0414\u0435\u043d\u044c 1. \u041d\u0430\u0447\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Playwright (\u0427\u0430\u0441\u0442\u044c 1)<\/a><\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0447\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Playwright (\u0427\u0430\u0441\u0442\u044c 2)<\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/details>\n<h2>? | \u0412\u0430\u0436\u043d\u044b\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b:<\/h2>\n<ul>\n<li>\n<p><a href=\"https:\/\/playwright.dev\/docs\/intro\" rel=\"noopener noreferrer nofollow\"><u>Getting Started<\/u><\/a> \u2013 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 \u0433\u0430\u0439\u0434 \u043f\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/playwright.dev\/docs\/actionability\" rel=\"noopener noreferrer nofollow\"><u>Auto-waiting<\/u><\/a> \u2013 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u044b \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u044f \u043d\u0430\u0434\u0435\u0436\u043d\u043e\u0441\u0442\u0438 \u0442\u0435\u0441\u0442\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/playwright.dev\/docs\/test-timeouts#expect-timeout\" rel=\"noopener noreferrer nofollow\"><u>Web-First Assertions<\/u><\/a> \u2013 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043f\u043e\u0432\u0442\u043e\u0440\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0432\u043f\u043b\u043e\u0442\u044c \u0434\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0436\u0435\u043b\u0430\u0435\u043c\u043e\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/playwright.dev\/docs\/test-fixtures#introduction-to-fixtures\" rel=\"noopener noreferrer nofollow\"><u>Test Fixtures<\/u><\/a> \u2013 \u043f\u043e\u043c\u043e\u0449\u044c \u0432 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/playwright.dev\/docs\/intro#using-test-hooks\" rel=\"noopener noreferrer nofollow\"><u>Test Hooks<\/u><\/a> \u2013 \u043f\u043e\u043c\u043e\u0449\u044c \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u0438 \u043e\u0447\u0438\u0441\u0442\u043a\u0435 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0439 \u0441\u0440\u0435\u0434\u044b \u0438\u043b\u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/youtu.be\/JjhY2aFBTTk\" rel=\"noopener noreferrer nofollow\"><u>Introduction to Playwright Test runner<\/u><\/a> \u2013 \u0432\u0432\u043e\u0434\u043d\u044b\u0439 \u0432\u0438\u0434\u0435\u043e\u0433\u0430\u0439\u0434 \u043f\u043e \u0432\u0441\u0435\u043c \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044f\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430.<\/p>\n<\/li>\n<\/ul>\n<h2>? \u0417\u0430\u0434\u0430\u0447\u0438 2-\u0433\u043e \u0434\u043d\u044f #30DaysOfPlaywright!<\/h2>\n<p>\u041c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0434\u043d\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043b \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043d\u0430\u0448\u0443 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u0441\u0440\u0435\u0434\u0443 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u041f\u0440\u0438\u0448\u043b\u0430 \u043f\u043e\u0440\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u043e\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e, \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0432 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438 Playwright, \u0432 \u0447\u0438\u0441\u043b\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0445:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/playwright.dev\/docs\/intro#writing-assertions\" rel=\"noopener noreferrer nofollow\"><u>\u041d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 assertions<\/u><\/a> \u2013 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e\u0433\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/playwright.dev\/docs\/intro#using-test-fixtures\" rel=\"noopener noreferrer nofollow\"><u>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 test fixtures<\/u><\/a> \u2013 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u043e\u0433\u043e page\/browser context \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0442\u0435\u0441\u0442\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/playwright.dev\/docs\/intro#using-test-hooks\" rel=\"noopener noreferrer nofollow\"><u>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 test hooks<\/u><\/a> \u2013 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0438 \u043e\u0447\u0438\u0441\u0442\u043a\u0430 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u043c\u0435\u0436\u0434\u0443 \u0442\u0435\u0441\u0442\u0430\u043c\u0438.<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0432\u044b \u043d\u0430\u0439\u0434\u0435\u0442\u0435 \u043a\u0440\u0430\u0442\u043a\u043e\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0438 \u0437\u0430\u0447\u0435\u043c \u043e\u043d \u043d\u0443\u0436\u0435\u043d. \u0412 \u0431\u0443\u0434\u0443\u0449\u0438\u0445 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f\u0445 \u043a\u0430\u0436\u0434\u0430\u044f \u0438\u0437 \u0442\u0435\u043c \u0431\u0443\u0434\u0435\u0442 \u0438\u0437\u0443\u0447\u0435\u043d\u0430 \u0443\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u043d\u043e. \u0418\u0442\u0430\u043a, \u043d\u0430\u0447\u043d\u0435\u043c!<\/p>\n<h3>\u041e\u0441\u043d\u043e\u0432\u044b Playwright<\/h3>\n<p>\u0412 <a href=\"https:\/\/habr.com\/ru\/post\/596873\/\" rel=\"noopener noreferrer nofollow\"><u>\u043c\u043e\u0435\u043c \u043f\u0435\u0440\u0432\u043e\u043c \u043f\u043e\u0441\u0442\u0435<\/u><\/a> \u044f \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u043e\u0432\u0430\u043b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0434\u043e\u043a\u043b\u0430\u0434 \u00a0<a href=\"https:\/\/youtu.be\/JjhY2aFBTTk\" rel=\"noopener noreferrer nofollow\"><u>Introduction to Playwright Test runner<\/u><\/a> \u043a\u0430\u043a \u0445\u043e\u0440\u043e\u0448\u0435\u0435 \u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0432 \u043e\u0441\u043d\u043e\u0432\u044b \u0440\u0430\u0431\u043e\u0442\u044b \u0441 <strong>Playwright<\/strong>. \u0421\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u043d\u0435\u0433\u043e \u0431\u0443\u0434\u0443\u0442 \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0442\u044c \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0440\u0430\u0437\u0434\u0435\u043b\u0430\u0445 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430.<\/p>\n<p>\u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u043d\u0438\u0436\u0435 \u0441\u043e\u0431\u0440\u0430\u043d \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u0441\u044b\u043b\u043e\u043a \u043d\u0430 \u0432\u0438\u0434\u0435\u043e \u0441 \u0442\u0430\u0439\u043c\u043a\u043e\u0434\u0430\u043c\u0438. \u0412\u043c\u0435\u0441\u0442\u0435 \u0441 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430\u043c\u0438 \u201c\u041d\u0430\u0447\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Playwright\u201d \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0434\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0437\u0430\u043d\u044f\u0442\u0438\u044f \u0438\u0437\u0443\u0447\u0438\u0442\u044c 1-3 \u0433\u043b\u0430\u0432\u0443 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430.<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/youtu.be\/JjhY2aFBTTk?t=121\" rel=\"noopener noreferrer nofollow\"><u>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435\u00a0 Playwright Test?<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/youtu.be\/JjhY2aFBTTk?t=149\" rel=\"noopener noreferrer nofollow\"><u>\u041f\u043e\u0447\u0435\u043c\u0443 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 Test runner?<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/youtu.be\/JjhY2aFBTTk?t=246\" rel=\"noopener noreferrer nofollow\"><u>\u0427\u0430\u0441\u0442\u044c 1: \u041d\u0430\u0447\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u044b &#8212; Demo<\/u><\/a> \u2013 Playwright Test \u0434\u0435\u043c\u043e.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/youtu.be\/JjhY2aFBTTk?t=560\" rel=\"noopener noreferrer nofollow\"><u>\u0427\u0430\u0441\u0442\u044c 1: \u041d\u0430\u0447\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u044b &#8212; Script<\/u><\/a> \u2013 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u0431\u043e\u0440 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/youtu.be\/JjhY2aFBTTk?t=609\" rel=\"noopener noreferrer nofollow\"><u>\u0427\u0430\u0441\u0442\u044c 2: \u041e\u0441\u043d\u043e\u0432\u044b<\/u><\/a> &#8212; \u0438\u0437\u043e\u043b\u044f\u0446\u0438\u044f \u0442\u0435\u0441\u0442\u043e\u0432, \u0443\u043c\u043d\u043e\u0435 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0435, \u0431\u0430\u0437\u043e\u0432\u044b\u0435 web-assertion.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/youtu.be\/JjhY2aFBTTk?t=971\" rel=\"noopener noreferrer nofollow\"><u>\u0427\u0430\u0441\u0442\u044c 3: \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f &#8212; Fixtures<\/u><\/a> \u2013 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u043e\u0442\u0447\u0435\u0442, \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/youtu.be\/JjhY2aFBTTk?t=1423\" rel=\"noopener noreferrer nofollow\"><u>\u0427\u0430\u0441\u0442\u044c 4: \u0418\u043d\u0441\u043f\u0435\u043a\u0442\u043e\u0440 \u0438 \u043a\u043e\u0434-\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440<\/u><\/a>.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/youtu.be\/JjhY2aFBTTk?t=1987\" rel=\"noopener noreferrer nofollow\"><u>\u0427\u0430\u0441\u0442\u044c 5: Playwright Tracing<\/u><\/a> \u2013 \u043e\u0442\u043b\u0430\u0434\u043a\u0430 \u043f\u043e\u0441\u043b\u0435 \u0442\u0435\u0441\u0442\u043e\u0432.\u00a0<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/youtu.be\/JjhY2aFBTTk?t=2548\" rel=\"noopener noreferrer nofollow\"><u>\u0420\u0435\u0437\u044e\u043c\u0435<\/u><\/a> \u2013 \u043d\u0430\u0447\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u044b, \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f, \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430, \u043e\u0442\u043b\u0430\u0434\u043a\u0430, trace.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/youtu.be\/JjhY2aFBTTk?t=2671\" rel=\"noopener noreferrer nofollow\"><u>Q&amp;A<\/u><\/a> \u2013 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u044f\u0437\u044b\u043a\u043e\u0432, \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u043c\u0438 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430\u043c\u0438.<\/p>\n<\/li>\n<\/ul>\n<h3>\u0420\u0430\u0437\u0431\u043e\u0440 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430<\/h3>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u043a \u043a\u043e\u0434\u0443 \u0438\u0437 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u0438 \u0432 \u043f\u0435\u0440\u0432\u044b\u0439 \u0434\u0435\u043d\u044c.<\/p>\n<pre><code class=\"javascript\">const { test, expect } = require('@playwright\/test');  test('basic test', async ({ page }) => {   await page.goto('https:\/\/playwright.dev\/');   const title = page.locator('.navbar__inner .navbar__title');   await expect(title).toHaveText('Playwright'); });<\/code><\/pre>\n<p>\u042d\u0442\u043e\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0444\u0443\u043d\u0434\u0430\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438 Playwright, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0442 \u043d\u0430\u0434\u0435\u0436\u043d\u043e\u0435 \u0441\u043a\u0432\u043e\u0437\u043d\u043e\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/playwright.dev\/docs\/actionability\" rel=\"noopener noreferrer nofollow\"><u>\u0423\u043c\u043d\u043e\u0435 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0435<\/u><\/a> \u2013 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u0435\u0440\u0435\u0434 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0448\u0435\u043d\u043d\u043e\u0433\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/playwright.dev\/docs\/test-timeouts#expect-timeout\" rel=\"noopener noreferrer nofollow\"><u>Web-First Assertions<\/u><\/a> \u2013 \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440, \u043f\u043e\u043a\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/playwright.dev\/docs\/test-fixtures#introduction-to-fixtures\" rel=\"noopener noreferrer nofollow\"><u>\u0422\u0435\u0441\u0442\u043e\u0432\u0430\u044f \u0438\u0437\u043e\u043b\u044f\u0446\u0438\u044f \u0441 fixtures<\/u><\/a> \u2013 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u0430\u0434\u0435\u0436\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u044b \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0440\u0430\u0441\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0432\u0430\u043d\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/playwright.dev\/docs\/intro#using-test-hooks\" rel=\"noopener noreferrer nofollow\"><u>Test Hooks<\/u><\/a> \u2013 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0438 \u043e\u0447\u0438\u0449\u0435\u043d\u0438\u0435 \u043e\u0431\u0449\u0438\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u043c\u0435\u0436\u0434\u0443 \u0442\u0435\u0441\u0442\u0430\u043c\u0438.<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0438\u0445 \u0432\u043a\u0440\u0430\u0442\u0446\u0435 \u043d\u0438\u0436\u0435.<\/p>\n<h4>Web Assertions<\/h4>\n<p>Playwright \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442<a href=\"https:\/\/jestjs.io\/docs\/expect\" rel=\"noopener noreferrer nofollow\"><u> \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 expect<\/u><\/a> \u0434\u043b\u044f \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0439. \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043b\u0438 \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e\u043c\u0443 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0443. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0449\u0430\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f. <\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"javascript\">expect(value).toEqual(0);<\/code><\/pre>\n<p>\u0421\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u043d\u044b, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0438\u0445 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f. \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0439 \u043c\u043e\u0436\u0435\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439, \u0435\u0441\u043b\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u0435\u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e. Playwright \u043f\u043e\u0432\u044b\u0448\u0430\u0435\u0442 \u043d\u0430\u0434\u0435\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430, \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 expect <a href=\"https:\/\/playwright.dev\/docs\/test-assertions\" rel=\"noopener noreferrer nofollow\"><u>\u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0443\u0434\u043e\u0431\u043d\u044b\u0445 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0445 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0439<\/u><\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0436\u0438\u0434\u0430\u044e\u0442, \u043f\u043e\u043a\u0430 \u0442\u0440\u0435\u0431\u0443\u044e\u0449\u0435\u0435\u0441\u044f \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043e.<\/p>\n<pre><code class=\"javascript\">await expect(page).toHaveTitle(\"Playwright\");<\/code><\/pre>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0439:<\/p>\n<pre><code class=\"javascript\">\/\/ assert.spec.js const { test, expect } = require('@playwright\/test');  test('my test', async ({ page }) => {   await page.goto('https:\/\/playwright.dev\/');    \/\/ Expect a title \"to contain\" a substring.   await expect(page).toHaveTitle(\/Playwright\/);    \/\/ Expect an attribute \"to be strictly equal\" to the value.   await expect(page.locator('text=Get Started').first()).toHaveAttribute('href', '\/docs\/intro');    \/\/ Expect an element \"to be visible\".   await expect(page.locator('text=Learn more').first()).toBeVisible();    await page.click('text=Get Started');   \/\/ Expect some text to be visible on the page.   await expect(page.locator('text=Introduction').first()).toBeVisible(); });<\/code><\/pre>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u0435\u0433\u043e \u0432 \u043d\u043e\u0432\u043e\u043c \u0444\u0430\u0439\u043b\u0435 (assert.spec.js) \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"bash\">$ npx playwright test assert.spec.js<\/code><\/pre>\n<p>\u0410\u0440\u0433\u0443\u043c\u0435\u043d\u0442 {page}, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0432 \u0442\u0435\u0441\u0442\u0435, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c <em>test fixture<\/em>. \u041e \u0442\u043e\u043c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0444\u0438\u043a\u0441\u0442\u0443\u0440\u044b, \u043c\u044b \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435.<\/p>\n<p>\u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u043f\u043e \u043a\u043b\u0430\u0441\u0441\u0443 page\u00a0 \u0438 \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u0447\u0442\u043e \u043e\u043d \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043c\u0435\u0442\u043e\u0434\u044b \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u043e\u0434\u043d\u043e\u0439 \u0432\u043a\u043b\u0430\u0434\u043a\u043e\u0439 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430 \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439.\u00a0\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<ul>\n<li>\n<p>\u043c\u0435\u0442\u043e\u0434\u00a0 <a href=\"https:\/\/playwright.dev\/docs\/api\/class-page#page-locator\" rel=\"noopener noreferrer nofollow\"><u>page.locator()<\/u><\/a> \u2013 \u044d\u0442\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430(\u043e\u0432) \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0441 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u043e\u0439 \u0434\u043b\u044f \u0435\u0433\u043e \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u0432 \u043d\u0443\u0436\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/playwright.dev\/docs\/api\/class-page#page-goto\" rel=\"noopener noreferrer nofollow\"><u>page.goto()<\/u><\/a> \u2013 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043d\u0430 \u043b\u044e\u0431\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/playwright.dev\/docs\/api\/class-page#page-click\" rel=\"noopener noreferrer nofollow\"><u>page.click()<\/u><\/a> \u2013 \u043a\u043b\u0438\u043a \u043f\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u0443.<\/p>\n<\/li>\n<\/ul>\n<p><a href=\"https:\/\/playwright.dev\/docs\/test-assertions\/\" rel=\"noopener noreferrer nofollow\"><u>\u0414\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044f \u0432 Playwright<\/u><\/a> \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u044b \u0432 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u043f\u043e\u0441\u0442\u043e\u0432.<\/p>\n<h4>Test Fixtures<\/h4>\n<p>\u0412\u0434\u043e\u0445\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 <a href=\"https:\/\/docs.pytest.org\/en\/latest\/explanation\/fixtures.html#about-fixtures\" rel=\"noopener noreferrer nofollow\"><u>pytest<\/u><\/a>-\u043e\u043c, test fixtures \u2013 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u0430\u0434\u0435\u0436\u043d\u043e\u0439 \u0438 \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0439 \u0441\u0440\u0435\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0442\u0435\u0441\u0442\u0430\u043c \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u043e, \u0447\u0442\u043e \u0438\u043c \u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 (\u0438 \u043d\u0435 \u0431\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e). Playwright Test \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0432\u0441\u0435 fixture, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u0442 \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u043e\u0434\u0438\u043d \u043e\u0431\u044a\u0435\u043a\u0442 \u0438 \u0434\u0435\u043b\u0430\u0435\u0442 \u0435\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c \u0434\u043b\u044f <em>test<\/em> \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430. \u041f\u043e \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u0438 \u0442\u0435\u0441\u0442\u0430 \u0444\u0438\u043a\u0441\u0442\u0443\u0440\u0430 \u0434\u0435\u043c\u043e\u043d\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f.<\/p>\n<p>\u041f\u043e\u0447\u0435\u043c\u0443 fixture? \u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043e\u043d\u0438 \u0441\u043e\u0437\u0434\u0430\u044e\u0442 \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0441\u0440\u0435\u0434\u0443 (\u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u043c\u043e\u0441\u0442\u044c \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f) \u0438 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0442 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0443\u044e \u0438\u0437\u043e\u043b\u044f\u0446\u0438\u044e \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430 \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430\u043c\u0438:<\/p>\n<ul>\n<li>\n<p>\u042d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c. \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0439\u0442\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u0441\u0442\u043e\u0432 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e, \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0438 \u0441 \u043c\u0435\u043d\u044c\u0448\u0438\u043c \u043e\u0431\u044a\u0435\u043c\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0422\u0430\u0440\u0433\u0435\u0442\u0438\u043d\u0433. \u041f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u043f\u0440\u043e\u0432\u0430\u043b\u0438\u0432\u0448\u0438\u0435\u0441\u044f \u0442\u0435\u0441\u0442\u044b \u0431\u0435\u0437 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0432\u0441\u0435\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430.<\/p>\n<\/li>\n<li>\n<p>\u0413\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0430. \u0413\u0440\u0443\u043f\u043f\u043e\u0432\u044b\u0435 \u0442\u0435\u0441\u0442\u044b \u043f\u0440\u043e\u0432\u043e\u0434\u044f\u0442\u0441\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043e\u0431\u0449\u0435\u0433\u043e \u0441\u043c\u044b\u0441\u043b\u0430, \u0430 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0439 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438.<\/p>\n<\/li>\n<\/ul>\n<p>Playwright \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441 \u0440\u044f\u0434\u043e\u043c <a href=\"https:\/\/playwright.dev\/docs\/api\/class-fixtures\/\" rel=\"noopener noreferrer nofollow\"><u>\u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 fixture<\/u><\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c.<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/playwright.dev\/docs\/api\/class-fixtures#fixtures-browser\" rel=\"noopener noreferrer nofollow\"><u>fixtures.browser<\/u><\/a> \u2013 \u043e\u0431\u0449\u0438\u0439 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430 (\u0434\u043b\u044f worker);<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/playwright.dev\/docs\/api\/class-fixtures#fixtures-browser-name\" rel=\"noopener noreferrer nofollow\"><u>fixtures.browserName<\/u><\/a> \u2013 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0437\u0430\u043f\u0443\u0441\u043a (chromium, firefox or webkit);<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/playwright.dev\/docs\/api\/class-fixtures#fixtures-context\" rel=\"noopener noreferrer nofollow\"><u>fixtures.context<\/u><\/a> \u2013 \u0438\u0437\u043e\u043b\u0438\u0440\u0443\u0435\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430 (\u0434\u043b\u044f test);<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/playwright.dev\/docs\/api\/class-fixtures#fixtures-page\" rel=\"noopener noreferrer nofollow\"><u>fixtures.page<\/u><\/a> \u2013 \u0438\u0437\u043e\u043b\u0438\u0440\u0443\u0435\u0442 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 (per test).<\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/playwright.dev\/docs\/test-fixtures\/#test-fixtures\" rel=\"noopener noreferrer nofollow\"><u>Test Fixture<\/u><\/a> \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u0434\u0435\u0442\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u043b\u0438 <a href=\"https:\/\/playwright.dev\/docs\/test-fixtures\/#worker-fixtures\" rel=\"noopener noreferrer nofollow\"><u>Worker Fixtures<\/u><\/a>, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u0438\u0445 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 (\u0432\u043e \u0432\u0441\u0435\u0445 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u0442\u0435\u0441\u0442\u0430\u0445).\u00a0<\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0444\u0438\u043a\u0441\u0442\u0443\u0440\u044b \u0441\u043f\u043e\u0441\u043e\u0431\u0441\u0442\u0432\u0443\u044e\u0442 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044e \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0438 \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0441\u0440\u0435\u0434 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432 Playwright \u0441 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u043d\u043e\u0439 \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u044c\u044e \u0438 \u043f\u0440\u0435\u0434\u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e \u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435.<\/p>\n<h4>Test Hooks<\/h4>\n<p>\u0412 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a \u0444\u0438\u043a\u0441\u0442\u0443\u0440\u044b \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u0440\u0435\u0434\u0443 \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u0435\u0441\u0442\u0430, \u0445\u0443\u043a\u0438 \u2013 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0438 \u0434\u0435\u043c\u043e\u043d\u0442\u0430\u0436\u0430 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432, \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0432 \u0433\u0440\u0443\u043f\u043f\u043e\u0432\u044b\u0445 \u0442\u0435\u0441\u0442\u0430\u0445 \u0438\u043b\u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e. \u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0437 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430 \u043f\u043e \u043d\u0430\u0447\u0430\u043b\u0443 \u0440\u0430\u0431\u043e\u0442\u044b:<\/p>\n<pre><code class=\"javascript\">\/\/ example.spec.js const { test, expect } = require('@playwright\/test');  test.describe('feature foo', () => {   test.beforeEach(async ({ page }) => {     \/\/ Go to the starting url before each test.     await page.goto('https:\/\/playwright.dev\/');   });    test('my test', async ({ page }) => {     \/\/ Assertions use the expect API.     await expect(page).toHaveURL('https:\/\/playwright.dev\/');   }); });<\/code><\/pre>\n<p>\u041c\u0435\u0442\u043e\u0434 test.describe \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0433\u0440\u0443\u043f\u043f\u044b \u0442\u0435\u0441\u0442\u043e\u0432. \u041a \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u043c \u0445\u0443\u043a\u0430\u043c, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f, \u043e\u0442\u043d\u043e\u0441\u044f\u0442\u0441\u044f:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/playwright.dev\/docs\/api\/class-test\/#test-before-each\" rel=\"noopener noreferrer nofollow\"><u>test.beforeEach<\/u><\/a> \u2013 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0434 \u043d\u0430\u0447\u0430\u043b\u043e\u043c \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430 \u0432 \u0433\u0440\u0443\u043f\u043f\u0435;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/playwright.dev\/docs\/api\/class-test\/#test-before-each\" rel=\"noopener noreferrer nofollow\"><u>test.afterEach<\/u><\/a> \u2013 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430 \u0432 \u0433\u0440\u0443\u043f\u043f\u0435;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/playwright.dev\/docs\/api\/class-test\/#test-before-all\" rel=\"noopener noreferrer nofollow\"><u>test.beforeAll<\/u><\/a> \u2013 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u044b \u043f\u0435\u0440\u0435\u0434 \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c \u043b\u044e\u0431\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/playwright.dev\/docs\/api\/class-test\/#test-after-all\" rel=\"noopener noreferrer nofollow\"><u>test.afterAll<\/u><\/a> \u2013 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u044b \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u0442\u0435\u0441\u0442\u043e\u0432.<\/p>\n<\/li>\n<\/ul>\n<h3>\u0414\u0435\u043d\u044c 2: \u0418\u0442\u043e\u0433 \u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u044b<\/h3>\n<ul>\n<li>\n<p>[X] \u0418\u0437\u0443\u0447\u0435\u043d\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 <a href=\"https:\/\/jestjs.io\/docs\/expect\" rel=\"noopener noreferrer nofollow\"><u>expect<\/u><\/a>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0430\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/p>\n<\/li>\n<li>\n<p>[X] \u0418\u0437\u0443\u0447\u0435\u043d\u044b\u00a0 <a href=\"https:\/\/playwright.dev\/docs\/test-assertions\/\" rel=\"noopener noreferrer nofollow\"><u>web assertions<\/u><\/a>, \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0432 Playwright.<\/p>\n<\/li>\n<li>\n<p>[X] \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u044b <a href=\"https:\/\/docs.pytest.org\/en\/latest\/explanation\/fixtures.html#about-fixtures\" rel=\"noopener noreferrer nofollow\"><u>fixtures<\/u><\/a> \u0432 pytest.<\/p>\n<\/li>\n<li>\n<p>[X] \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u044b <a href=\"https:\/\/aka.ms\/playwright\/fixtures\" rel=\"noopener noreferrer nofollow\"><u>fixtures<\/u><\/a>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0435\u0441\u044f \u0432 Playwright.<\/p>\n<\/li>\n<li>\n<p>[X] \u0418\u0437\u0443\u0447\u0435\u043d\u043e <a href=\"https:\/\/playwright.dev\/docs\/api\/class-test\/\" rel=\"noopener noreferrer nofollow\"><u>Playwright Test API<\/u><\/a> \u0434\u043b\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 test hooks.<\/p>\n<\/li>\n<li>\n<p>[X] \u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d <a href=\"https:\/\/playwright.dev\/docs\/intro\" rel=\"noopener noreferrer nofollow\"><u>Getting Started<\/u><\/a> \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b \u043f\u043e Playwright.<\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/645827\/\"> https:\/\/habr.com\/ru\/post\/645827\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-328077","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/328077","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=328077"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/328077\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=328077"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=328077"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=328077"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}