{"id":471277,"date":"2025-08-19T15:01:59","date_gmt":"2025-08-19T15:01:59","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=471277"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=471277","title":{"rendered":"<span>\u041a\u0430\u043a \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Playwright + TypeScript<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0439 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442 \u0432 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0438\u043b\u0438 \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u0441 \u043e\u043f\u044b\u0442\u043e\u043c, \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043e\u0431\u0441\u0443\u0436\u0434\u0430\u0442\u044c \u0438 \u0443\u043b\u0443\u0447\u0448\u0430\u0442\u044c \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0442\u043e \u0441 \u0440\u0430\u0434\u043e\u0441\u0442\u044c\u044e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e \u0432\u0430\u043c \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u043e\u0441\u0442 \u0432 \u0441\u0435\u0440\u0438\u0438, \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u043d\u044b\u0439 \u0440\u0430\u0437\u0431\u043e\u0440\u0430\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432 \u043a \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e \u041f\u041e. \u0417\u0434\u0435\u0441\u044c \u044f \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u044e \u0441\u0432\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u043d\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447 \u043f\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f Playwright + TypeScript.<\/p>\n<h3>\ud83d\udcdd\ud83d\udd0d \u041a\u0430\u043a \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 Typescript \u0438 \u043a\u0430\u043a \u044d\u0442\u043e \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0443 \u0432 \u0432\u0430\u0448\u0435\u043c \u0432\u0435\u0431 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438<\/h3>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432 \u0434\u0430\u043d\u043d\u044b\u0445, \u0432 Typescript \u0435\u0441\u0442\u044c \u043c\u0435\u0442\u043e\u0434 <code>.sort()<\/code>, \u0430 \u0442\u0430\u043a \u0436\u0435 <code>.sort().reverse()<\/code> \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0432\u0435\u0440\u044f\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439 \u0438 \u0432\u044b\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442 \u0438\u0445 \u043f\u043e \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u043d\u0438\u044e \u0438\u043b\u0438 \u0443\u0431\u044b\u0432\u0430\u043d\u0438\u044e. \u0412 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u043c\u044b \u043d\u0435 \u0443\u0433\u043b\u0443\u0431\u043b\u044f\u0435\u043c\u0441\u044f, \u0441\u0435\u0439\u0447\u0430\u0441 \u044d\u0442\u043e \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f.<br \/>\u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<pre><code class=\"typescript\">import test, { expect } from '@playwright\/test'  test(`Sorting test`, async ({ page }) =&gt; {   \/\/ Open page with table   await page.goto(`\/table`)   \/\/ Find locator of 2nd column header   const headerLocator = page.locator(`\/\/th[2]`)   \/\/ Find locator of all 2nd table column cells   const cellsLocator = page.locator(`\/\/tbody\/\/tr\/td[2]`)   \/\/ Sort column   await headerLocator.click()   \/\/ Get text from each cell in 2nd column   const data = await cellsLocator.allTextContents()   \/\/ Make sure that parsed data and sorted data are equal   expect(data).toEqual([...data].sort()) })<\/code><\/pre>\n<p>\u0413\u043e\u0442\u043e\u0432\u043e, \u0434\u0435\u043b\u043e \u0437\u0430\u043a\u0440\u044b\u0442\u043e?<\/p>\n<h2>\ud83e\udd14\ud83d\udca1\u2753\u041d\u043e \u0432 \u0447\u0435\u043c \u0436\u0435 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c, \u043f\u0440\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0438 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438?<\/h2>\n<p>\u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438, \u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445, \u0447\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0435\u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u044b(\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0446\u0435\u043d\u0430, \u0438\u043b\u0438 \u0434\u0430\u0442\u0430), \u0438\u043b\u0438 \u0432 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430, \u043c\u044b \u0441\u0442\u043e\u043b\u043a\u043d\u0435\u043c\u0441\u044f \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u0438\u0441\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0442\u0435\u0441\u0442 \u043a\u0435\u0439\u0441\u044b, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u044f \u0432 <code>.sort()<\/code> \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043b\u044f \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043c\u043e\u044e \u0442\u0435\u0441\u0442 \u0441\u043f\u0435\u043a\u0443 <a href=\"https:\/\/github.com\/old-door\/qa-playground\/blob\/main\/tests\/specs\/sortable-table.spec.ts\" rel=\"noopener noreferrer nofollow\">sortable-table.spec.ts<\/a><\/p>\n<pre><code class=\"typescript\">import { test } from '..\/src\/fixtures' import { SORTABLE_TABLE_COLUMNS } from '..\/src\/pages\/sorting-demo\/sorting-demo.columns'  test.describe('Sortable table', () =&gt; {    for (const column of Object.values(SORTABLE_TABLE_COLUMNS)) {          test(`${column} sort ascending`, async ({ sortableTablePage }) =&gt; {       const table = sortableTablePage.table       await table.sort.validateNone(column)       await table.sort.apply(column)       await table.sort.validateAscending(column)     })      test(`${column} sort descending`, async ({ sortableTablePage }) =&gt; {       const table = sortableTablePage.table       await table.sort.validateNone(column)       await table.sort.apply(column, { clickCount: 2})       await table.sort.validateDescending(column)     })    }  })<\/code><\/pre>\n<h2>\ud83d\udd27\ud83d\udcca\ud83d\udcbb \u0420\u0430\u0437\u0431\u043e\u0440: \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442?<\/h2>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0442\u0435\u0441\u0442 \u0441\u043f\u0435\u043a\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0434\u0432\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u0430 <code>${column} sort ascending<\/code> \u0438 <code>${column} sort descending<\/code> . \u0418\u043c\u0435\u044f \u0432\u0441\u0435\u0433\u043e \u0434\u0432\u0430 \u0442\u0435\u0441\u0442\u0430, \u043c\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0443 \u043f\u043e \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u043d\u0438\u044e \u0438 \u0443\u0431\u044b\u0432\u0430\u043d\u0438\u044e \u0432\u043e \u0432\u0441\u0435\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435. <\/p>\n<p><a href=\"https:\/\/github.com\/old-door\/qa-playground\/blob\/main\/tests\/src\/fixtures\/pages.fixtures.ts#L11\" rel=\"noopener noreferrer nofollow\">sortableTablePage<\/a> &#8212; \u0444\u0438\u043a\u0441\u0442\u0443\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0432\u0435\u0431 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0438 \u0436\u0434\u0451\u0442, \u0447\u0442\u043e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u0430.<\/p>\n<p>\u0427\u0442\u043e \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430? <a href=\"https:\/\/github.com\/old-door\/qa-playground\/blob\/main\/tests\/src\/pages\/sorting-demo\/sorting-demo.columns.ts\" rel=\"noopener noreferrer nofollow\">SORTABLE_TABLE_COLUMNS<\/a> &#8212; \u0441\u0442\u0430\u0442\u0438\u0447\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430\u0445 \u043d\u0430\u0448\u0435\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b: \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u043e\u043b\u0431\u0446\u0430, \u0444\u043e\u0440\u043c\u0430\u0442 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>\u041d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 <a href=\"https:\/\/github.com\/old-door\/qa-playground\/blob\/main\/tests\/src\/utils\/format\/date.format.ts\" rel=\"noopener noreferrer nofollow\">DateFormat<\/a> &#8212; \u043c\u043e\u0436\u0435\u043c \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u0447\u0442\u043e \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u0430, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043c\u0435\u0442\u043e\u0434 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445, \u0430 \u0442\u0430\u043a \u0436\u0435 \u043c\u0435\u0442\u043e\u0434 \u043f\u043e \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0443 <code>string-&gt;target format<\/code> .<\/p>\n<p>\u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u0438\u043c\u0435\u0442\u044c \u0435\u0434\u0438\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f:<\/p>\n<pre><code class=\"typescript\">async validate(     column: TableColumn,     direction: SortingDirection   ): Promise&lt;void&gt; {     await test.step(       `Validate table column \"${column}\" is sorted in \"${direction}\" direction`,        async () =&gt; {         await expect(           this.locators.headerByColumn(column)         ).toHaveAttribute('aria-sort', direction)          if (direction !== 'none') {           const values = await this.getColumnValues(column)           expect(             new Set(values).size,             `To have at least 2 unique values`           ).toBeGreaterThanOrEqual(2)           for (let i = 1; i &lt; values.length; i++) {             await test.step(`Compare row #${i} and #${i + 1}`, async () =&gt; {               const value = values[i - 1]               const nextValue = values[i]               const result = await test.step(`Parse and compare values`, () =&gt; {                 return column.format.comparator(value, nextValue)               })                  switch (direction) {                 case 'ascending':                   expect.soft(                     result,                     `#${i} ${value} to be less than or equal #${                       i + 1                     } ${nextValue}`                   ).toBeLessThanOrEqual(0)                   break                    case 'descending':                   expect.soft(                     result,                     `#${i} ${value} to be greater than or equal #${                       i + 1                     } ${nextValue}`                   ).toBeGreaterThanOrEqual(0)                   break                    default:                   throw new Error(`Unknown sorting direction: ${String(direction)}`)               }             })           }         }       })   }<\/code><\/pre>\n<p>\u041a\u0430\u043a \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0435\u0434\u0438\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043a \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e, \u0438\u0437\u0431\u0435\u0433\u0430\u0435\u043c \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u0442\u0435\u0441\u0442\u043e\u0432, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0438\u043c\u0435\u0435\u0442 \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0434\u043b\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u043d\u0430\u0448\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f34\/cc0\/f19\/f34cc0f1999aac3f4053d461e730dfb6.png\" width=\"3020\" height=\"1208\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/f34\/cc0\/f19\/f34cc0f1999aac3f4053d461e730dfb6.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f34\/cc0\/f19\/f34cc0f1999aac3f4053d461e730dfb6.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<h2>\ud83d\udce2 \u0427\u0442\u043e \u0434\u0430\u043b\u044c\u0448\u0435?<\/h2>\n<p>\u042d\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0432\u044b\u0439 \u0448\u0430\u0433, \u043d\u043e\u0432\u044b\u0435 \u043f\u043e\u0441\u0442\u044b \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0435\u0440\u0438\u0438, \u0441 \u043d\u043e\u0432\u044b\u043c\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0443\u0436\u0435 \u043d\u0430 \u043f\u043e\u0434\u0445\u043e\u0434\u0435.<\/p>\n<p>\ud83d\udcac <strong>\u041d\u0430\u043f\u0438\u0448\u0438\u0442\u0435<\/strong> \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445 \u0447\u0442\u043e \u0432\u044b \u0434\u0443\u043c\u0430\u0435\u0442\u0435, \u0430 \u0442\u0430\u043a \u0436\u0435 , \u0447\u0442\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c.<br \/>\ud83d\udee0 <strong>\u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0439\u0442\u0435<\/strong> \u0444\u0438\u0447\u0438 \u0438 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u043d\u0430<a href=\"https:\/\/github.com\/old-door\/qa-playground\" rel=\"noopener noreferrer nofollow\"> GitHub<\/a>.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/938710\/\"> https:\/\/habr.com\/ru\/articles\/938710\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0439 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442 \u0432 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0438\u043b\u0438 \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u0441 \u043e\u043f\u044b\u0442\u043e\u043c, \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043e\u0431\u0441\u0443\u0436\u0434\u0430\u0442\u044c \u0438 \u0443\u043b\u0443\u0447\u0448\u0430\u0442\u044c \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0442\u043e \u0441 \u0440\u0430\u0434\u043e\u0441\u0442\u044c\u044e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e \u0432\u0430\u043c \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u043e\u0441\u0442 \u0432 \u0441\u0435\u0440\u0438\u0438, \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u043d\u044b\u0439 \u0440\u0430\u0437\u0431\u043e\u0440\u0430\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432 \u043a \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e \u041f\u041e. \u0417\u0434\u0435\u0441\u044c \u044f \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u044e \u0441\u0432\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u043d\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447 \u043f\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f Playwright + TypeScript.<\/p>\n<h3>\ud83d\udcdd\ud83d\udd0d \u041a\u0430\u043a \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 Typescript \u0438 \u043a\u0430\u043a \u044d\u0442\u043e \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0443 \u0432 \u0432\u0430\u0448\u0435\u043c \u0432\u0435\u0431 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438<\/h3>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432 \u0434\u0430\u043d\u043d\u044b\u0445, \u0432 Typescript \u0435\u0441\u0442\u044c \u043c\u0435\u0442\u043e\u0434 <code>.sort()<\/code>, \u0430 \u0442\u0430\u043a \u0436\u0435 <code>.sort().reverse()<\/code> \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0432\u0435\u0440\u044f\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439 \u0438 \u0432\u044b\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442 \u0438\u0445 \u043f\u043e \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u043d\u0438\u044e \u0438\u043b\u0438 \u0443\u0431\u044b\u0432\u0430\u043d\u0438\u044e. \u0412 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u043c\u044b \u043d\u0435 \u0443\u0433\u043b\u0443\u0431\u043b\u044f\u0435\u043c\u0441\u044f, \u0441\u0435\u0439\u0447\u0430\u0441 \u044d\u0442\u043e \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f.<br \/>\u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<pre><code class=\"typescript\">import test, { expect } from '@playwright\/test'  test(`Sorting test`, async ({ page }) =&gt; {   \/\/ Open page with table   await page.goto(`\/table`)   \/\/ Find locator of 2nd column header   const headerLocator = page.locator(`\/\/th[2]`)   \/\/ Find locator of all 2nd table column cells   const cellsLocator = page.locator(`\/\/tbody\/\/tr\/td[2]`)   \/\/ Sort column   await headerLocator.click()   \/\/ Get text from each cell in 2nd column   const data = await cellsLocator.allTextContents()   \/\/ Make sure that parsed data and sorted data are equal   expect(data).toEqual([...data].sort()) })<\/code><\/pre>\n<p>\u0413\u043e\u0442\u043e\u0432\u043e, \u0434\u0435\u043b\u043e \u0437\u0430\u043a\u0440\u044b\u0442\u043e?<\/p>\n<h2>\ud83e\udd14\ud83d\udca1\u2753\u041d\u043e \u0432 \u0447\u0435\u043c \u0436\u0435 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c, \u043f\u0440\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0438 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438?<\/h2>\n<p>\u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438, \u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445, \u0447\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0435\u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u044b(\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0446\u0435\u043d\u0430, \u0438\u043b\u0438 \u0434\u0430\u0442\u0430), \u0438\u043b\u0438 \u0432 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430, \u043c\u044b \u0441\u0442\u043e\u043b\u043a\u043d\u0435\u043c\u0441\u044f \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u0438\u0441\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0442\u0435\u0441\u0442 \u043a\u0435\u0439\u0441\u044b, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u044f \u0432 <code>.sort()<\/code> \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043b\u044f \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043c\u043e\u044e \u0442\u0435\u0441\u0442 \u0441\u043f\u0435\u043a\u0443 <a href=\"https:\/\/github.com\/old-door\/qa-playground\/blob\/main\/tests\/specs\/sortable-table.spec.ts\" rel=\"noopener noreferrer nofollow\">sortable-table.spec.ts<\/a><\/p>\n<pre><code class=\"typescript\">import { test } from '..\/src\/fixtures' import { SORTABLE_TABLE_COLUMNS } from '..\/src\/pages\/sorting-demo\/sorting-demo.columns'  test.describe('Sortable table', () =&gt; {    for (const column of Object.values(SORTABLE_TABLE_COLUMNS)) {          test(`${column} sort ascending`, async ({ sortableTablePage }) =&gt; {       const table = sortableTablePage.table       await table.sort.validateNone(column)       await table.sort.apply(column)       await table.sort.validateAscending(column)     })      test(`${column} sort descending`, async ({ sortableTablePage }) =&gt; {       const table = sortableTablePage.table       await table.sort.validateNone(column)       await table.sort.apply(column, { clickCount: 2})       await table.sort.validateDescending(column)     })    }  })<\/code><\/pre>\n<h2>\ud83d\udd27\ud83d\udcca\ud83d\udcbb \u0420\u0430\u0437\u0431\u043e\u0440: \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442?<\/h2>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0442\u0435\u0441\u0442 \u0441\u043f\u0435\u043a\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0434\u0432\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u0430 <code>${column} sort ascending<\/code> \u0438 <code>${column} sort descending<\/code> . \u0418\u043c\u0435\u044f \u0432\u0441\u0435\u0433\u043e \u0434\u0432\u0430 \u0442\u0435\u0441\u0442\u0430, \u043c\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0443 \u043f\u043e \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u043d\u0438\u044e \u0438 \u0443\u0431\u044b\u0432\u0430\u043d\u0438\u044e \u0432\u043e \u0432\u0441\u0435\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435. <\/p>\n<p><a href=\"https:\/\/github.com\/old-door\/qa-playground\/blob\/main\/tests\/src\/fixtures\/pages.fixtures.ts#L11\" rel=\"noopener noreferrer nofollow\">sortableTablePage<\/a> &#8212; \u0444\u0438\u043a\u0441\u0442\u0443\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0432\u0435\u0431 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0438 \u0436\u0434\u0451\u0442, \u0447\u0442\u043e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u0430.<\/p>\n<p>\u0427\u0442\u043e \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430? <a href=\"https:\/\/github.com\/old-door\/qa-playground\/blob\/main\/tests\/src\/pages\/sorting-demo\/sorting-demo.columns.ts\" rel=\"noopener noreferrer nofollow\">SORTABLE_TABLE_COLUMNS<\/a> &#8212; \u0441\u0442\u0430\u0442\u0438\u0447\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430\u0445 \u043d\u0430\u0448\u0435\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b: \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u043e\u043b\u0431\u0446\u0430, \u0444\u043e\u0440\u043c\u0430\u0442 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>\u041d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 <a href=\"https:\/\/github.com\/old-door\/qa-playground\/blob\/main\/tests\/src\/utils\/format\/date.format.ts\" rel=\"noopener noreferrer nofollow\">DateFormat<\/a> &#8212; \u043c\u043e\u0436\u0435\u043c \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u0447\u0442\u043e \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u0430, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043c\u0435\u0442\u043e\u0434 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445, \u0430 \u0442\u0430\u043a \u0436\u0435 \u043c\u0435\u0442\u043e\u0434 \u043f\u043e \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0443 <code>string-&gt;target format<\/code> .<\/p>\n<p>\u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u0438\u043c\u0435\u0442\u044c \u0435\u0434\u0438\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f:<\/p>\n<pre><code class=\"typescript\">async validate(     column: TableColumn,     direction: SortingDirection   ): Promise&lt;void&gt; {     await test.step(       `Validate table column \"${column}\" is sorted in \"${direction}\" direction`,        async () =&gt; {         await expect(           this.locators.headerByColumn(column)         ).toHaveAttribute('aria-sort', direction)          if (direction !== 'none') {           const values = await this.getColumnValues(column)           expect(             new Set(values).size,             `To have at least 2 unique values`           ).toBeGreaterThanOrEqual(2)           for (let i = 1; i &lt; values.length; i++) {             await test.step(`Compare row #${i} and #${i + 1}`, async () =&gt; {               const value = values[i - 1]               const nextValue = values[i]               const result = await test.step(`Parse and compare values`, () =&gt; {                 return column.format.comparator(value, nextValue)               })                  switch (direction) {                 case 'ascending':                   expect.soft(                     result,                     `#${i} ${value} to be less than or equal #${                       i + 1                     } ${nextValue}`                   ).toBeLessThanOrEqual(0)                   break                    case 'descending':                   expect.soft(                     result,                     `#${i} ${value} to be greater than or equal #${                       i + 1                     } ${nextValue}`                   ).toBeGreaterThanOrEqual(0)                   break                    default:                   throw new Error(`Unknown sorting direction: ${String(direction)}`)               }             })           }         }       })   }<\/code><\/pre>\n<p>\u041a\u0430\u043a \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0435\u0434\u0438\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043a \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e, \u0438\u0437\u0431\u0435\u0433\u0430\u0435\u043c \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u0442\u0435\u0441\u0442\u043e\u0432, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0438\u043c\u0435\u0435\u0442 \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0434\u043b\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u043d\u0430\u0448\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432.<\/p>\n<figure class=\"full-width\"><\/figure>\n<h2>\ud83d\udce2 \u0427\u0442\u043e \u0434\u0430\u043b\u044c\u0448\u0435?<\/h2>\n<p>\u042d\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0432\u044b\u0439 \u0448\u0430\u0433, \u043d\u043e\u0432\u044b\u0435 \u043f\u043e\u0441\u0442\u044b \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0435\u0440\u0438\u0438, \u0441 \u043d\u043e\u0432\u044b\u043c\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0443\u0436\u0435 \u043d\u0430 \u043f\u043e\u0434\u0445\u043e\u0434\u0435.<\/p>\n<p>\ud83d\udcac <strong>\u041d\u0430\u043f\u0438\u0448\u0438\u0442\u0435<\/strong> \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445 \u0447\u0442\u043e \u0432\u044b \u0434\u0443\u043c\u0430\u0435\u0442\u0435, \u0430 \u0442\u0430\u043a \u0436\u0435 , \u0447\u0442\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c.<br \/>\ud83d\udee0 <strong>\u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0439\u0442\u0435<\/strong> \u0444\u0438\u0447\u0438 \u0438 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u043d\u0430<a href=\"https:\/\/github.com\/old-door\/qa-playground\" rel=\"noopener noreferrer nofollow\"> GitHub<\/a>.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/938710\/\"> https:\/\/habr.com\/ru\/articles\/938710\/<\/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-471277","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/471277","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=471277"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/471277\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=471277"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=471277"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=471277"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}