diff --git a/frontend/tests/playwright/comparison.test.js b/frontend/tests/playwright/comparison.todo.js similarity index 93% rename from frontend/tests/playwright/comparison.test.js rename to frontend/tests/playwright/comparison.todo.js index 0a7bc9f4..a9aa3b92 100644 --- a/frontend/tests/playwright/comparison.test.js +++ b/frontend/tests/playwright/comparison.todo.js @@ -14,6 +14,7 @@ import asthmaGraphData from '../test-data/asthmaExampleGraphData.json'; // diagramCase: last copied from test_graph.py test_get_missing_in_between_nodes(): 2024/02/11 // edges only. see https://github.com/jhu-bids/TermHub/blob/develop/docs/graph.md import _diagramCase from '../test-data/diagramCase.json'; +import convertToArrayOfStrings from './utils'; let diagramCase = convertToArrayOfStrings(_diagramCase); @@ -25,12 +26,12 @@ testCases = [singleSmallTestData, ]; let timeout = 20000; for (const envName in selectedConfigs) { + const appUrl = + deploymentConfigs[envName] + + '/cset-comparison?' + + codeset_ids.map(d => `codeset_ids=${d}`).join('&'); for (const testData of testCases) { const {test_name, codeset_ids, graphData, roots, leaves, firstRow, } = testData; - const appUrl = - deploymentConfigs[envName] + - '/cset-comparison?' + - codeset_ids.map(d => `codeset_ids=${d}`).join('&'); test.describe(`On ${envName} with case ${test_name}`, () => { test.describe(`GraphOptions and GraphContainer Tests`, async () => { @@ -117,10 +118,6 @@ for (const envName in selectedConfigs) { const url = new URL(page.url()); return url.pathname === 'cset-comparison'; }).toBeTruthy(); - - /* - - */ }); }); @@ -197,17 +194,3 @@ for (const envName in selectedConfigs) { */ } } - -// UTILS -/* Used to convert input to be same as graphology serialization (all strings). */ -function convertToArrayOfStrings(matrix) { - var stringMatrix = []; - for (var i = 0; i < matrix.length; i++) { - var stringRow = []; - for (var j = 0; j < matrix[i].length; j++) { - stringRow.push(matrix[i][j].toString()); - } - stringMatrix.push(stringRow); - } - return stringMatrix; -} diff --git a/frontend/tests/playwright/n3c-recommended.todo.js b/frontend/tests/playwright/n3c-recommended.todo.js new file mode 100644 index 00000000..f3c5b795 --- /dev/null +++ b/frontend/tests/playwright/n3c-recommended.todo.js @@ -0,0 +1,42 @@ +import {selectedConfigs, deploymentConfigs} from "./setup-test-environments"; +// const { test, expect } = require('@playwright/test'); +import {test, expect, } from '@playwright/test'; + +// Tests --------------------------------------------------------------------------------------------------------------- +let timeout = 20000; + +// todo temp: toggle comment for development +// for (const envName of ['dev']) { +for (const envName in selectedConfigs) { + + const appUrl = deploymentConfigs[envName]; + + test('N3C Recommended', async ({ page }) => { + await page.goto(appUrl); + await page.goto(appUrl + '/OMOPConceptSets'); + + await page.getByTestId('Help / About').click(); + await page.getByRole('link', { name: 'N3C Recommended', exact: true }).click(); + // TODO: make some assertions + }); + + test('N3C Recommended comparison', async ({ page }) => { + await page.goto(appUrl); + await page.goto(appUrl + '/OMOPConceptSets'); + + await page.getByTestId('Help / About').click(); + await page.getByRole('link', { name: 'N3C Recommended comparison' }).click(); + // todo: maybe try to dynamically select whatever row it is that has changes, rather than static case + await page.getByRole('row', { name: 'Expand Row CARDIOMYOPATHIES' }).getByTestId('expander-button-undefined').click(); + // TODO: how to select the table dynamically? I want to assert that it shows rows are removed an added + // - but the selector id is really weird:
, then a