From 10926fc57f13392afc29a7a530309e45639a65fc Mon Sep 17 00:00:00 2001 From: Roman Rodionov Date: Mon, 14 Oct 2024 13:38:19 +0200 Subject: [PATCH] - updated tests --- .../Cml-files/cml-files.spec.ts | 49 ++++++++--------- .../Save-File/save-file.spec.ts | 54 +++++++++---------- 2 files changed, 49 insertions(+), 54 deletions(-) diff --git a/ketcher-autotests/tests/File-Management/Open-And-Save-Files/Cml-files/cml-files.spec.ts b/ketcher-autotests/tests/File-Management/Open-And-Save-Files/Cml-files/cml-files.spec.ts index 09df163388..9c52804aa5 100644 --- a/ketcher-autotests/tests/File-Management/Open-And-Save-Files/Cml-files/cml-files.spec.ts +++ b/ketcher-autotests/tests/File-Management/Open-And-Save-Files/Cml-files/cml-files.spec.ts @@ -109,34 +109,31 @@ test.describe('CML files', () => { expect(cmlFile).toEqual(cmlFileExpected); }); - test.fail( - 'Open and Save file - CML - CML for R-group and other features', - async ({ page }) => { - /** - * Test case: EPMLSOPKET-1948 - * Description: Saved cml file with structure is compering with paste R-group from a mol file - * It needs to be investigated why the test is failing. - * We have bug https://github.com/epam/Indigo/issues/2497 - */ - - await openFileAddToCanvasTakeScreenshot( - page, - 'Molfiles-V2000/cml-1948-R-group.mol', - ); - // check that structure opened from file is displayed correctly + test('Open and Save file - CML - CML for R-group and other features', async ({ + page, + }) => { + /** + * Test case: EPMLSOPKET-1948 + * Description: Saved cml file with structure is compering with paste R-group from a mol file + */ - const expectedFile = await getCml(page); - await saveToFile('CML/cml-1948-r-group-expected.cml', expectedFile); - const { file: cmlFile, fileExpected: cmlFileExpected } = - await receiveFileComparisonData({ - page, - expectedFileName: 'tests/test-data/CML/cml-1948-r-group-expected.cml', - }); - // comparing cml file with golden cml file + await openFileAddToCanvasTakeScreenshot( + page, + 'Molfiles-V2000/cml-1948-R-group.mol', + ); + // check that structure opened from file is displayed correctly - expect(cmlFile).toEqual(cmlFileExpected); - }, - ); + const expectedFile = await getCml(page); + await saveToFile('CML/cml-1948-r-group-expected.cml', expectedFile); + const { file: cmlFile, fileExpected: cmlFileExpected } = + await receiveFileComparisonData({ + page, + expectedFileName: 'tests/test-data/CML/cml-1948-r-group-expected.cml', + }); + // comparing cml file with golden cml file + + expect(cmlFile).toEqual(cmlFileExpected); + }); test('Validate that unsplit nucleotides connected with peptides could be saved to CML file and loaded back', async ({ page, diff --git a/ketcher-autotests/tests/File-Management/Open-And-Save-Files/Save-File/save-file.spec.ts b/ketcher-autotests/tests/File-Management/Open-And-Save-Files/Save-File/save-file.spec.ts index 39e3a66cc2..ae4039de2c 100644 --- a/ketcher-autotests/tests/File-Management/Open-And-Save-Files/Save-File/save-file.spec.ts +++ b/ketcher-autotests/tests/File-Management/Open-And-Save-Files/Save-File/save-file.spec.ts @@ -178,35 +178,33 @@ test.describe('Save files', () => { }, ); - test.fail( - 'Automatic selection of MDL Molfile v3000 encoding is work if the number of atoms (or bonds) exceeds 999', - async ({ page }) => { - /** - * IMPORTANT: Test fails because we have bug https://github.com/epam/Indigo/issues/2494 - * Test case: EPMLSOPKET-5260 - * Description: Structure is saved according to automated selected format MDL Molfile v3000 - */ - - await openFileAndAddToCanvas( - 'Molfiles-V3000/structure-where-atoms-exceeds999.mol', + test('Automatic selection of MDL Molfile v3000 encoding is work if the number of atoms (or bonds) exceeds 999', async ({ + page, + }) => { + /** + * Test case: EPMLSOPKET-5260 + * Description: Structure is saved according to automated selected format MDL Molfile v3000 + */ + + await openFileAndAddToCanvas( + 'Molfiles-V3000/structure-where-atoms-exceeds999.mol', + page, + ); + const expectedFile = await getMolfile(page); + await saveToFile( + 'Molfiles-V3000/structure-where-atoms-exceeds999-expected.mol', + expectedFile, + ); + const METADATA_STRING_INDEX = [1]; + const { fileExpected: molFileExpected, file: molFile } = + await receiveFileComparisonData({ page, - ); - const expectedFile = await getMolfile(page); - await saveToFile( - 'Molfiles-V3000/structure-where-atoms-exceeds999-expected.mol', - expectedFile, - ); - const METADATA_STRING_INDEX = [1]; - const { fileExpected: molFileExpected, file: molFile } = - await receiveFileComparisonData({ - page, - expectedFileName: - 'tests/test-data/Molfiles-V3000/structure-where-atoms-exceeds999-expected.mol', - metaDataIndexes: METADATA_STRING_INDEX, - }); - expect(molFile).toEqual(molFileExpected); - }, - ); + expectedFileName: + 'tests/test-data/Molfiles-V3000/structure-where-atoms-exceeds999-expected.mol', + metaDataIndexes: METADATA_STRING_INDEX, + }); + expect(molFile).toEqual(molFileExpected); + }); test('The file formats in the Save Structure window match the mockup', async ({ page,