diff --git a/ketcher-autotests/tests/File-Management/Open-And-Save-Files/Open-File/open-file.spec.ts b/ketcher-autotests/tests/File-Management/Open-And-Save-Files/Open-File/open-file.spec.ts index af0bb8e084..d65eed0b6f 100644 --- a/ketcher-autotests/tests/File-Management/Open-And-Save-Files/Open-File/open-file.spec.ts +++ b/ketcher-autotests/tests/File-Management/Open-And-Save-Files/Open-File/open-file.spec.ts @@ -47,9 +47,9 @@ test.describe('open files with different formats', () => { }); /* two structures should be added on the canvas in the following test -(same as in EPMLSOPKET-1835), however in this test when second structure is added -the first one disappears. Couldn't reproduct manually. -*/ + (same as in EPMLSOPKET-1835), however in this test when second structure is added + the first one disappears. Couldn't reproduct manually. + */ test('Open file - Input .mol, InChi', async ({ page }) => { /** * Test case: EPMLSOPKET-1835 @@ -159,4 +159,15 @@ the first one disappears. Couldn't reproduct manually. await pressButton(page, 'Open as New Project'); }); }); + + test('Open ket file with SMARTS attributes', async ({ page }) => { + /* + Test case: https://github.com/epam/ketcher/issues/3397 + Description: ket file with SMARTS attributes should be open without error + */ + await openFileAndAddToCanvas( + 'KET/benzene-with-smarts-attributes.ket', + page, + ); + }); }); diff --git a/ketcher-autotests/tests/File-Management/Open-And-Save-Files/Open-File/open-file.spec.ts-snapshots/open-files-with-different-formats-Open-ket-file-with-SMARTS-attributes-1-chromium-linux.png b/ketcher-autotests/tests/File-Management/Open-And-Save-Files/Open-File/open-file.spec.ts-snapshots/open-files-with-different-formats-Open-ket-file-with-SMARTS-attributes-1-chromium-linux.png new file mode 100644 index 0000000000..06d7c82948 Binary files /dev/null and b/ketcher-autotests/tests/File-Management/Open-And-Save-Files/Open-File/open-file.spec.ts-snapshots/open-files-with-different-formats-Open-ket-file-with-SMARTS-attributes-1-chromium-linux.png differ 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 7dd8dbefb2..e816c06891 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 @@ -412,4 +412,32 @@ test.describe('Open/Save/Paste files', () => { await getPreviewForSmiles(page, 'Daylight SMILES'); await page.getByText('Warnings').click(); }); + + test('Save *.ket file with atom list and atom properties', async ({ + page, + }) => { + /** + * Test case: https://github.com/epam/ketcher/issues/3387 + * Description: All the atom properties (general and query specific) for atom list should be saved in ket format + */ + await openFileAndAddToCanvas( + 'KET/benzene-with-atom-list-and-all-atom-and-query-attributes.ket', + page, + ); + + const expectedFile = await getKet(page); + await saveToFile( + 'KET/benzene-with-atom-list-and-all-atom-and-query-attributes-to-compare.ket', + expectedFile, + ); + + const { fileExpected: ketFileExpected, file: ketFile } = + await receiveFileComparisonData({ + page, + expectedFileName: + 'tests/test-data/KET/benzene-with-atom-list-and-all-atom-and-query-attributes-to-compare.ket', + }); + + expect(ketFile).toEqual(ketFileExpected); + }); }); diff --git a/ketcher-autotests/tests/File-Management/Open-And-Save-Files/Save-File/save-file.spec.ts-snapshots/Open-Save-Paste-files-Save-ket-file-with-atom-list-and-atom-properties-1-chromium-linux.png b/ketcher-autotests/tests/File-Management/Open-And-Save-Files/Save-File/save-file.spec.ts-snapshots/Open-Save-Paste-files-Save-ket-file-with-atom-list-and-atom-properties-1-chromium-linux.png new file mode 100644 index 0000000000..9a846ead63 Binary files /dev/null and b/ketcher-autotests/tests/File-Management/Open-And-Save-Files/Save-File/save-file.spec.ts-snapshots/Open-Save-Paste-files-Save-ket-file-with-atom-list-and-atom-properties-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/File-Management/SMARTS-Files/smarts-files.spec.ts b/ketcher-autotests/tests/File-Management/SMARTS-Files/smarts-files.spec.ts new file mode 100644 index 0000000000..d202ffdd32 --- /dev/null +++ b/ketcher-autotests/tests/File-Management/SMARTS-Files/smarts-files.spec.ts @@ -0,0 +1,38 @@ +import { test } from '@playwright/test'; +import { + takeEditorScreenshot, + clickInTheMiddleOfTheScreen, + waitForPageInit, + pasteFromClipboardAndAddToCanvas, +} from '@utils'; + +test.describe('Loading SMARTS files', () => { + test.beforeEach(async ({ page }) => { + await waitForPageInit(page); + }); + + test.afterEach(async ({ page }) => { + await takeEditorScreenshot(page); + }); + + test('Loading SMARTS with custom query', async ({ page }) => { + /* + Test case: https://github.com/epam/Indigo/issues/1358 + Description: [!#6,!#7,!#8] should be loaded as custom query without any error + */ + const smartsStringToPaste = '[!#6,!#7,!#8]'; + await pasteFromClipboardAndAddToCanvas(page, smartsStringToPaste, false); + await clickInTheMiddleOfTheScreen(page); + }); + + test('Loading SMARTS with aromatic atom list', async ({ page }) => { + /* + Test case: https://github.com/epam/Indigo/issues/1332 + Description: c1-[#6]=[#6]-[#6]=[#6]-[c,n]=1 should be loaded as benzene with aromatic atom list (carbon and nitrogen) + Screenshot for this test is incorrect since Indigo issue #1332 still occurs when test is running locally + */ + const smartsStringToPaste = 'c1-[#6]=[#6]-[#6]=[#6]-[c,n]=1'; + await pasteFromClipboardAndAddToCanvas(page, smartsStringToPaste, false); + await clickInTheMiddleOfTheScreen(page); + }); +}); diff --git a/ketcher-autotests/tests/File-Management/SMARTS-Files/smarts-files.spec.ts-snapshots/Loading-SMARTS-files-Loading-SMARTS-with-aromatic-atom-list-1-chromium-linux.png b/ketcher-autotests/tests/File-Management/SMARTS-Files/smarts-files.spec.ts-snapshots/Loading-SMARTS-files-Loading-SMARTS-with-aromatic-atom-list-1-chromium-linux.png new file mode 100644 index 0000000000..b86bb40547 Binary files /dev/null and b/ketcher-autotests/tests/File-Management/SMARTS-Files/smarts-files.spec.ts-snapshots/Loading-SMARTS-files-Loading-SMARTS-with-aromatic-atom-list-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/File-Management/SMARTS-Files/smarts-files.spec.ts-snapshots/Loading-SMARTS-files-Loading-SMARTS-with-custom-query-1-chromium-linux.png b/ketcher-autotests/tests/File-Management/SMARTS-Files/smarts-files.spec.ts-snapshots/Loading-SMARTS-files-Loading-SMARTS-with-custom-query-1-chromium-linux.png new file mode 100644 index 0000000000..d150ff23a2 Binary files /dev/null and b/ketcher-autotests/tests/File-Management/SMARTS-Files/smarts-files.spec.ts-snapshots/Loading-SMARTS-files-Loading-SMARTS-with-custom-query-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/Atom/Atom-Properties/atom-properties.spec.ts b/ketcher-autotests/tests/Structure-Creating-&-Editing/Atom/Atom-Properties/atom-properties.spec.ts index 54924b7a22..294be92c0b 100644 --- a/ketcher-autotests/tests/Structure-Creating-&-Editing/Atom/Atom-Properties/atom-properties.spec.ts +++ b/ketcher-autotests/tests/Structure-Creating-&-Editing/Atom/Atom-Properties/atom-properties.spec.ts @@ -386,6 +386,33 @@ test.describe('Atom Properties', () => { await doubleClickOnAtom(page, 'O', 0); }); + test('Dialog - Atom type - List', async ({ page }) => { + /* + Test case: https://github.com/epam/ketcher/issues/3340 + Description: if 'Atom type' is set to 'List' then dialog should change: + - Label and Number should be hided + - new items "List" (input field) and "edit" icon should be added + - "Not list (checkbox)" should be added + */ + await openFileAndAddToCanvas('KET/benzene-ring-with-two-atoms.ket', page); + await doubleClickOnAtom(page, 'C', 0); + await page.locator('label').filter({ hasText: 'Atom Type' }).click(); + await page.getByRole('option', { name: 'List', exact: true }).click(); + }); + + test('Dialog - Atom type - Special', async ({ page }) => { + /* + Test case: https://github.com/epam/ketcher/issues/3340 + Description: if 'Atom type' is set to 'Special' then dialog should change: + - Label and Number should be hidden + - new item "Special" (input field) and "edit" icon should be added + */ + await openFileAndAddToCanvas('KET/benzene-ring-with-two-atoms.ket', page); + await doubleClickOnAtom(page, 'C', 0); + await page.locator('label').filter({ hasText: 'Atom Type' }).click(); + await page.getByRole('option', { name: 'Special', exact: true }).click(); + }); + test('Charge of the Atoms', async ({ page }) => { /* Test case: EPMLSOPKET-1606 @@ -423,6 +450,23 @@ test.describe('Atom Properties', () => { await page.getByLabel('Charge').fill('A'); }); + test('Type in the Charge field number bigger than maximum', async ({ + page, + }) => { + /* + Test case: https://github.com/epam/ketcher/issues/3339 + Description: The range for charge is from -999 to 999 + The 'Charge' field is framed with the red frame. + The 'Error: Invalid charge value' tooltip appears when the cursor over the field. + The 'Apply' button becomes disabled. + */ + await openFileAndAddToCanvas('KET/benzene-ring-with-two-atoms.ket', page); + + await doubleClickOnAtom(page, 'C', 0); + await page.getByTestId('charge-input').fill('9999'); + await page.getByTestId('charge-input').hover(); + }); + test('Save structure with two Charge as *.mol file', async ({ page }) => { /* Test case: EPMLSOPKET-1606 @@ -532,6 +576,19 @@ test.describe('Atom Properties', () => { await page.getByLabel('Isotope').fill('b'); }); + test('Add incorrect negative Isotope in modal', async ({ page }) => { + /* + Test case: https://github.com/epam/ketcher/issues/3339 + Description: The range for 'Isotope' field is from 0 to 999 + Field highlight with red and tooltip appears: Invalid isotope value! + */ + await openFileAndAddToCanvas('KET/chain.ket', page); + + await doubleClickOnAtom(page, 'C', 1); + await page.getByTestId('isotope-input').fill('-88'); + await page.getByTestId('isotope-input').hover(); + }); + test('Save structure with Isotope information as *.mol file', async ({ page, }) => { diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/Atom/Atom-Properties/atom-properties.spec.ts-snapshots/Atom-Properties-Add-incorrect-negative-Isotope-in-modal-1-chromium-linux.png b/ketcher-autotests/tests/Structure-Creating-&-Editing/Atom/Atom-Properties/atom-properties.spec.ts-snapshots/Atom-Properties-Add-incorrect-negative-Isotope-in-modal-1-chromium-linux.png new file mode 100644 index 0000000000..779790c341 Binary files /dev/null and b/ketcher-autotests/tests/Structure-Creating-&-Editing/Atom/Atom-Properties/atom-properties.spec.ts-snapshots/Atom-Properties-Add-incorrect-negative-Isotope-in-modal-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/Atom/Atom-Properties/atom-properties.spec.ts-snapshots/Atom-Properties-Dialog---Atom-type---List-1-chromium-linux.png b/ketcher-autotests/tests/Structure-Creating-&-Editing/Atom/Atom-Properties/atom-properties.spec.ts-snapshots/Atom-Properties-Dialog---Atom-type---List-1-chromium-linux.png new file mode 100644 index 0000000000..5917081e62 Binary files /dev/null and b/ketcher-autotests/tests/Structure-Creating-&-Editing/Atom/Atom-Properties/atom-properties.spec.ts-snapshots/Atom-Properties-Dialog---Atom-type---List-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/Atom/Atom-Properties/atom-properties.spec.ts-snapshots/Atom-Properties-Dialog---Atom-type---Special-1-chromium-linux.png b/ketcher-autotests/tests/Structure-Creating-&-Editing/Atom/Atom-Properties/atom-properties.spec.ts-snapshots/Atom-Properties-Dialog---Atom-type---Special-1-chromium-linux.png new file mode 100644 index 0000000000..e5a4d2c390 Binary files /dev/null and b/ketcher-autotests/tests/Structure-Creating-&-Editing/Atom/Atom-Properties/atom-properties.spec.ts-snapshots/Atom-Properties-Dialog---Atom-type---Special-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/Atom/Atom-Properties/atom-properties.spec.ts-snapshots/Atom-Properties-Type-in-the-Charge-field-number-bigger-than-maximum-1-chromium-linux.png b/ketcher-autotests/tests/Structure-Creating-&-Editing/Atom/Atom-Properties/atom-properties.spec.ts-snapshots/Atom-Properties-Type-in-the-Charge-field-number-bigger-than-maximum-1-chromium-linux.png new file mode 100644 index 0000000000..ae06a886ed Binary files /dev/null and b/ketcher-autotests/tests/Structure-Creating-&-Editing/Atom/Atom-Properties/atom-properties.spec.ts-snapshots/Atom-Properties-Type-in-the-Charge-field-number-bigger-than-maximum-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Bond-attributes/bond-attributes.spec.ts-snapshots/Checking-converting-bond-attributes-to-custom--47250-nverting-Type-Single-down-to-custom-query-1-chromium-linux.png b/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Bond-attributes/bond-attributes.spec.ts-snapshots/Checking-converting-bond-attributes-to-custom--47250-nverting-Type-Single-down-to-custom-query-1-chromium-linux.png new file mode 100644 index 0000000000..c7b413d349 Binary files /dev/null and b/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Bond-attributes/bond-attributes.spec.ts-snapshots/Checking-converting-bond-attributes-to-custom--47250-nverting-Type-Single-down-to-custom-query-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Bond-attributes/bond-attributes.spec.ts-snapshots/Checking-converting-bond-attributes-to-custom--57793-acting-Center-Made-broken-to-custom-query-1-chromium-linux.png b/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Bond-attributes/bond-attributes.spec.ts-snapshots/Checking-converting-bond-attributes-to-custom--57793-acting-Center-Made-broken-to-custom-query-1-chromium-linux.png new file mode 100644 index 0000000000..7ac7410491 Binary files /dev/null and b/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Bond-attributes/bond-attributes.spec.ts-snapshots/Checking-converting-bond-attributes-to-custom--57793-acting-Center-Made-broken-to-custom-query-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Bond-attributes/bond-attributes.spec.ts-snapshots/Checking-converting-bond-attributes-to-custom--a38d7-ting-Center-Order-changes-to-custom-query-1-chromium-linux.png b/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Bond-attributes/bond-attributes.spec.ts-snapshots/Checking-converting-bond-attributes-to-custom--a38d7-ting-Center-Order-changes-to-custom-query-1-chromium-linux.png new file mode 100644 index 0000000000..9bd96a1cf9 Binary files /dev/null and b/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Bond-attributes/bond-attributes.spec.ts-snapshots/Checking-converting-bond-attributes-to-custom--a38d7-ting-Center-Order-changes-to-custom-query-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Bond-attributes/bond-attributes.spec.ts-snapshots/Checking-converting-bond-attributes-to-custom--a55db-nd-Reacting-Center-Center-to-custom-query-1-chromium-linux.png b/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Bond-attributes/bond-attributes.spec.ts-snapshots/Checking-converting-bond-attributes-to-custom--a55db-nd-Reacting-Center-Center-to-custom-query-1-chromium-linux.png new file mode 100644 index 0000000000..b02f82cc61 Binary files /dev/null and b/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Bond-attributes/bond-attributes.spec.ts-snapshots/Checking-converting-bond-attributes-to-custom--a55db-nd-Reacting-Center-Center-to-custom-query-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Bond-attributes/bond-attributes.spec.ts-snapshots/Checking-converting-bond-attributes-to-custom--add85--Ring-and-Type-Double-to-custom-query-1-chromium-linux.png b/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Bond-attributes/bond-attributes.spec.ts-snapshots/Checking-converting-bond-attributes-to-custom--add85--Ring-and-Type-Double-to-custom-query-1-chromium-linux.png new file mode 100644 index 0000000000..c5491b88ad Binary files /dev/null and b/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Bond-attributes/bond-attributes.spec.ts-snapshots/Checking-converting-bond-attributes-to-custom--add85--Ring-and-Type-Double-to-custom-query-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Bond-attributes/bond-attributes.spec.ts-snapshots/Checking-converting-bond-attributes-to-custom--e2561--Chain-and-Type-Triple-to-custom-query-1-chromium-linux.png b/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Bond-attributes/bond-attributes.spec.ts-snapshots/Checking-converting-bond-attributes-to-custom--e2561--Chain-and-Type-Triple-to-custom-query-1-chromium-linux.png new file mode 100644 index 0000000000..797a13de46 Binary files /dev/null and b/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Bond-attributes/bond-attributes.spec.ts-snapshots/Checking-converting-bond-attributes-to-custom--e2561--Chain-and-Type-Triple-to-custom-query-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Reaction-flags-attributes/reaction-flags-attributes.spec.ts b/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Reaction-flags-attributes/reaction-flags-attributes.spec.ts new file mode 100644 index 0000000000..c7ff4d6b84 --- /dev/null +++ b/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Reaction-flags-attributes/reaction-flags-attributes.spec.ts @@ -0,0 +1,90 @@ +import { Page, test } from '@playwright/test'; +import { + BondTypeName, + clickInTheMiddleOfTheScreen, + doubleClickOnAtom, + pressButton, + selectBond, + takeEditorScreenshot, + waitForAtomPropsModal, + waitForPageInit, +} from '@utils'; +import { + checkSmartsValue, + checkSmartsWarnings, + setReactionFlagExactChange, + setReactionFlagInversion, +} from '../utils'; + +const defaultFileFormat = 'MDL Molfile V2000'; +const expectedSmarts = '[#6](-[#6])(-[#6])-[#6]'; + +async function drawStructure(page: Page, numberOfClicks: number) { + await selectBond(BondTypeName.Single, page); + for (let i = 0; i < numberOfClicks; i++) { + await clickInTheMiddleOfTheScreen(page); + } +} + +async function drawStructureAndDoubleClickOnAtom( + page: Page, + numberOfBondsAtStructure: number, + atomType: string, + numberOfAtom: number, +) { + await waitForPageInit(page); + await drawStructure(page, numberOfBondsAtStructure); + await page.keyboard.press('Escape'); + await doubleClickOnAtom(page, atomType, numberOfAtom); + await waitForAtomPropsModal(page); +} + +test.describe('Checking atom properties attributes in SMARTS format', () => { + test.beforeEach(async ({ page }) => { + const numberOfAtom = 0; + const numberOfBondsAtStructure = 3; + await drawStructureAndDoubleClickOnAtom( + page, + numberOfBondsAtStructure, + 'C', + numberOfAtom, + ); + await page.getByTestId('Reaction flags-section').click(); + }); + + test('Setting reaction flag - Inverts', async ({ page }) => { + /** + * Test case: https://github.com/epam/ketcher/issues/3431 + * Description: setting reaction flag - inverts should have no impact on SMARTS output but warning should be displayed + */ + await setReactionFlagInversion(page, 'Inverts'); + await pressButton(page, 'Apply'); + await takeEditorScreenshot(page); + await checkSmartsValue(page, defaultFileFormat, expectedSmarts); + await checkSmartsWarnings(page); + }); + + test('Setting reaction flag - Retains', async ({ page }) => { + /** + * Test case: https://github.com/epam/ketcher/issues/3431 + * Description: setting reaction flag - retains should have no impact on SMARTS output but warning should be displayed + */ + await setReactionFlagInversion(page, 'Retains'); + await pressButton(page, 'Apply'); + await takeEditorScreenshot(page); + await checkSmartsValue(page, defaultFileFormat, expectedSmarts); + await checkSmartsWarnings(page); + }); + + test('Setting reaction flag - Exact change checked', async ({ page }) => { + /** + * Test case: https://github.com/epam/ketcher/issues/3431 + * Description: checking exact change option at reaction flag section should have no impact on SMARTS output but warning should be displayed + */ + await setReactionFlagExactChange(page); + await pressButton(page, 'Apply'); + await takeEditorScreenshot(page); + await checkSmartsValue(page, defaultFileFormat, expectedSmarts); + await checkSmartsWarnings(page); + }); +}); diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Reaction-flags-attributes/reaction-flags-attributes.spec.ts-snapshots/Checking-atom-properties-attributes-in-SMARTS-format-Setting-reaction-flag---Exact-change-checked-1-chromium-linux.png b/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Reaction-flags-attributes/reaction-flags-attributes.spec.ts-snapshots/Checking-atom-properties-attributes-in-SMARTS-format-Setting-reaction-flag---Exact-change-checked-1-chromium-linux.png new file mode 100644 index 0000000000..c02557e76b Binary files /dev/null and b/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Reaction-flags-attributes/reaction-flags-attributes.spec.ts-snapshots/Checking-atom-properties-attributes-in-SMARTS-format-Setting-reaction-flag---Exact-change-checked-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Reaction-flags-attributes/reaction-flags-attributes.spec.ts-snapshots/Checking-atom-properties-attributes-in-SMARTS-format-Setting-reaction-flag---Inverts-1-chromium-linux.png b/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Reaction-flags-attributes/reaction-flags-attributes.spec.ts-snapshots/Checking-atom-properties-attributes-in-SMARTS-format-Setting-reaction-flag---Inverts-1-chromium-linux.png new file mode 100644 index 0000000000..12e92aef7f Binary files /dev/null and b/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Reaction-flags-attributes/reaction-flags-attributes.spec.ts-snapshots/Checking-atom-properties-attributes-in-SMARTS-format-Setting-reaction-flag---Inverts-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Reaction-flags-attributes/reaction-flags-attributes.spec.ts-snapshots/Checking-atom-properties-attributes-in-SMARTS-format-Setting-reaction-flag---Retains-1-chromium-linux.png b/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Reaction-flags-attributes/reaction-flags-attributes.spec.ts-snapshots/Checking-atom-properties-attributes-in-SMARTS-format-Setting-reaction-flag---Retains-1-chromium-linux.png new file mode 100644 index 0000000000..9fd8cfee9d Binary files /dev/null and b/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Reaction-flags-attributes/reaction-flags-attributes.spec.ts-snapshots/Checking-atom-properties-attributes-in-SMARTS-format-Setting-reaction-flag---Retains-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Reaction-queries-attributes/reaction-queries-attributes.spec.ts-snapshots/Checking-pasting-S-Group-as-SMARTS-Checking-SMARTS-with-two-query-groups-1-chromium-linux.png b/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Reaction-queries-attributes/reaction-queries-attributes.spec.ts-snapshots/Checking-pasting-S-Group-as-SMARTS-Checking-SMARTS-with-two-query-groups-1-chromium-linux.png new file mode 100644 index 0000000000..681070050f Binary files /dev/null and b/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Reaction-queries-attributes/reaction-queries-attributes.spec.ts-snapshots/Checking-pasting-S-Group-as-SMARTS-Checking-SMARTS-with-two-query-groups-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Reaction-queries-attributes/reaction-queries-attributes.spec.ts-snapshots/Checking-pasting-S-Group-as-SMARTS-Checking-SMARTS-with-two-query-groups-2-chromium-linux.png b/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Reaction-queries-attributes/reaction-queries-attributes.spec.ts-snapshots/Checking-pasting-S-Group-as-SMARTS-Checking-SMARTS-with-two-query-groups-2-chromium-linux.png new file mode 100644 index 0000000000..7a24d498fc Binary files /dev/null and b/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Reaction-queries-attributes/reaction-queries-attributes.spec.ts-snapshots/Checking-pasting-S-Group-as-SMARTS-Checking-SMARTS-with-two-query-groups-2-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Visual-check/visual-check.spec.ts b/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Visual-check/visual-check.spec.ts new file mode 100644 index 0000000000..ceec922475 --- /dev/null +++ b/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Visual-check/visual-check.spec.ts @@ -0,0 +1,232 @@ +import { Page, test, expect } from '@playwright/test'; +import { + BondTypeName, + clickInTheMiddleOfTheScreen, + doubleClickOnAtom, + getAtomByIndex, + pressButton, + selectBond, + takeEditorScreenshot, + waitForAtomPropsModal, + waitForPageInit, + waitForRender, +} from '@utils'; +import { + setAromaticity, + setChirality, + setConnectivity, + setHCount, + setImplicitHCount, + setRingBondCount, + setRingMembership, + setRingSize, + setSubstitutionCount, + setUnsaturated, + setAtomicMass, + setCharge, + setValence, +} from '../utils'; + +async function setListOfAtoms(page: Page, atomLabels: string[]) { + await selectAtomType(page, 'List'); + await page.getByTestId('General-section').locator('button').click(); + for (const label of atomLabels) { + await page.getByTestId(`${label}-button`).click(); + } + await page.getByRole('button', { name: 'Add', exact: true }).click(); +} + +async function selectAtomType(page: Page, type: string) { + await page.locator('label').filter({ hasText: 'Atom Type' }).click(); + await page.getByRole('option', { name: type, exact: true }).click(); +} + +test.describe('Checking if displaying atom attributes does not broke integrity of the structure', () => { + test.beforeEach(async ({ page }) => { + const numberOfAtom = 3; + await waitForPageInit(page); + await page.getByRole('button', { name: 'Cyclooctane (T)' }).click(); + await clickInTheMiddleOfTheScreen(page); + await page.keyboard.press('Escape'); + await doubleClickOnAtom(page, 'C', numberOfAtom); + await waitForAtomPropsModal(page); + }); + + test('Setting all query specific attributes', async ({ page }) => { + /* + Test case: https://github.com/epam/ketcher/issues/3424 + Description: checking if displaying all query specific attributes near to the lower left atom doesn't broke integrity of the structure + This test is related to current bug: https://github.com/epam/ketcher/issues/3508 + */ + await page.getByTestId('Query specific-section').click(); + await setRingBondCount(page, '2'); + await setHCount(page, '3'); + await setSubstitutionCount(page, '4'); + await setUnsaturated(page); + await setAromaticity(page, 'aliphatic'); + await setImplicitHCount(page, '5'); + await setRingMembership(page, '6'); + await setRingSize(page, '7'); + await setConnectivity(page, '8'); + await setChirality(page, 'clockwise'); + await pressButton(page, 'Apply'); + await takeEditorScreenshot(page); + }); + + test('Setting general atom attributes', async ({ page }) => { + /* + Test case: https://github.com/epam/ketcher/issues/3508 + Description: checking if displaying few general atom attributes near to the lower left atom doesn't broke integrity of the structure + This test is related to current bug: https://github.com/epam/ketcher/issues/3508 + */ + await setCharge(page, '-8'); + await setAtomicMass(page, '35'); + await setValence(page, 'VIII'); + await pressButton(page, 'Apply'); + await takeEditorScreenshot(page); + }); + + test('Setting list of atoms', async ({ page }) => { + /* + Test case: https://github.com/epam/ketcher/issues/3508 + Description: checking if displaying list of atoms near to the lower left atom doesn't broke integrity of the structure + This test is related to current bug: https://github.com/epam/ketcher/issues/3508 + */ + const atomLabels = ['Na', 'K', 'B', 'Er', 'Se']; + await setListOfAtoms(page, atomLabels); + await pressButton(page, 'Apply'); + await takeEditorScreenshot(page); + }); +}); + +test.describe('Checking if preview of attributes is displayed correctly after hover', () => { + test.beforeEach(async ({ page }) => { + const numberOfAtom = 0; + await waitForPageInit(page); + await selectBond(BondTypeName.Single, page); + await clickInTheMiddleOfTheScreen(page); + await page.keyboard.press('Escape'); + await doubleClickOnAtom(page, 'C', numberOfAtom); + }); + + test('Checking preview of general atom and query specific attributes', async ({ + page, + }) => { + /* + Test case: https://github.com/epam/ketcher/issues/3327 + Description: when label has more than 3 characters then it should be truncated and pop-up text box should be shown on mouse hover + */ + const point = await getAtomByIndex(page, { label: 'C' }, 0); + await setValence(page, 'VIII'); + await page.getByTestId('Query specific-section').click(); + await setRingBondCount(page, '3'); + await setRingSize(page, '9'); + await setConnectivity(page, '6'); + await pressButton(page, 'Apply'); + await waitForRender(page, async () => { + await page.mouse.move(point.x, point.y); + }); + await takeEditorScreenshot(page); + }); + + test('Checking preview of list of atoms', async ({ page }) => { + /* + Test case: https://github.com/epam/ketcher/issues/3327 + Description: when label has more than 3 characters then it should be truncated and pop-up text box should be shown on mouse hover + */ + const atomLabels = [ + 'Ca', + 'Pm', + 'Ag', + 'Tc', + 'He', + 'Xe', + 'Li', + 'Ts', + 'Nh', + 'Am', + 'V', + 'Fe', + ]; + const point = await getAtomByIndex(page, { label: 'C' }, 0); + await setListOfAtoms(page, atomLabels); + await pressButton(page, 'Apply'); + await waitForRender(page, async () => { + await page.mouse.move(point.x, point.y); + }); + await takeEditorScreenshot(page); + }); + + test('Checking preview of list of atoms and query specific attributes', async ({ + page, + }) => { + /* + Test case: https://github.com/epam/ketcher/issues/3327 + Description: when label has more than 3 characters then it should be truncated and pop-up text box should be shown on mouse hover + */ + const atomLabels = ['Rb', 'Sm']; + const point = await getAtomByIndex(page, { label: 'C' }, 0); + await setListOfAtoms(page, atomLabels); + await page.getByTestId('Query specific-section').click(); + await setAromaticity(page, 'aromatic'); + await setImplicitHCount(page, '8'); + await setRingMembership(page, '7'); + await setRingSize(page, '6'); + await pressButton(page, 'Apply'); + await waitForRender(page, async () => { + await page.mouse.move(point.x, point.y); + }); + await takeEditorScreenshot(page); + }); + + test('Setting not SMARTS specific and SMARTS specific attribute', async ({ + page, + }) => { + /** + * Test case: https://github.com/epam/ketcher/issues/3459 + * Description: setting not SMARTS specific attribute and taking screenshot to see if it is displayed as before (e.g. rb for ring bond count), + * adding SMARTS specific attribute (connectivity) and taking screenshot to check if all properties in the list are displayed in SMARTS notation + * (now ring bond count should be displayed as x) + */ + let correctLabelIsDisplayed = false; + await page.getByTestId('Query specific-section').click(); + await setRingBondCount(page, '3'); + await pressButton(page, 'Apply'); + correctLabelIsDisplayed = await page.getByText('rb3').isVisible(); + expect(correctLabelIsDisplayed).toBe(true); + await takeEditorScreenshot(page); + + await doubleClickOnAtom(page, 'C', 0); + await waitForAtomPropsModal(page); + await page.getByTestId('Query specific-section').click(); + await setConnectivity(page, '7'); + await pressButton(page, 'Apply'); + await takeEditorScreenshot(page); + }); +}); + +test.describe('Checking if atoms are displayed correctly', () => { + test.beforeEach(async ({ page }) => { + await waitForPageInit(page); + await selectBond(BondTypeName.Single, page); + await clickInTheMiddleOfTheScreen(page); + await page.keyboard.press('Escape'); + }); + + test('Atom replaced with other from periodic table', async ({ page }) => { + /* + Test case: https://github.com/epam/ketcher/issues/3362 + Description: when you replace an atom with the selected one, no additional symbols should appear next to it. + */ + const point = await getAtomByIndex(page, { label: 'C' }, 0); + const pixelsToMoveMouse = 100; + await page.getByTestId('period-table').click(); + await page.getByTestId('Ti-button').click(); + await page.getByRole('button', { name: 'Add', exact: true }).click(); + await waitForRender(page, async () => { + await page.mouse.click(point.x, point.y); + }); + await page.mouse.move(pixelsToMoveMouse, pixelsToMoveMouse); + await takeEditorScreenshot(page); + }); +}); diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Visual-check/visual-check.spec.ts-snapshots/Checking-if-atoms-are-displayed-correctly-Atom-replaced-with-other-from-periodic-table-1-chromium-linux.png b/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Visual-check/visual-check.spec.ts-snapshots/Checking-if-atoms-are-displayed-correctly-Atom-replaced-with-other-from-periodic-table-1-chromium-linux.png new file mode 100644 index 0000000000..dba1f3d6f4 Binary files /dev/null and b/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Visual-check/visual-check.spec.ts-snapshots/Checking-if-atoms-are-displayed-correctly-Atom-replaced-with-other-from-periodic-table-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Visual-check/visual-check.spec.ts-snapshots/Checking-if-displaying-atom-attributes-does-no-0df21-ructure-Setting-all-query-specific-attributes-1-chromium-linux.png b/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Visual-check/visual-check.spec.ts-snapshots/Checking-if-displaying-atom-attributes-does-no-0df21-ructure-Setting-all-query-specific-attributes-1-chromium-linux.png new file mode 100644 index 0000000000..1304677784 Binary files /dev/null and b/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Visual-check/visual-check.spec.ts-snapshots/Checking-if-displaying-atom-attributes-does-no-0df21-ructure-Setting-all-query-specific-attributes-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Visual-check/visual-check.spec.ts-snapshots/Checking-if-displaying-atom-attributes-does-no-3a68e-egrity-of-the-structure-Setting-list-of-atoms-1-chromium-linux.png b/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Visual-check/visual-check.spec.ts-snapshots/Checking-if-displaying-atom-attributes-does-no-3a68e-egrity-of-the-structure-Setting-list-of-atoms-1-chromium-linux.png new file mode 100644 index 0000000000..a394f7f0cb Binary files /dev/null and b/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Visual-check/visual-check.spec.ts-snapshots/Checking-if-displaying-atom-attributes-does-no-3a68e-egrity-of-the-structure-Setting-list-of-atoms-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Visual-check/visual-check.spec.ts-snapshots/Checking-if-displaying-atom-attributes-does-no-67727-the-structure-Setting-general-atom-attributes-1-chromium-linux.png b/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Visual-check/visual-check.spec.ts-snapshots/Checking-if-displaying-atom-attributes-does-no-67727-the-structure-Setting-general-atom-attributes-1-chromium-linux.png new file mode 100644 index 0000000000..ec4d70fdab Binary files /dev/null and b/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Visual-check/visual-check.spec.ts-snapshots/Checking-if-displaying-atom-attributes-does-no-67727-the-structure-Setting-general-atom-attributes-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Visual-check/visual-check.spec.ts-snapshots/Checking-if-preview-of-attributes-is-displayed-0ff4a-SMARTS-specific-and-SMARTS-specific-attribute-1-chromium-linux.png b/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Visual-check/visual-check.spec.ts-snapshots/Checking-if-preview-of-attributes-is-displayed-0ff4a-SMARTS-specific-and-SMARTS-specific-attribute-1-chromium-linux.png new file mode 100644 index 0000000000..8eaa150189 Binary files /dev/null and b/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Visual-check/visual-check.spec.ts-snapshots/Checking-if-preview-of-attributes-is-displayed-0ff4a-SMARTS-specific-and-SMARTS-specific-attribute-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Visual-check/visual-check.spec.ts-snapshots/Checking-if-preview-of-attributes-is-displayed-2ce0e-SMARTS-specific-and-SMARTS-specific-attribute-2-chromium-linux.png b/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Visual-check/visual-check.spec.ts-snapshots/Checking-if-preview-of-attributes-is-displayed-2ce0e-SMARTS-specific-and-SMARTS-specific-attribute-2-chromium-linux.png new file mode 100644 index 0000000000..0f7e9e0f72 Binary files /dev/null and b/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Visual-check/visual-check.spec.ts-snapshots/Checking-if-preview-of-attributes-is-displayed-2ce0e-SMARTS-specific-and-SMARTS-specific-attribute-2-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Visual-check/visual-check.spec.ts-snapshots/Checking-if-preview-of-attributes-is-displayed-65a39-of-general-atom-and-query-specific-attributes-1-chromium-linux.png b/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Visual-check/visual-check.spec.ts-snapshots/Checking-if-preview-of-attributes-is-displayed-65a39-of-general-atom-and-query-specific-attributes-1-chromium-linux.png new file mode 100644 index 0000000000..7fb00c8df6 Binary files /dev/null and b/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Visual-check/visual-check.spec.ts-snapshots/Checking-if-preview-of-attributes-is-displayed-65a39-of-general-atom-and-query-specific-attributes-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Visual-check/visual-check.spec.ts-snapshots/Checking-if-preview-of-attributes-is-displayed-65c7b-after-hover-Checking-preview-of-list-of-atoms-1-chromium-linux.png b/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Visual-check/visual-check.spec.ts-snapshots/Checking-if-preview-of-attributes-is-displayed-65c7b-after-hover-Checking-preview-of-list-of-atoms-1-chromium-linux.png new file mode 100644 index 0000000000..8d4a3b21cd Binary files /dev/null and b/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Visual-check/visual-check.spec.ts-snapshots/Checking-if-preview-of-attributes-is-displayed-65c7b-after-hover-Checking-preview-of-list-of-atoms-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Visual-check/visual-check.spec.ts-snapshots/Checking-if-preview-of-attributes-is-displayed-f50b9-f-list-of-atoms-and-query-specific-attributes-1-chromium-linux.png b/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Visual-check/visual-check.spec.ts-snapshots/Checking-if-preview-of-attributes-is-displayed-f50b9-f-list-of-atoms-and-query-specific-attributes-1-chromium-linux.png new file mode 100644 index 0000000000..70d285095b Binary files /dev/null and b/ketcher-autotests/tests/Structure-Creating-&-Editing/SMARTS-attributes/Visual-check/visual-check.spec.ts-snapshots/Checking-if-preview-of-attributes-is-displayed-f50b9-f-list-of-atoms-and-query-specific-attributes-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/User-Interface/Editing-Tools/Copy-Cut-Paste/copy-cut-paste.spec.ts b/ketcher-autotests/tests/User-Interface/Editing-Tools/Copy-Cut-Paste/copy-cut-paste.spec.ts index 57ce68ffb9..09aaf83fba 100644 --- a/ketcher-autotests/tests/User-Interface/Editing-Tools/Copy-Cut-Paste/copy-cut-paste.spec.ts +++ b/ketcher-autotests/tests/User-Interface/Editing-Tools/Copy-Cut-Paste/copy-cut-paste.spec.ts @@ -26,6 +26,7 @@ import { waitForIndigoToLoad, waitForRender, resetCurrentTool, + pressButton, } from '@utils'; const CANVAS_CLICK_X = 500; @@ -981,4 +982,24 @@ test.describe('Copy/Cut/Paste Actions', () => { await selectTopPanelButton(TopPanelButton.Cut, page); await selectTopPanelButton(TopPanelButton.Paste, page); }); + + test('Paste structure as SMARTS with ctrl+alt+V keyboard shortcut', async ({ + page, + }) => { + /* + Description: + Open 'Paste from clipboard' window to copy SMARTS string. + Use ctrl+alt+V keyboard shortcut to paste string as SMARTS (backend should return "original_format": "SMARTS") + */ + const smartsString = + '[#6]-[#6]-[#6]-[#6]-[!#40!#79!#30]-[#6]-[#6]-[#6]-[#6]'; + await selectTopPanelButton(TopPanelButton.Open, page); + await page.getByText('Paste from clipboard').click(); + await page.getByRole('dialog').getByRole('textbox').fill(smartsString); + await page.keyboard.press('Control+a'); + await page.keyboard.press('Control+c'); + await pressButton(page, 'Cancel'); + await page.keyboard.press('Control+Alt+v'); + await clickInTheMiddleOfTheScreen(page); + }); }); diff --git a/ketcher-autotests/tests/User-Interface/Editing-Tools/Copy-Cut-Paste/copy-cut-paste.spec.ts-snapshots/Copy-Cut-Paste-Actions-Paste-structure-as-SMARTS-with-ctrl-alt-V-keyboard-shortcut-1-chromium-linux.png b/ketcher-autotests/tests/User-Interface/Editing-Tools/Copy-Cut-Paste/copy-cut-paste.spec.ts-snapshots/Copy-Cut-Paste-Actions-Paste-structure-as-SMARTS-with-ctrl-alt-V-keyboard-shortcut-1-chromium-linux.png new file mode 100644 index 0000000000..668ddba4d7 Binary files /dev/null and b/ketcher-autotests/tests/User-Interface/Editing-Tools/Copy-Cut-Paste/copy-cut-paste.spec.ts-snapshots/Copy-Cut-Paste-Actions-Paste-structure-as-SMARTS-with-ctrl-alt-V-keyboard-shortcut-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/test-data/KET/benzene-with-atom-list-and-all-atom-and-query-attributes-to-compare.ket b/ketcher-autotests/tests/test-data/KET/benzene-with-atom-list-and-all-atom-and-query-attributes-to-compare.ket new file mode 100644 index 0000000000..521aa47bf4 --- /dev/null +++ b/ketcher-autotests/tests/test-data/KET/benzene-with-atom-list-and-all-atom-and-query-attributes-to-compare.ket @@ -0,0 +1,128 @@ +{ + "root": { + "nodes": [ + { + "$ref": "mol0" + } + ] + }, + "mol0": { + "type": "molecule", + "atoms": [ + { + "label": "C", + "location": [ + 14.209849152128568, + -7.800074417174608, + 0 + ] + }, + { + "type": "atom-list", + "elements": [ + "K", + "Ca", + "Sc" + ], + "alias": "KCS", + "location": [ + 15.940150847871434, + -7.7995892291772035, + 0 + ], + "charge": 10, + "explicitValence": 3, + "isotope": 50, + "radical": 3, + "ringBondCount": 2, + "substitutionCount": 4, + "unsaturatedAtom": true, + "hCount": 4, + "queryProperties": { + "aromaticity": "aliphatic", + "ringMembership": 6, + "ringSize": 7, + "connectivity": 8, + "chirality": "anticlockwise" + }, + "implicitHCount": 5 + }, + { + "label": "C", + "location": [ + 15.07663750949124, + -7.299966888850188, + 0 + ] + }, + { + "label": "C", + "location": [ + 15.940150847871434, + -8.80053206782215, + 0 + ] + }, + { + "label": "C", + "location": [ + 14.209849152128568, + -8.805020056798138, + 0 + ] + }, + { + "label": "C", + "location": [ + 15.07882085547956, + -9.300033111149814, + 0 + ] + } + ], + "bonds": [ + { + "type": 2, + "atoms": [ + 2, + 0 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 4 + ] + }, + { + "type": 2, + "atoms": [ + 4, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 5, + 3 + ] + }, + { + "type": 2, + "atoms": [ + 3, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 2 + ] + } + ] + } +} \ No newline at end of file diff --git a/ketcher-autotests/tests/test-data/KET/benzene-with-atom-list-and-all-atom-and-query-attributes.ket b/ketcher-autotests/tests/test-data/KET/benzene-with-atom-list-and-all-atom-and-query-attributes.ket new file mode 100644 index 0000000000..1ec15c7d9f --- /dev/null +++ b/ketcher-autotests/tests/test-data/KET/benzene-with-atom-list-and-all-atom-and-query-attributes.ket @@ -0,0 +1,128 @@ +{ + "root": { + "nodes": [ + { + "$ref": "mol0" + } + ] + }, + "mol0": { + "type": "molecule", + "atoms": [ + { + "label": "C", + "location": [ + 10.884849152128567, + -6.400074417174608, + 0 + ] + }, + { + "type": "atom-list", + "elements": [ + "K", + "Ca", + "Sc" + ], + "alias": "KCS", + "location": [ + 12.615150847871433, + -6.399589229177203, + 0 + ], + "charge": 10, + "explicitValence": 3, + "isotope": 50, + "radical": 3, + "ringBondCount": 2, + "substitutionCount": 4, + "unsaturatedAtom": true, + "hCount": 4, + "queryProperties": { + "aromaticity": "aliphatic", + "ringMembership": 6, + "ringSize": 7, + "connectivity": 8, + "chirality": "anticlockwise" + }, + "implicitHCount": 5 + }, + { + "label": "C", + "location": [ + 11.751637509491239, + -5.899966888850187, + 0 + ] + }, + { + "label": "C", + "location": [ + 12.615150847871433, + -7.400532067822148, + 0 + ] + }, + { + "label": "C", + "location": [ + 10.884849152128567, + -7.405020056798137, + 0 + ] + }, + { + "label": "C", + "location": [ + 11.753820855479558, + -7.9000331111498125, + 0 + ] + } + ], + "bonds": [ + { + "type": 2, + "atoms": [ + 2, + 0 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 4 + ] + }, + { + "type": 2, + "atoms": [ + 4, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 5, + 3 + ] + }, + { + "type": 2, + "atoms": [ + 3, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 2 + ] + } + ] + } +} \ No newline at end of file diff --git a/ketcher-autotests/tests/test-data/KET/benzene-with-smarts-attributes.ket b/ketcher-autotests/tests/test-data/KET/benzene-with-smarts-attributes.ket new file mode 100644 index 0000000000..22546857ab --- /dev/null +++ b/ketcher-autotests/tests/test-data/KET/benzene-with-smarts-attributes.ket @@ -0,0 +1,111 @@ +{ + "root": { + "nodes": [ + { + "$ref": "mol0" + } + ] + }, + "mol0": { + "type": "molecule", + "atoms": [ + { + "label": "C", + "location": [ + 8.584849152128568, + -4.200074417174607, + 0 + ] + }, + { + "label": "C", + "location": [ + 10.315150847871434, + -4.199589229177203, + 0 + ] + }, + { + "label": "C", + "location": [ + 9.45163750949124, + -3.6999668888501875, + 0 + ], + "substitutionCount": 8, + "queryProperties": { + "aromaticity": "aromatic", + "connectivity": 3 + } + }, + { + "label": "C", + "location": [ + 10.315150847871434, + -5.200532067822148, + 0 + ] + }, + { + "label": "C", + "location": [ + 8.584849152128568, + -5.205020056798137, + 0 + ] + }, + { + "label": "C", + "location": [ + 9.45382085547956, + -5.700033111149812, + 0 + ] + } + ], + "bonds": [ + { + "type": 2, + "atoms": [ + 2, + 0 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 4 + ] + }, + { + "type": 2, + "atoms": [ + 4, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 5, + 3 + ] + }, + { + "type": 2, + "atoms": [ + 3, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 2 + ] + } + ] + } +} \ No newline at end of file