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 051f780b2d..110a994660 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 @@ -100,34 +100,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, diff --git a/ketcher-autotests/tests/Macromolecule-editor/Import-Saving-Files/import-saving-mol.spec.ts b/ketcher-autotests/tests/Macromolecule-editor/Import-Saving-Files/import-saving-mol.spec.ts index c8c393153c..299ffc102e 100644 --- a/ketcher-autotests/tests/Macromolecule-editor/Import-Saving-Files/import-saving-mol.spec.ts +++ b/ketcher-autotests/tests/Macromolecule-editor/Import-Saving-Files/import-saving-mol.spec.ts @@ -378,40 +378,36 @@ test.describe('Import-Saving .mol Files', () => { await turnOnMacromoleculesEditor(page); }); - test.fail( - 'Check that you can save snake viewed chain of peptides in a Mol v3000 file', - { tag: ['@IncorrectResultBecauseOfBug'] }, - async () => { - /* + test('Check that you can save snake viewed chain of peptides in a Mol v3000 file', async () => { + /* Test case: Import/Saving files Description: Snake viewed chain of peptides saved in a Mol v3000 file Test fails because we have bug https://github.com/epam/ketcher/issues/5634 */ - await openFileAndAddToCanvasMacro( - 'Molfiles-V3000/snake-mode-peptides.mol', - page, - ); - await selectSnakeLayoutModeTool(page); - const expectedFile = await getMolfile(page); - await saveToFile( - 'Molfiles-V3000/snake-mode-peptides-expected.mol', - expectedFile, - ); + await openFileAndAddToCanvasMacro( + 'Molfiles-V3000/snake-mode-peptides.mol', + page, + ); + await selectSnakeLayoutModeTool(page); + const expectedFile = await getMolfile(page); + await saveToFile( + 'Molfiles-V3000/snake-mode-peptides-expected.mol', + expectedFile, + ); - const METADATA_STRING_INDEX = [1]; + const METADATA_STRING_INDEX = [1]; - const { fileExpected: molFileExpected, file: molFile } = - await receiveFileComparisonData({ - page, - expectedFileName: - 'tests/test-data/Molfiles-V3000/snake-mode-peptides-expected.mol', - metaDataIndexes: METADATA_STRING_INDEX, - }); + const { fileExpected: molFileExpected, file: molFile } = + await receiveFileComparisonData({ + page, + expectedFileName: + 'tests/test-data/Molfiles-V3000/snake-mode-peptides-expected.mol', + metaDataIndexes: METADATA_STRING_INDEX, + }); - expect(molFile).toEqual(molFileExpected); - }, - ); + expect(molFile).toEqual(molFileExpected); + }); test('Check that .mol file with macro structures is imported correctly in macro mode when saving it in micro mode', async () => { /* diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/R-group-tool/r-group-label-dialog.spec.ts-snapshots/R-Group-Label-Tool-Atom-properties-do-not-implement-for-the-Rgroup-labels-1-chromium-linux.png b/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/R-group-tool/r-group-label-dialog.spec.ts-snapshots/R-Group-Label-Tool-Atom-properties-do-not-implement-for-the-Rgroup-labels-1-chromium-linux.png index c6dde5541c..14eeccddac 100644 Binary files a/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/R-group-tool/r-group-label-dialog.spec.ts-snapshots/R-Group-Label-Tool-Atom-properties-do-not-implement-for-the-Rgroup-labels-1-chromium-linux.png and b/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/R-group-tool/r-group-label-dialog.spec.ts-snapshots/R-Group-Label-Tool-Atom-properties-do-not-implement-for-the-Rgroup-labels-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/R-group-tool/r-group-label-dialog.spec.ts-snapshots/R-Group-Label-Tool-Copy-Paste-actions-Structure-with-R-Group-label-1-chromium-linux.png b/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/R-group-tool/r-group-label-dialog.spec.ts-snapshots/R-Group-Label-Tool-Copy-Paste-actions-Structure-with-R-Group-label-1-chromium-linux.png index f59aa46c84..fbc6f2e8b9 100644 Binary files a/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/R-group-tool/r-group-label-dialog.spec.ts-snapshots/R-Group-Label-Tool-Copy-Paste-actions-Structure-with-R-Group-label-1-chromium-linux.png and b/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/R-group-tool/r-group-label-dialog.spec.ts-snapshots/R-Group-Label-Tool-Copy-Paste-actions-Structure-with-R-Group-label-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-100px-to-Down-with-Shift-key-Structure-Movement-with-Arrow-Keys-10px-move-2-chromium-linux.png b/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-100px-to-Down-with-Shift-key-Structure-Movement-with-Arrow-Keys-10px-move-2-chromium-linux.png index 81552a46a8..c1238db7e3 100644 Binary files a/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-100px-to-Down-with-Shift-key-Structure-Movement-with-Arrow-Keys-10px-move-2-chromium-linux.png and b/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-100px-to-Down-with-Shift-key-Structure-Movement-with-Arrow-Keys-10px-move-2-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-100px-to-Left-with-Shift-key-Structure-Movement-with-Arrow-Keys-10px-move-2-chromium-linux.png b/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-100px-to-Left-with-Shift-key-Structure-Movement-with-Arrow-Keys-10px-move-2-chromium-linux.png index 378b778060..55e7c388ca 100644 Binary files a/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-100px-to-Left-with-Shift-key-Structure-Movement-with-Arrow-Keys-10px-move-2-chromium-linux.png and b/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-100px-to-Left-with-Shift-key-Structure-Movement-with-Arrow-Keys-10px-move-2-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-100px-to-Right-with-Shift-key-Structure-Movement-with-Arrow-Keys-10px-move-2-chromium-linux.png b/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-100px-to-Right-with-Shift-key-Structure-Movement-with-Arrow-Keys-10px-move-2-chromium-linux.png index f06e5b9b72..41e9dbdbf0 100644 Binary files a/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-100px-to-Right-with-Shift-key-Structure-Movement-with-Arrow-Keys-10px-move-2-chromium-linux.png and b/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-100px-to-Right-with-Shift-key-Structure-Movement-with-Arrow-Keys-10px-move-2-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-100px-to-Up-with-Shift-key-Structure-Movement-with-Arrow-Keys-10px-move-2-chromium-linux.png b/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-100px-to-Up-with-Shift-key-Structure-Movement-with-Arrow-Keys-10px-move-2-chromium-linux.png index ec50c34b6a..7d3f530d32 100644 Binary files a/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-100px-to-Up-with-Shift-key-Structure-Movement-with-Arrow-Keys-10px-move-2-chromium-linux.png and b/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-100px-to-Up-with-Shift-key-Structure-Movement-with-Arrow-Keys-10px-move-2-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-50px-to-Down-Structure-Movement-with-Arrow-Keys-1px-move-2-chromium-linux.png b/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-50px-to-Down-Structure-Movement-with-Arrow-Keys-1px-move-2-chromium-linux.png index 28d90cae39..4b27dc26a3 100644 Binary files a/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-50px-to-Down-Structure-Movement-with-Arrow-Keys-1px-move-2-chromium-linux.png and b/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-50px-to-Down-Structure-Movement-with-Arrow-Keys-1px-move-2-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-50px-to-Left-Structure-Movement-with-Arrow-Keys-1px-move-2-chromium-linux.png b/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-50px-to-Left-Structure-Movement-with-Arrow-Keys-1px-move-2-chromium-linux.png index d47a936bf1..98184a0cd1 100644 Binary files a/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-50px-to-Left-Structure-Movement-with-Arrow-Keys-1px-move-2-chromium-linux.png and b/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-50px-to-Left-Structure-Movement-with-Arrow-Keys-1px-move-2-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-50px-to-Right-Structure-Movement-with-Arrow-Keys-1px-move-2-chromium-linux.png b/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-50px-to-Right-Structure-Movement-with-Arrow-Keys-1px-move-2-chromium-linux.png index 621c540858..09ffd25f38 100644 Binary files a/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-50px-to-Right-Structure-Movement-with-Arrow-Keys-1px-move-2-chromium-linux.png and b/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-50px-to-Right-Structure-Movement-with-Arrow-Keys-1px-move-2-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-50px-to-Up-Structure-Movement-with-Arrow-Keys-1px-move-2-chromium-linux.png b/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-50px-to-Up-Structure-Movement-with-Arrow-Keys-1px-move-2-chromium-linux.png index 4babb8b753..7b3b647c8d 100644 Binary files a/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-50px-to-Up-Structure-Movement-with-Arrow-Keys-1px-move-2-chromium-linux.png and b/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-50px-to-Up-Structure-Movement-with-Arrow-Keys-1px-move-2-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Canvas-Expansion-when-Structure-is-Moved-Outside-Down-1-chromium-linux.png b/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Canvas-Expansion-when-Structure-is-Moved-Outside-Down-1-chromium-linux.png index 950c600acd..aeda3f169c 100644 Binary files a/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Canvas-Expansion-when-Structure-is-Moved-Outside-Down-1-chromium-linux.png and b/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Canvas-Expansion-when-Structure-is-Moved-Outside-Down-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Canvas-Expansion-when-Structure-is-Moved-Outside-Left-1-chromium-linux.png b/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Canvas-Expansion-when-Structure-is-Moved-Outside-Left-1-chromium-linux.png index 95bb31276d..0d15eb8be9 100644 Binary files a/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Canvas-Expansion-when-Structure-is-Moved-Outside-Left-1-chromium-linux.png and b/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Canvas-Expansion-when-Structure-is-Moved-Outside-Left-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Canvas-Expansion-when-Structure-is-Moved-Outside-Right-1-chromium-linux.png b/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Canvas-Expansion-when-Structure-is-Moved-Outside-Right-1-chromium-linux.png index 7c7dfebbd2..5460e1f585 100644 Binary files a/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Canvas-Expansion-when-Structure-is-Moved-Outside-Right-1-chromium-linux.png and b/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Canvas-Expansion-when-Structure-is-Moved-Outside-Right-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Canvas-Expansion-when-Structure-is-Moved-Outside-Up-1-chromium-linux.png b/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Canvas-Expansion-when-Structure-is-Moved-Outside-Up-1-chromium-linux.png index eaff682a0e..6c04ca4b88 100644 Binary files a/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Canvas-Expansion-when-Structure-is-Moved-Outside-Up-1-chromium-linux.png and b/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Canvas-Expansion-when-Structure-is-Moved-Outside-Up-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Hovering-of-selected-Atom-1-chromium-linux.png b/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Hovering-of-selected-Atom-1-chromium-linux.png index a5d0e175e9..eb5b24d1b2 100644 Binary files a/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Hovering-of-selected-Atom-1-chromium-linux.png and b/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Hovering-of-selected-Atom-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Hovering-of-selected-Bond-1-chromium-linux.png b/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Hovering-of-selected-Bond-1-chromium-linux.png index 5a7297dc2a..b716fb7733 100644 Binary files a/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Hovering-of-selected-Bond-1-chromium-linux.png and b/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Hovering-of-selected-Bond-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Move-structure-over-the-border-of-the-canvas-1-chromium-linux.png b/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Move-structure-over-the-border-of-the-canvas-1-chromium-linux.png index 8f73382257..4dfaa600f0 100644 Binary files a/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Move-structure-over-the-border-of-the-canvas-1-chromium-linux.png and b/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Move-structure-over-the-border-of-the-canvas-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Selection-for-chain-structure-1-chromium-linux.png b/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Selection-for-chain-structure-1-chromium-linux.png index 609b77d3fd..d5f3369d24 100644 Binary files a/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Selection-for-chain-structure-1-chromium-linux.png and b/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Selection-for-chain-structure-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Selection-for-several-templates-1-chromium-linux.png b/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Selection-for-several-templates-1-chromium-linux.png index ed5f180f2f..051e8b9f9f 100644 Binary files a/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Selection-for-several-templates-1-chromium-linux.png and b/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Selection-for-several-templates-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Selection-is-not-reset-when-using-context-menu-1-chromium-linux.png b/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Selection-is-not-reset-when-using-context-menu-1-chromium-linux.png index b49c6dc7e8..a10ff312c1 100644 Binary files a/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Selection-is-not-reset-when-using-context-menu-1-chromium-linux.png and b/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Selection-is-not-reset-when-using-context-menu-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Selection-tools-is-not-change-when-user-press-ESC-button-1-chromium-linux.png b/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Selection-tools-is-not-change-when-user-press-ESC-button-1-chromium-linux.png index 18a34bea5a..8d0c107db7 100644 Binary files a/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Selection-tools-is-not-change-when-user-press-ESC-button-1-chromium-linux.png and b/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Selection-tools-is-not-change-when-user-press-ESC-button-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Selection-when-hovering-atom-and-bond-2-chromium-linux.png b/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Selection-when-hovering-atom-and-bond-2-chromium-linux.png index cc31844e60..751bbeee77 100644 Binary files a/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Selection-when-hovering-atom-and-bond-2-chromium-linux.png and b/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Selection-when-hovering-atom-and-bond-2-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Using-rounded-rectangles-for-selection-of-bonds-and-atom-labels-1-chromium-linux.png b/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Using-rounded-rectangles-for-selection-of-bonds-and-atom-labels-1-chromium-linux.png index ee0116d87e..fdd1705eda 100644 Binary files a/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Using-rounded-rectangles-for-selection-of-bonds-and-atom-labels-1-chromium-linux.png and b/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Using-rounded-rectangles-for-selection-of-bonds-and-atom-labels-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Verify-flipping-horizontally-with-multiple-disconnected-structures-selected-1-chromium-linux.png b/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Verify-flipping-horizontally-with-multiple-disconnected-structures-selected-1-chromium-linux.png index 820fe34f7b..bd457229a0 100644 Binary files a/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Verify-flipping-horizontally-with-multiple-disconnected-structures-selected-1-chromium-linux.png and b/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Verify-flipping-horizontally-with-multiple-disconnected-structures-selected-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Verify-flipping-vertically-with-multiple-disconnected-structures-selected-1-chromium-linux.png b/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Verify-flipping-vertically-with-multiple-disconnected-structures-selected-1-chromium-linux.png index c80759708f..8c4a1be9ab 100644 Binary files a/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Verify-flipping-vertically-with-multiple-disconnected-structures-selected-1-chromium-linux.png and b/ketcher-autotests/tests/Structure-Creating-&-Editing/Actions-With-Structures/Selection-Tool/selection-tool.spec.ts-snapshots/Selection-tools-Verify-flipping-vertically-with-multiple-disconnected-structures-selected-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/Atom/Atom-Tool/atom-tool.spec.ts-snapshots/Atom-Tool-Manipulation-with-structures-with-di-514e5-List-and-Generic-Group---Move-whole-structure-1-chromium-linux.png b/ketcher-autotests/tests/Structure-Creating-&-Editing/Atom/Atom-Tool/atom-tool.spec.ts-snapshots/Atom-Tool-Manipulation-with-structures-with-di-514e5-List-and-Generic-Group---Move-whole-structure-1-chromium-linux.png index b9ac396507..bb1b909d68 100644 Binary files a/ketcher-autotests/tests/Structure-Creating-&-Editing/Atom/Atom-Tool/atom-tool.spec.ts-snapshots/Atom-Tool-Manipulation-with-structures-with-di-514e5-List-and-Generic-Group---Move-whole-structure-1-chromium-linux.png and b/ketcher-autotests/tests/Structure-Creating-&-Editing/Atom/Atom-Tool/atom-tool.spec.ts-snapshots/Atom-Tool-Manipulation-with-structures-with-di-514e5-List-and-Generic-Group---Move-whole-structure-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/Atom/Atom-Tool/group-generics-buttons-check.spec.ts-snapshots/Generic-nodes-Cyclic-Carbo-atoms-adding-to-the-atom-of-structure-1-chromium-linux.png b/ketcher-autotests/tests/Structure-Creating-&-Editing/Atom/Atom-Tool/group-generics-buttons-check.spec.ts-snapshots/Generic-nodes-Cyclic-Carbo-atoms-adding-to-the-atom-of-structure-1-chromium-linux.png index 11d74aa68b..b2eb71f866 100644 Binary files a/ketcher-autotests/tests/Structure-Creating-&-Editing/Atom/Atom-Tool/group-generics-buttons-check.spec.ts-snapshots/Generic-nodes-Cyclic-Carbo-atoms-adding-to-the-atom-of-structure-1-chromium-linux.png and b/ketcher-autotests/tests/Structure-Creating-&-Editing/Atom/Atom-Tool/group-generics-buttons-check.spec.ts-snapshots/Generic-nodes-Cyclic-Carbo-atoms-adding-to-the-atom-of-structure-1-chromium-linux.png differ diff --git a/packages/ketcher-core/src/application/editor/editor.types.ts b/packages/ketcher-core/src/application/editor/editor.types.ts index 0cd4df8194..b3563a854d 100644 --- a/packages/ketcher-core/src/application/editor/editor.types.ts +++ b/packages/ketcher-core/src/application/editor/editor.types.ts @@ -82,4 +82,5 @@ export interface Editor { macromoleculeConvertionError: string | null | undefined; setMacromoleculeConvertionError: (errorMessage: string) => void; clearMacromoleculeConvertionError: () => void; + serverSettings: object; } diff --git a/packages/ketcher-core/src/application/indigo.ts b/packages/ketcher-core/src/application/indigo.ts index ac1d5865bb..ee0e5ae9ad 100644 --- a/packages/ketcher-core/src/application/indigo.ts +++ b/packages/ketcher-core/src/application/indigo.ts @@ -113,12 +113,15 @@ export class Indigo { }); } - layout(struct: StructOrString): Promise { + layout(struct: StructOrString, options): Promise { return this.#structService - .layout({ - struct: convertStructToString(struct, this.#ketSerializer), - output_format: ChemicalMimeType.KET, - }) + .layout( + { + struct: convertStructToString(struct, this.#ketSerializer), + output_format: ChemicalMimeType.KET, + }, + options, + ) .then((data) => this.#ketSerializer.deserialize(data.struct)); } diff --git a/packages/ketcher-core/src/application/ketcher.ts b/packages/ketcher-core/src/application/ketcher.ts index fa8ffcbbff..945eb13782 100644 --- a/packages/ketcher-core/src/application/ketcher.ts +++ b/packages/ketcher-core/src/application/ketcher.ts @@ -413,7 +413,10 @@ export class Ketcher { } runAsyncAction(async () => { - const struct = await this._indigo.layout(this.#editor.struct()); + const struct = await this._indigo.layout( + this.#editor.struct(), + this.editor.serverSettings, + ); const ketSerializer = new KetSerializer(); this.setMolecule(ketSerializer.serialize(struct)); }, this.eventBus); @@ -479,11 +482,12 @@ export class Ketcher { meta = 'image/png'; options.outputFormat = 'png'; } + const serverSettings = this.editor.serverSettings; - const base64 = await this.structService.generateImageAsBase64( - data, - options, - ); + const base64 = await this.structService.generateImageAsBase64(data, { + ...serverSettings, + ...options, + }); const byteCharacters = atob(base64); const byteNumbers = new Array(byteCharacters.length); for (let i = 0; i < byteCharacters.length; i++) { diff --git a/packages/ketcher-core/src/application/utils.ts b/packages/ketcher-core/src/application/utils.ts index 52f329589b..7133be462c 100644 --- a/packages/ketcher-core/src/application/utils.ts +++ b/packages/ketcher-core/src/application/utils.ts @@ -36,7 +36,9 @@ export function getStructure( drawingEntitiesManager?: DrawingEntitiesManager, selection?: EditorSelection, ): Promise { - const formatter = formatterFactory.create(structureFormat); + const serverSettings = ketcherProvider.getKetcher().editor.serverSettings; + const formatter = formatterFactory.create(structureFormat, serverSettings); + return formatter.getStructureFromStructAsync( struct, drawingEntitiesManager, diff --git a/packages/ketcher-react/src/script/editor/Editor.ts b/packages/ketcher-react/src/script/editor/Editor.ts index 5b80d93988..dd66583557 100644 --- a/packages/ketcher-react/src/script/editor/Editor.ts +++ b/packages/ketcher-react/src/script/editor/Editor.ts @@ -162,10 +162,12 @@ class Editor implements KetcherEditor { updateFloatingTools: Subscription; }; + public serverSettings = {}; + lastEvent: any; macromoleculeConvertionError: string | null | undefined; - constructor(clientArea, options) { + constructor(clientArea, options, serverSettings) { this.render = new Render( clientArea, Object.assign( @@ -186,6 +188,7 @@ class Editor implements KetcherEditor { this.renderAndRecoordinateStruct = this.renderAndRecoordinateStruct.bind(this); this.setOptions = this.setOptions.bind(this); + this.setServerSettings(serverSettings); this.lastCursorPosition = { x: 0, @@ -339,6 +342,10 @@ class Editor implements KetcherEditor { return this.render.options; } + public setServerSettings(serverSettings) { + this.serverSettings = serverSettings; + } + private updateToolAfterOptionsChange(wasViewOnlyEnabled: boolean) { const isViewOnlyEnabled = this.render.options.viewOnlyMode; if ( diff --git a/packages/ketcher-react/src/script/editor/tool/rotate-controller.test.ts b/packages/ketcher-react/src/script/editor/tool/rotate-controller.test.ts index 6d601902f0..8d14f64721 100644 --- a/packages/ketcher-react/src/script/editor/tool/rotate-controller.test.ts +++ b/packages/ketcher-react/src/script/editor/tool/rotate-controller.test.ts @@ -57,7 +57,7 @@ describe('Rotate controller', () => { * 2. click Rotate Tool */ it('hides when active tool is not SelectTool', () => { - const editor = new Editor(document, {}); + const editor = new Editor(document, {}, {}); const NonSelectTool = new RotateTool(editor, undefined); const paper = jest.fn(); const visibleAtoms = [0, 1]; @@ -89,7 +89,7 @@ describe('Rotate controller', () => { * Click `zoom in` or press `Ctrl+=` */ it('rerenders while zooming', () => { - const editor = new Editor(document, {}); + const editor = new Editor(document, {}, {}); editor.rotateController.rerender = jest.fn(); editor.zoom(2); @@ -203,7 +203,7 @@ describe('Rotate controller', () => { * 2. Undo */ it(`cancels rotation without modifying history stack`, () => { - const editor = new Editor(document, {}); + const editor = new Editor(document, {}, {}); editor.render.ctab.molecule.getSelectedVisibleAtoms = () => []; // @ts-ignore editor.rotateController.rotateTool.dragCtx = { diff --git a/packages/ketcher-react/src/script/ui/views/Editor.jsx b/packages/ketcher-react/src/script/ui/views/Editor.jsx index 4918c88eb0..a1ce75fe40 100644 --- a/packages/ketcher-react/src/script/ui/views/Editor.jsx +++ b/packages/ketcher-react/src/script/ui/views/Editor.jsx @@ -35,12 +35,14 @@ const mapDispatchToProps = (dispatch) => { }; }; -const Editor = connect( - (state) => ({ +const Editor = connect((state) => { + const serverSettings = state.options.getServerSettings(); + + return { options: state.options.settings, + serverSettings, indigoVerification: state.requestsStatuses.indigoVerification, - }), - mapDispatchToProps, -)(StructEditor); + }; +}, mapDispatchToProps)(StructEditor); export default Editor; diff --git a/packages/ketcher-react/src/script/ui/views/components/StructEditor/StructEditor.jsx b/packages/ketcher-react/src/script/ui/views/components/StructEditor/StructEditor.jsx index b66985e997..af24060c7b 100644 --- a/packages/ketcher-react/src/script/ui/views/components/StructEditor/StructEditor.jsx +++ b/packages/ketcher-react/src/script/ui/views/components/StructEditor/StructEditor.jsx @@ -41,7 +41,10 @@ function setupEditor(editor, props, oldProps = {}) { } } - if (oldProps.options && options !== oldProps.options) editor.options(options); + if (oldProps.options && options !== oldProps.options) { + editor.options(options); + editor.setServerSettings(props.serverSettings); + } Object.keys(editor.event).forEach((name) => { const eventName = `on${upperFirst(name)}`; @@ -147,9 +150,13 @@ class StructEditor extends Component { } componentDidMount() { - this.editor = new Editor(this.editorRef.current, { - ...this.props.options, - }); + this.editor = new Editor( + this.editorRef.current, + { + ...this.props.options, + }, + { ...this.props.serverSettings }, + ); const ketcher = ketcherProvider.getKetcher(); if (ketcher?.editor.macromoleculeConvertionError) { this.props.onShowMacromoleculesErrorMessage( @@ -287,6 +294,7 @@ class StructEditor extends Component { showAttachmentPoints = true, onUpdateFloatingTools, onShowMacromoleculesErrorMessage, + serverSettings, /* eslint-enable @typescript-eslint/no-unused-vars */ ...props } = this.props;