diff --git a/Makefile b/Makefile index 1464e76b..da7f422c 100644 --- a/Makefile +++ b/Makefile @@ -25,3 +25,6 @@ build_browser_extensions: run_docker_nginx: docker run -p 8080:8080 elasticvue + +e2e: build_docker_ci + docker run --rm -v ./playwright-report-ci:/app/playwright-report elasticvue-ci yarn test:e2e $(TEST) diff --git a/scripts/mock.js b/scripts/mock.js index 9136639e..69fcfa93 100644 --- a/scripts/mock.js +++ b/scripts/mock.js @@ -392,7 +392,7 @@ exports.mock = async page => { json: { '_shards': { 'total': 50, 'successful': 50, 'failed': 0 } } }, catNodes: { - url: 'http://localhost:9200/_cat/nodes?h=ip%2Cid%2Cname%2Cheap.percent%2Cheap.current%2Cheap.max%2Cram.percent%2Cram.current%2Cram.max%2Cnode.role%2Cmaster%2Ccpu%2Cload_1m%2Cload_5m%2Cload_15m%2Cdisk.used_percent%2Cdisk.used%2Cdisk.total&full_id=true', + url: 'http://localhost:9200/_cat/nodes?h=ip%2Cid%2Cname%2Cversion%2Cheap.percent%2Cheap.current%2Cheap.max%2Cram.percent%2Cram.current%2Cram.max%2Cnode.role%2Cmaster%2Ccpu%2Cload_1m%2Cload_5m%2Cload_15m%2Cdisk.used_percent%2Cdisk.used%2Cdisk.total&full_id=true', json: [ { 'ip': '192.168.112.1', diff --git a/tests/e2e/mocks/elastic_1/home.ts b/tests/e2e/mocks/elastic_1/home.ts index 3d50d585..51b3c29b 100644 --- a/tests/e2e/mocks/elastic_1/home.ts +++ b/tests/e2e/mocks/elastic_1/home.ts @@ -70,8 +70,8 @@ export const mockElasticHome = async (page: Page, { health }: { health?: string } for (const method in mocks) { - const url = mocks[method].url - const json = mocks[method].json + const url = mocks[method as keyof typeof mocks].url + const json = mocks[method as keyof typeof mocks].json await page.route(url, async route => (await route.fulfill({ json }))) } diff --git a/tests/e2e/mocks/elastic_1/indices.ts b/tests/e2e/mocks/elastic_1/indices.ts index 78278bdf..95cb33fe 100644 --- a/tests/e2e/mocks/elastic_1/indices.ts +++ b/tests/e2e/mocks/elastic_1/indices.ts @@ -28,8 +28,8 @@ export const mockElasticIndices = async (page: Page) => { } for (const method in mocks) { - const url = mocks[method].url - const json = mocks[method].json + const url = mocks[method as keyof typeof mocks].url + const json = mocks[method as keyof typeof mocks].json await page.route(url, async route => (await route.fulfill({ json }))) } diff --git a/tests/e2e/mocks/elastic_1/nodes.ts b/tests/e2e/mocks/elastic_1/nodes.ts index 79b338b2..71516e19 100644 --- a/tests/e2e/mocks/elastic_1/nodes.ts +++ b/tests/e2e/mocks/elastic_1/nodes.ts @@ -3,12 +3,13 @@ import { Page } from '@playwright/test' export const mockElasticNodes = async (page: Page) => { const mocks = { catNodes: { - url: 'http://localhost:9200/_cat/nodes?h=ip%2Cid%2Cname%2Cheap.percent%2Cheap.current%2Cheap.max%2Cram.percent%2Cram.current%2Cram.max%2Cnode.role%2Cmaster%2Ccpu%2Cload_1m%2Cload_5m%2Cload_15m%2Cdisk.used_percent%2Cdisk.used%2Cdisk.total&full_id=true', + url: 'http://localhost:9200/_cat/nodes?h=ip%2Cid%2Cname%2Cversion%2Cheap.percent%2Cheap.current%2Cheap.max%2Cram.percent%2Cram.current%2Cram.max%2Cnode.role%2Cmaster%2Ccpu%2Cload_1m%2Cload_5m%2Cload_15m%2Cdisk.used_percent%2Cdisk.used%2Cdisk.total&full_id=true', json: [ { 'ip': '192.168.48.2', 'id': 'tz7KYbj8RSeyum3J-v4VZQ', 'name': 'es-1-node-1', + 'version': '1.7.6', 'heap.percent': '6', 'heap.current': '59.7mb', 'heap.max': '989.8mb', @@ -39,8 +40,8 @@ export const mockElasticNodes = async (page: Page) => { } for (const method in mocks) { - const url = mocks[method].url - const json = mocks[method].json + const url = mocks[method as keyof typeof mocks].url + const json = mocks[method as keyof typeof mocks].json await page.route(url, async route => (await route.fulfill({ json }))) } diff --git a/tests/e2e/mocks/elastic_2/home.ts b/tests/e2e/mocks/elastic_2/home.ts index 860001aa..c6621307 100644 --- a/tests/e2e/mocks/elastic_2/home.ts +++ b/tests/e2e/mocks/elastic_2/home.ts @@ -72,8 +72,8 @@ export const mockElasticHome = async (page: Page, { health }: { health?: string } for (const method in mocks) { - const url = mocks[method].url - const json = mocks[method].json + const url = mocks[method as keyof typeof mocks].url + const json = mocks[method as keyof typeof mocks].json await page.route(url, async route => (await route.fulfill({ json }))) } diff --git a/tests/e2e/mocks/elastic_2/indices.ts b/tests/e2e/mocks/elastic_2/indices.ts index f083c69c..dbada2d3 100644 --- a/tests/e2e/mocks/elastic_2/indices.ts +++ b/tests/e2e/mocks/elastic_2/indices.ts @@ -30,8 +30,8 @@ export const mockElasticIndices = async (page: Page) => { } for (const method in mocks) { - const url = mocks[method].url - const json = mocks[method].json + const url = mocks[method as keyof typeof mocks].url + const json = mocks[method as keyof typeof mocks].json await page.route(url, async route => (await route.fulfill({ json }))) } diff --git a/tests/e2e/mocks/elastic_2/nodes.ts b/tests/e2e/mocks/elastic_2/nodes.ts index 5f20148e..e52cfc24 100644 --- a/tests/e2e/mocks/elastic_2/nodes.ts +++ b/tests/e2e/mocks/elastic_2/nodes.ts @@ -3,12 +3,13 @@ import { Page } from '@playwright/test' export const mockElasticNodes = async (page: Page) => { const mocks = { catNodes: { - url: 'http://localhost:9200/_cat/nodes?h=ip%2Cid%2Cname%2Cheap.percent%2Cheap.current%2Cheap.max%2Cram.percent%2Cram.current%2Cram.max%2Cnode.role%2Cmaster%2Ccpu%2Cload_1m%2Cload_5m%2Cload_15m%2Cdisk.used_percent%2Cdisk.used%2Cdisk.total&full_id=true', + url: 'http://localhost:9200/_cat/nodes?h=ip%2Cid%2Cname%2Cversion%2Cheap.percent%2Cheap.current%2Cheap.max%2Cram.percent%2Cram.current%2Cram.max%2Cnode.role%2Cmaster%2Ccpu%2Cload_1m%2Cload_5m%2Cload_15m%2Cdisk.used_percent%2Cdisk.used%2Cdisk.total&full_id=true', json: [ { 'ip': '192.168.16.2', 'id': '0tgdUvIbSOCHzADG18paPQ', 'name': 'es-2-node-1', + 'version': '2.4.6', 'heap.percent': '4', 'heap.current': '47mb', 'heap.max': '989.8mb', @@ -40,8 +41,8 @@ export const mockElasticNodes = async (page: Page) => { } for (const method in mocks) { - const url = mocks[method].url - const json = mocks[method].json + const url = mocks[method as keyof typeof mocks].url + const json = mocks[method as keyof typeof mocks].json await page.route(url, async route => (await route.fulfill({ json }))) } diff --git a/tests/e2e/mocks/elastic_5/home.ts b/tests/e2e/mocks/elastic_5/home.ts index b00252db..2d443326 100644 --- a/tests/e2e/mocks/elastic_5/home.ts +++ b/tests/e2e/mocks/elastic_5/home.ts @@ -72,8 +72,8 @@ export const mockElasticHome = async (page: Page, { health }: { health?: string } for (const method in mocks) { - const url = mocks[method].url - const json = mocks[method].json + const url = mocks[method as keyof typeof mocks].url + const json = mocks[method as keyof typeof mocks].json await page.route(url, async route => (await route.fulfill({ json }))) } diff --git a/tests/e2e/mocks/elastic_5/nodes.ts b/tests/e2e/mocks/elastic_5/nodes.ts index e2cec74e..f34538a4 100644 --- a/tests/e2e/mocks/elastic_5/nodes.ts +++ b/tests/e2e/mocks/elastic_5/nodes.ts @@ -3,12 +3,13 @@ import { Page } from '@playwright/test' export const mockElasticNodes = async (page: Page) => { const mocks = { catNodes: { - url: 'http://localhost:9200/_cat/nodes?h=ip%2Cid%2Cname%2Cheap.percent%2Cheap.current%2Cheap.max%2Cram.percent%2Cram.current%2Cram.max%2Cnode.role%2Cmaster%2Ccpu%2Cload_1m%2Cload_5m%2Cload_15m%2Cdisk.used_percent%2Cdisk.used%2Cdisk.total&full_id=true', + url: 'http://localhost:9200/_cat/nodes?h=ip%2Cid%2Cname%2Cversion%2Cheap.percent%2Cheap.current%2Cheap.max%2Cram.percent%2Cram.current%2Cram.max%2Cnode.role%2Cmaster%2Ccpu%2Cload_1m%2Cload_5m%2Cload_15m%2Cdisk.used_percent%2Cdisk.used%2Cdisk.total&full_id=true', json: [ { 'ip': '192.168.112.2', 'id': '80VY7GdJQ266bnC3oX_gSw', 'name': 'es-5-node-1', + 'version': '5.6.16', 'heap.percent': '21', 'heap.current': '431.2mb', 'heap.max': '1.9gb', @@ -47,8 +48,8 @@ export const mockElasticNodes = async (page: Page) => { } for (const method in mocks) { - const url = mocks[method].url - const json = mocks[method].json + const url = mocks[method as keyof typeof mocks].url + const json = mocks[method as keyof typeof mocks].json await page.route(url, async route => (await route.fulfill({ json }))) } diff --git a/tests/e2e/mocks/elastic_6/home.ts b/tests/e2e/mocks/elastic_6/home.ts index feb4eae9..6ad5cae3 100644 --- a/tests/e2e/mocks/elastic_6/home.ts +++ b/tests/e2e/mocks/elastic_6/home.ts @@ -77,8 +77,8 @@ export const mockElasticHome = async (page: Page, { health }: { health?: string } for (const method in mocks) { - const url = mocks[method].url - const json = mocks[method].json + const url = mocks[method as keyof typeof mocks].url + const json = mocks[method as keyof typeof mocks].json await page.route(url, async route => (await route.fulfill({ json }))) } diff --git a/tests/e2e/mocks/elastic_6/nodes.ts b/tests/e2e/mocks/elastic_6/nodes.ts index 88ccd400..b85d102b 100644 --- a/tests/e2e/mocks/elastic_6/nodes.ts +++ b/tests/e2e/mocks/elastic_6/nodes.ts @@ -3,12 +3,13 @@ import { Page } from '@playwright/test' export const mockElasticNodes = async (page: Page) => { const mocks = { catNodes: { - url: 'http://localhost:9200/_cat/nodes?h=ip%2Cid%2Cname%2Cheap.percent%2Cheap.current%2Cheap.max%2Cram.percent%2Cram.current%2Cram.max%2Cnode.role%2Cmaster%2Ccpu%2Cload_1m%2Cload_5m%2Cload_15m%2Cdisk.used_percent%2Cdisk.used%2Cdisk.total&full_id=true', + url: 'http://localhost:9200/_cat/nodes?h=ip%2Cid%2Cname%2Cversion%2Cheap.percent%2Cheap.current%2Cheap.max%2Cram.percent%2Cram.current%2Cram.max%2Cnode.role%2Cmaster%2Ccpu%2Cload_1m%2Cload_5m%2Cload_15m%2Cdisk.used_percent%2Cdisk.used%2Cdisk.total&full_id=true', json: [ { 'ip': '192.168.64.4', 'id': 'o8NZD5umQdiBmKWIXd_Ueg', 'name': 'es-6-node-2', + 'version': '6.8.2', 'heap.percent': '57', 'heap.current': '286.1mb', 'heap.max': '494.9mb', @@ -75,8 +76,8 @@ export const mockElasticNodes = async (page: Page) => { } for (const method in mocks) { - const url = mocks[method].url - const json = mocks[method].json + const url = mocks[method as keyof typeof mocks].url + const json = mocks[method as keyof typeof mocks].json await page.route(url, async route => (await route.fulfill({ json }))) } diff --git a/tests/e2e/mocks/elastic_7/home.ts b/tests/e2e/mocks/elastic_7/home.ts index 19c4c335..00823b51 100644 --- a/tests/e2e/mocks/elastic_7/home.ts +++ b/tests/e2e/mocks/elastic_7/home.ts @@ -77,8 +77,8 @@ export const mockElasticHome = async (page: Page, { health }: { health?: string } for (const method in mocks) { - const url = mocks[method].url - const json = mocks[method].json + const url = mocks[method as keyof typeof mocks].url + const json = mocks[method as keyof typeof mocks].json await page.route(url, async route => (await route.fulfill({ json }))) } diff --git a/tests/e2e/mocks/elastic_7/nodes.ts b/tests/e2e/mocks/elastic_7/nodes.ts index 73eba165..ea511534 100644 --- a/tests/e2e/mocks/elastic_7/nodes.ts +++ b/tests/e2e/mocks/elastic_7/nodes.ts @@ -3,12 +3,13 @@ import { Page } from '@playwright/test' export const mockElasticNodes = async (page: Page) => { const mocks = { catNodes: { - url: 'http://localhost:9200/_cat/nodes?h=ip%2Cid%2Cname%2Cheap.percent%2Cheap.current%2Cheap.max%2Cram.percent%2Cram.current%2Cram.max%2Cnode.role%2Cmaster%2Ccpu%2Cload_1m%2Cload_5m%2Cload_15m%2Cdisk.used_percent%2Cdisk.used%2Cdisk.total&full_id=true', + url: 'http://localhost:9200/_cat/nodes?h=ip%2Cid%2Cname%2Cversion%2Cheap.percent%2Cheap.current%2Cheap.max%2Cram.percent%2Cram.current%2Cram.max%2Cnode.role%2Cmaster%2Ccpu%2Cload_1m%2Cload_5m%2Cload_15m%2Cdisk.used_percent%2Cdisk.used%2Cdisk.total&full_id=true', json: [ { 'ip': '192.168.80.2', 'id': 'g72ugSyySjOyRkmiMQ0zYQ', 'name': 'es-7-node-1', + 'version': '7.17.10', 'heap.percent': '33', 'heap.current': '174mb', 'heap.max': '512mb', @@ -76,8 +77,8 @@ export const mockElasticNodes = async (page: Page) => { } for (const method in mocks) { - const url = mocks[method].url - const json = mocks[method].json + const url = mocks[method as keyof typeof mocks].url + const json = mocks[method as keyof typeof mocks].json await page.route(url, async route => (await route.fulfill({ json }))) } diff --git a/tests/e2e/mocks/elastic_8/home.ts b/tests/e2e/mocks/elastic_8/home.ts index 0fdbe2ce..e6bf4cb9 100644 --- a/tests/e2e/mocks/elastic_8/home.ts +++ b/tests/e2e/mocks/elastic_8/home.ts @@ -77,8 +77,8 @@ export const mockElasticHome = async (page: Page, { health }: { health?: string } for (const method in mocks) { - const url = mocks[method].url - const json = mocks[method].json + const url = mocks[method as keyof typeof mocks].url + const json = mocks[method as keyof typeof mocks].json await page.route(url, async route => (await route.fulfill({ json }))) } diff --git a/tests/e2e/mocks/elastic_8/nodes.ts b/tests/e2e/mocks/elastic_8/nodes.ts index 6f0922bb..a4e8f0a1 100644 --- a/tests/e2e/mocks/elastic_8/nodes.ts +++ b/tests/e2e/mocks/elastic_8/nodes.ts @@ -3,12 +3,13 @@ import { Page } from '@playwright/test' export const mockElasticNodes = async (page: Page) => { const mocks = { catNodes: { - url: 'http://localhost:9200/_cat/nodes?h=ip%2Cid%2Cname%2Cheap.percent%2Cheap.current%2Cheap.max%2Cram.percent%2Cram.current%2Cram.max%2Cnode.role%2Cmaster%2Ccpu%2Cload_1m%2Cload_5m%2Cload_15m%2Cdisk.used_percent%2Cdisk.used%2Cdisk.total&full_id=true', + url: 'http://localhost:9200/_cat/nodes?h=ip%2Cid%2Cname%2Cversion%2Cheap.percent%2Cheap.current%2Cheap.max%2Cram.percent%2Cram.current%2Cram.max%2Cnode.role%2Cmaster%2Ccpu%2Cload_1m%2Cload_5m%2Cload_15m%2Cdisk.used_percent%2Cdisk.used%2Cdisk.total&full_id=true', json: [ { 'ip': '192.168.32.2', 'id': 'hrFoHMcpTD-2QseKkE8W3Q', 'name': 'es-8-node-1', + 'version': '8.7.1', 'heap.percent': '45', 'heap.current': '230.6mb', 'heap.max': '512mb', @@ -47,8 +48,8 @@ export const mockElasticNodes = async (page: Page) => { } for (const method in mocks) { - const url = mocks[method].url - const json = mocks[method].json + const url = mocks[method as keyof typeof mocks].url + const json = mocks[method as keyof typeof mocks].json await page.route(url, async route => (await route.fulfill({ json }))) } diff --git a/tests/e2e/mocks/opensearch_2/home.ts b/tests/e2e/mocks/opensearch_2/home.ts index c143a3bb..e106122f 100644 --- a/tests/e2e/mocks/opensearch_2/home.ts +++ b/tests/e2e/mocks/opensearch_2/home.ts @@ -83,8 +83,8 @@ export const mockElasticHome = async (page: Page, { health }: { health?: string } for (const method in mocks) { - const url = mocks[method].url - const json = mocks[method].json + const url = mocks[method as keyof typeof mocks].url + const json = mocks[method as keyof typeof mocks].json await page.route(url, async route => (await route.fulfill({ json }))) } diff --git a/tests/e2e/mocks/opensearch_2/nodes.ts b/tests/e2e/mocks/opensearch_2/nodes.ts index cff09f14..61baf14c 100644 --- a/tests/e2e/mocks/opensearch_2/nodes.ts +++ b/tests/e2e/mocks/opensearch_2/nodes.ts @@ -3,7 +3,7 @@ import { Page } from '@playwright/test' export const mockElasticNodes = async (page: Page) => { const mocks = { catNodes: { - url: 'http://localhost:9200/_cat/nodes?h=ip%2Cid%2Cname%2Cheap.percent%2Cheap.current%2Cheap.max%2Cram.percent%2Cram.current%2Cram.max%2Cnode.role%2Cmaster%2Ccpu%2Cload_1m%2Cload_5m%2Cload_15m%2Cdisk.used_percent%2Cdisk.used%2Cdisk.total&full_id=true', + url: 'http://localhost:9200/_cat/nodes?h=ip%2Cid%2Cname%2Cversion%2Cheap.percent%2Cheap.current%2Cheap.max%2Cram.percent%2Cram.current%2Cram.max%2Cnode.role%2Cmaster%2Ccpu%2Cload_1m%2Cload_5m%2Cload_15m%2Cdisk.used_percent%2Cdisk.used%2Cdisk.total&full_id=true', json: [ { 'ip': '172.29.0.3', @@ -66,8 +66,8 @@ export const mockElasticNodes = async (page: Page) => { } for (const method in mocks) { - const url = mocks[method].url - const json = mocks[method].json + const url = mocks[method as keyof typeof mocks].url + const json = mocks[method as keyof typeof mocks].json await page.route(url, async route => (await route.fulfill({ json }))) }