diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts
index 2c5b8fddcd..3e319c4340 100644
--- a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts
+++ b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts
@@ -1,9 +1,10 @@
/* eslint-disable no-magic-numbers */
import {
+ enterSequence,
turnOnMacromoleculesEditor,
turnOnMicromoleculesEditor,
} from '@utils/macromolecules';
-import { Page, test } from '@playwright/test';
+import { Page, test, expect } from '@playwright/test';
import {
FILE_TEST_DATA,
TopPanelButton,
@@ -31,7 +32,39 @@ import {
FunctionalGroups,
selectSaltsAndSolvents,
SaltsAndSolvents,
+ selectSingleBondTool,
+ drawBenzeneRing,
+ selectSnakeLayoutModeTool,
+ selectEraseTool,
+ clickUndo,
+ clickOnAtom,
+ getKet,
+ saveToFile,
+ receiveFileComparisonData,
+ getMolfile,
+ selectSequenceLayoutModeTool,
+ switchSequenceEnteringType,
+ SequenceType,
+ selectLeftPanelButton,
+ LeftPanelButton,
+ selectDropdownTool,
+ openFileAndAddToCanvasAsNewProject,
+ getSdf,
+ getCdx,
+ openFile,
+ getCdxml,
+ getCml,
+ clickOnFileFormatDropdown,
+ takeTopToolbarScreenshot,
+ setAttachmentPoints,
} from '@utils';
+import {
+ addSuperatomAttachmentPoint,
+ removeSuperatomAttachmentPoint,
+} from '@utils/canvas/atoms/superatomAttachmentPoints';
+import { bondTwoMonomersPointToPoint } from '@utils/macromolecules/polymerBond';
+import { clickOnSequenceSymbol } from '@utils/macromolecules/sequence';
+import { miewApplyButtonIsEnabled } from '@utils/common/loaders/waitForMiewApplyButtonIsEnabled';
const topLeftCorner = {
x: -325,
@@ -106,6 +139,54 @@ async function setAtomAndBondSettings(page: Page) {
await page.getByTestId('OK').click();
}
+async function openCdxFile(page: Page) {
+ await selectTopPanelButton(TopPanelButton.Open, page);
+ await openFile(
+ 'CDX/one-attachment-point-added-in-micro-mode-expected.cdx',
+ page,
+ );
+
+ await selectOptionInDropdown(
+ 'CDX/one-attachment-point-added-in-micro-mode-expected.cdx',
+ page,
+ );
+ await pressButton(page, 'Open as New Project');
+}
+
+async function openCdxmlFile(page: Page) {
+ await selectTopPanelButton(TopPanelButton.Open, page);
+ await openFile(
+ 'CDXML/one-attachment-point-added-in-micro-mode-expected.cdxml',
+ page,
+ );
+
+ await selectOptionInDropdown(
+ 'CDXML/one-attachment-point-added-in-micro-mode-expected.cdxml',
+ page,
+ );
+ await pressButton(page, 'Open as New Project');
+}
+
+enum FileFormat {
+ SVGDocument = 'SVG Document',
+ PNGImage = 'PNG Image',
+}
+
+async function saveFileAsPngOrSvgFormat(page: Page, FileFormat: string) {
+ await selectTopPanelButton(TopPanelButton.Save, page);
+ await clickOnFileFormatDropdown(page);
+ await page.getByRole('option', { name: FileFormat }).click();
+}
+
+async function open3DViewer(page: Page, waitForButtonIsEnabled = true) {
+ await waitForRender(page, async () => {
+ await selectTopPanelButton(TopPanelButton.ThreeD, page);
+ });
+ if (waitForButtonIsEnabled) {
+ await miewApplyButtonIsEnabled(page);
+ }
+}
+
test.describe('Macro-Micro-Switcher', () => {
test.beforeEach(async ({ page }) => {
await waitForPageInit(page);
@@ -807,45 +888,187 @@ test.describe('Macro-Micro-Switcher', () => {
await takeEditorScreenshot(page);
});
- // test('Check that Atom connected to R-Group label by bond used as attachment atom when switch to macro mode', async ({
- // page,
- // }) => {
- // /*
- // Test case: Macro-Micro-Switcher/#4530
- // Description: Atom connected to R-Group label by bond used as attachment atom when switch to macro mode.
- // */
- // // Waiting for test reimplementation after the change of https://github.com/epam/ketcher/issues/4530 requirements
- // test.fail();
- // await openFileAndAddToCanvas(
- // 'KET/atom-connected-to-R-Group-label-by-bond.ket',
- // page,
- // );
- // await takeEditorScreenshot(page);
- // await turnOnMacromoleculesEditor(page);
- // await selectSingleBondTool(page);
- // await page.getByText('F1').locator('..').hover();
- // await takeEditorScreenshot(page);
- // });
- //
- // test('Check If there are more than one attachment atom for same R-Group label', async ({
- // page,
- // }) => {
- // /*
- // Test case: Macro-Micro-Switcher/#4530
- // Description: If there are more than one attachment atom for same R-Group label then attachment point NOT created when switch to macro mode.
- // */
- // // Waiting for test reimplementation after the change of https://github.com/epam/ketcher/issues/4530 requirements
- // test.fail();
- // await openFileAndAddToCanvas(
- // 'KET/more-than-one-attachment-atom-for-R-Group.ket',
- // page,
- // );
- // await takeEditorScreenshot(page);
- // await turnOnMacromoleculesEditor(page);
- // await selectSingleBondTool(page);
- // await page.getByText('F1').locator('..').hover();
- // await takeEditorScreenshot(page);
- // });
+ test('Check that attachment point added in micro mode used as attachment point when switch to macro mode', async ({
+ page,
+ }) => {
+ /*
+ Test case: Macro-Micro-Switcher/#4530
+ Description: Attachment point added in micro mode used as attachment point when switch to macro mode.
+ */
+ await openFileAndAddToCanvas(
+ 'KET/one-attachment-point-added-in-micro-mode.ket',
+ page,
+ );
+ await takeEditorScreenshot(page);
+ await turnOnMacromoleculesEditor(page);
+ await selectSingleBondTool(page);
+ await page.getByText('F1').locator('..').hover();
+ await takeEditorScreenshot(page);
+ });
+
+ test('Ensure that system does not allow create s-group if structure have attachment point', async ({
+ page,
+ }) => {
+ /*
+ Test case: Macro-Micro-Switcher/#4530
+ Description: System does not allow create s-group if structure have attachment point.
+ */
+ await openFileAndAddToCanvas(
+ 'KET/one-attachment-point-added-in-micro-mode.ket',
+ page,
+ );
+ await page.keyboard.press('Control+a');
+ await selectLeftPanelButton(LeftPanelButton.S_Group, page);
+ await takeEditorScreenshot(page);
+ await selectLeftPanelButton(LeftPanelButton.Erase, page);
+ await page.getByText('R1').locator('..').click();
+ await takeEditorScreenshot(page);
+ await page.keyboard.press('Control+a');
+ await selectLeftPanelButton(LeftPanelButton.S_Group, page);
+ await takeEditorScreenshot(page);
+ });
+
+ test('Check that multiple attachment points added in micro mode used as attachment point when switch to macro mode', async ({
+ page,
+ }) => {
+ /*
+ Test case: Macro-Micro-Switcher/#4530
+ Description: Multiple attachment points added in micro mode used as attachment point when switch to macro mode.
+ */
+ await openFileAndAddToCanvas(
+ 'KET/more-than-one-attachment-point.ket',
+ page,
+ );
+ await takeEditorScreenshot(page);
+ await turnOnMacromoleculesEditor(page);
+ await selectSingleBondTool(page);
+ await page.getByText('F1').locator('..').hover();
+ await takeEditorScreenshot(page);
+ });
+
+ test('Verify attachment points can be added/removed via context menu', async ({
+ page,
+ }) => {
+ /*
+ Test case: Macro-Micro-Switcher/#4530
+ Description: Attachment points can be added/removed via context menu.
+ */
+ await drawBenzeneRing(page);
+ await addSuperatomAttachmentPoint(page, 'C', 1);
+ await addSuperatomAttachmentPoint(page, 'C', 2);
+ await addSuperatomAttachmentPoint(page, 'C', 3);
+ await takeEditorScreenshot(page);
+ await removeSuperatomAttachmentPoint(page, 'C', 2);
+ await takeEditorScreenshot(page);
+ await turnOnMacromoleculesEditor(page);
+ await selectSingleBondTool(page);
+ await page.getByText('F1').locator('..').hover();
+ await takeEditorScreenshot(page);
+ });
+
+ test('Ensure that new attachment points are labeled correctly (R1/.../R8) based on the next free attachment point number', async ({
+ page,
+ }) => {
+ /*
+ Test case: Macro-Micro-Switcher/#4530
+ Description: New attachment points are labeled correctly (R1/.../R8) based on the next free attachment point number.
+ */
+ // await openFileAndAddToCanvas('Molfiles-V2000/long-chain.mol', page);
+ await openFileAndAddToCanvas('KET/long-chain.ket', page);
+ await addSuperatomAttachmentPoint(page, 'C', 4);
+ await addSuperatomAttachmentPoint(page, 'C', 6);
+ await addSuperatomAttachmentPoint(page, 'C', 8);
+ await addSuperatomAttachmentPoint(page, 'C', 10);
+ await addSuperatomAttachmentPoint(page, 'C', 12);
+ await addSuperatomAttachmentPoint(page, 'C', 14);
+ await addSuperatomAttachmentPoint(page, 'C', 16);
+ await addSuperatomAttachmentPoint(page, 'C', 17);
+ await takeEditorScreenshot(page);
+ });
+
+ test('Verify that system does not create a new attachment point if all 8 attachment points (R1-R8) already exist in the structure', async ({
+ page,
+ }) => {
+ /*
+ Test case: Macro-Micro-Switcher/#4530
+ Description: System does not create a new attachment point if all 8 attachment points (R1-R8) already exist in the structure.
+ */
+ await openFileAndAddToCanvas(
+ 'KET/chain-with-eight-attachment-points.ket',
+ page,
+ );
+ await clickOnAtom(page, 'C', 9, 'right');
+ await takeEditorScreenshot(page);
+ });
+
+ test('Check that system start to use missed labels if user want to create AP greater that R8 (if it has R1,R3-R8 - attempt to add causes R2 selection)', async ({
+ page,
+ }) => {
+ /*
+ Test case: Macro-Micro-Switcher/#4530
+ Description: System does not create a new attachment point if all 8 attachment points (R1-R8) already exist in the structure.
+ */
+ await openFileAndAddToCanvas(
+ 'KET/chain-with-eight-attachment-points.ket',
+ page,
+ );
+ await selectLeftPanelButton(LeftPanelButton.Erase, page);
+ await page.getByText('R2').locator('..').click();
+ await addSuperatomAttachmentPoint(page, 'C', 2);
+ await takeEditorScreenshot(page);
+ });
+
+ test('Check that in context menu for AP - only Delete avaliable', async ({
+ page,
+ }) => {
+ /*
+ Test case: Macro-Micro-Switcher/#4530
+ Description: In context menu for AP - only Delete avaliable.
+ */
+ await openFileAndAddToCanvas(
+ 'KET/structure-with-two-attachment-points.ket',
+ page,
+ );
+ await selectLeftPanelButton(LeftPanelButton.Erase, page);
+ await page.getByText('R2').locator('..').click({ button: 'right' });
+ await takeEditorScreenshot(page);
+ });
+
+ test('Check that AP label selection works but not saves to KET', async ({
+ page,
+ }) => {
+ /*
+ Test case: Macro-Micro-Switcher/#4530
+ Description: AP label selection works but not saves to KET.
+ */
+ await openFileAndAddToCanvas(
+ 'KET/structure-with-two-attachment-points.ket',
+ page,
+ );
+ await page.keyboard.down('Shift');
+ await page.getByText('R1').locator('..').click();
+ await page.getByText('R2').locator('..').click();
+ await page.keyboard.up('Shift');
+ const expectedFile = await getKet(page);
+ await saveToFile(
+ 'KET/structure-with-two-attachment-points-expected.ket',
+ expectedFile,
+ );
+
+ const { fileExpected: ketFileExpected, file: ketFile } =
+ await receiveFileComparisonData({
+ page,
+ expectedFileName:
+ 'tests/test-data/KET/structure-with-two-attachment-points-expected.ket',
+ });
+
+ expect(ketFile).toEqual(ketFileExpected);
+ await openFileAndAddToCanvasAsNewProject(
+ 'KET/structure-with-two-attachment-points-expected.ket',
+ page,
+ );
+ await takeEditorScreenshot(page);
+ });
test('Make sure that micro structure Ring when moving in macro mode then switching to micro mode is correctly displayed in place where it was moved in macro mode', async ({
page,
@@ -939,430 +1162,1174 @@ test.describe('Macro-Micro-Switcher', () => {
await takeEditorScreenshot(page);
});
- // const testData = [
- // {
- // description: 'Sugar',
- // monomer: '25R',
- // monomerTestId: '25R___2,5-Ribose',
- // summaryTestId: 'summary-Sugars',
- // bondEndpoints: { first: 'R1', second: 'R2' },
- // },
- // {
- // description: 'Base',
- // monomer: 'meA',
- // monomerTestId: 'meA___N-Methyl-Adenine',
- // summaryTestId: 'summary-Bases',
- // bondEndpoints: { first: 'R1', second: 'R1' },
- // },
- // {
- // description: 'Phosphate',
- // monomer: 'nasP',
- // monomerTestId: 'nasP___Sodium Phosporothioate',
- // summaryTestId: 'summary-Phosphates',
- // bondEndpoints: { first: 'R1', second: 'R2' },
- // },
- // ];
-
- // for (const data of testData) {
- // test(`Connect micro structure with attachment point to ${data.description} in macro mode`, async ({
- // page,
- // }) => {
- // /*
- // Test case: Macro-Micro-Switcher/#4530
- // Description:
- // */
- // // Waiting for test reimplementation after the change of https://github.com/epam/ketcher/issues/4530 requirements
- // test.fail();
- // const x = 750;
- // const y = 370;
- // const firstMonomer = await page.getByText('F1').locator('..');
- // const secondMonomer = await page
- // .getByText(data.monomer)
- // .locator('..')
- // .first();
- // await openFileAndAddToCanvas(
- // 'KET/atom-connected-to-R-Group-label-by-bond.ket',
- // page,
- // );
- // await turnOnMacromoleculesEditor(page);
- // await page.getByTestId('RNA-TAB').click();
- // await page.getByTestId(data.summaryTestId).click();
- // await page.getByTestId(data.monomerTestId).click();
- // await page.mouse.click(x, y);
- // await bondTwoMonomersPointToPoint(
- // page,
- // firstMonomer,
- // secondMonomer,
- // data.bondEndpoints.first,
- // data.bondEndpoints.second,
- // );
- // const bondLine = page.locator('g[pointer-events="stroke"]').first();
- // await bondLine.hover();
- // await takeEditorScreenshot(page);
- // });
- // }
- //
- // test('Connect micro structure with attachment point to CHEM in macro mode', async ({
- // page,
- // }) => {
- // /*
- // Test case: Macro-Micro-Switcher/#4530
- // Description: CHEM connected with micro structure.
- // */
- // // Waiting for test reimplementation after the change of https://github.com/epam/ketcher/issues/4530 requirements
- // test.fail();
- // const x = 750;
- // const y = 370;
- // const firstMonomer = await page.getByText('F1').locator('..');
- // const secondMonomer = await page
- // .getByText('Test-6-Ch')
- // .locator('..')
- // .first();
- // await openFileAndAddToCanvas(
- // 'KET/atom-connected-to-R-Group-label-by-bond.ket',
- // page,
- // );
- // await turnOnMacromoleculesEditor(page);
- // await page.getByTestId('CHEM-TAB').click();
- // await page.getByTestId('Test-6-Ch___Test-6-AP-Chem').click();
- // await page.mouse.click(x, y);
- // await bondTwoMonomersPointToPoint(
- // page,
- // firstMonomer,
- // secondMonomer,
- // 'R1',
- // 'R3',
- // );
- // const bondLine = page.locator('g[pointer-events="stroke"]').first();
- // await bondLine.hover();
- // await takeEditorScreenshot(page);
- // });
- //
- // const testData2 = [
- // {
- // description: 'Sugar',
- // monomer: '25R',
- // monomerTestId: '25R___2,5-Ribose',
- // summaryTestId: 'summary-Sugars',
- // bondEndpoints: { first: 'R1', second: 'R2' },
- // },
- // {
- // description: 'Base',
- // monomer: 'meA',
- // monomerTestId: 'meA___N-Methyl-Adenine',
- // summaryTestId: 'summary-Bases',
- // bondEndpoints: { first: 'R1', second: 'R1' },
- // },
- // {
- // description: 'Phosphate',
- // monomer: 'moen',
- // monomerTestId: 'moen___2-Methoxyethylamino',
- // summaryTestId: 'summary-Phosphates',
- // bondEndpoints: { first: 'R1', second: 'R2' },
- // },
- // ];
- //
- // for (const data of testData2) {
- // test(`Connect micro structure with attachment point to ${data.description} in macro mode(snake mode)`, async ({
- // page,
- // }) => {
- // /*
- // Test case: Macro-Micro-Switcher/#4530
- // Description:
- // */
- // // Waiting for test reimplementation after the change of https://github.com/epam/ketcher/issues/4530 requirements
- // test.fail();
- // const x = 750;
- // const y = 370;
- // const firstMonomer = await page.getByText('F1').locator('..');
- // const secondMonomer = await page
- // .getByText(data.monomer)
- // .locator('..')
- // .first();
- // await openFileAndAddToCanvas(
- // 'KET/atom-connected-to-R-Group-label-by-bond.ket',
- // page,
- // );
- // await turnOnMacromoleculesEditor(page);
- // await selectSnakeLayoutModeTool(page);
- // await page.getByTestId('RNA-TAB').click();
- // await page.getByTestId(data.summaryTestId).click();
- // await page.getByTestId(data.monomerTestId).click();
- // await page.mouse.click(x, y);
- // await bondTwoMonomersPointToPoint(
- // page,
- // firstMonomer,
- // secondMonomer,
- // data.bondEndpoints.first,
- // data.bondEndpoints.second,
- // );
- // const bondLine = page.locator('g[pointer-events="stroke"]').first();
- // await bondLine.hover();
- // await takeEditorScreenshot(page);
- // });
- // }
- //
- // test('Connect micro structure with attachment point to CHEM in macro mode(snake mode)', async ({
- // page,
- // }) => {
- // /*
- // Test case: Macro-Micro-Switcher/#4530
- // Description: CHEM connected with micro structure.
- // */
- // // Waiting for test reimplementation after the change of https://github.com/epam/ketcher/issues/4530 requirements
- // test.fail();
- // const x = 750;
- // const y = 370;
- // const firstMonomer = await page.getByText('F1').locator('..');
- // const secondMonomer = await page
- // .getByText('Test-6-Ch')
- // .locator('..')
- // .first();
- // await openFileAndAddToCanvas(
- // 'KET/atom-connected-to-R-Group-label-by-bond.ket',
- // page,
- // );
- // await turnOnMacromoleculesEditor(page);
- // await selectSnakeLayoutModeTool(page);
- // await page.getByTestId('CHEM-TAB').click();
- // await page.getByTestId('Test-6-Ch___Test-6-AP-Chem').click();
- // await page.mouse.click(x, y);
- // await bondTwoMonomersPointToPoint(
- // page,
- // firstMonomer,
- // secondMonomer,
- // 'R1',
- // 'R3',
- // );
- // const bondLine = page.locator('g[pointer-events="stroke"]').first();
- // await bondLine.hover();
- // await takeEditorScreenshot(page);
- // });
- //
- // const testData3 = [
- // {
- // description: 'Sugar',
- // monomer: '25R',
- // monomerTestId: '25R___2,5-Ribose',
- // summaryTestId: 'summary-Sugars',
- // bondEndpoints: { first: 'R1', second: 'R2' },
- // },
- // {
- // description: 'Base',
- // monomer: 'meA',
- // monomerTestId: 'meA___N-Methyl-Adenine',
- // summaryTestId: 'summary-Bases',
- // bondEndpoints: { first: 'R1', second: 'R1' },
- // },
- // {
- // description: 'Phosphate',
- // monomer: 'nasP',
- // monomerTestId: 'nasP___Sodium Phosporothioate',
- // summaryTestId: 'summary-Phosphates',
- // bondEndpoints: { first: 'R1', second: 'R2' },
- // },
- // ];
- //
- // for (const data of testData3) {
- // test(`Delete bond between micro structure with attachment point and ${data.description} in macro mode and Undo deletion`, async ({
- // page,
- // }) => {
- // /*
- // Test case: Macro-Micro-Switcher/#4530
- // Description:
- // */
- // // Waiting for test reimplementation after the change of https://github.com/epam/ketcher/issues/4530 requirements
- // test.fail();
- // const x = 750;
- // const y = 370;
- // const firstMonomer = await page.getByText('F1').locator('..');
- // const secondMonomer = await page
- // .getByText(data.monomer)
- // .locator('..')
- // .first();
- // await openFileAndAddToCanvas(
- // 'KET/atom-connected-to-R-Group-label-by-bond.ket',
- // page,
- // );
- // await turnOnMacromoleculesEditor(page);
- // await page.getByTestId('RNA-TAB').click();
- // await page.getByTestId(data.summaryTestId).click();
- // await page.getByTestId(data.monomerTestId).click();
- // await page.mouse.click(x, y);
- // await bondTwoMonomersPointToPoint(
- // page,
- // firstMonomer,
- // secondMonomer,
- // data.bondEndpoints.first,
- // data.bondEndpoints.second,
- // );
- // await selectEraseTool(page);
- // const bondLine = page.locator('g[pointer-events="stroke"]').first();
- // await bondLine.click();
- // await takeEditorScreenshot(page);
- // await clickUndo(page);
- // await takeEditorScreenshot(page);
- // });
- // }
- //
- // test('Delete bond between micro structure with attachment point and CHEM in macro mode and Undo deletion', async ({
- // page,
- // }) => {
- // /*
- // Test case: Macro-Micro-Switcher/#4530
- // Description: CHEM connected with micro structure.
- // */
- // // Waiting for test reimplementation after the change of https://github.com/epam/ketcher/issues/4530 requirements
- // test.fail();
- // const x = 750;
- // const y = 370;
- // const firstMonomer = await page.getByText('F1').locator('..');
- // const secondMonomer = await page
- // .getByText('Test-6-Ch')
- // .locator('..')
- // .first();
- // await openFileAndAddToCanvas(
- // 'KET/atom-connected-to-R-Group-label-by-bond.ket',
- // page,
- // );
- // await turnOnMacromoleculesEditor(page);
- // await page.getByTestId('CHEM-TAB').click();
- // await page.getByTestId('Test-6-Ch___Test-6-AP-Chem').click();
- // await page.mouse.click(x, y);
- // await bondTwoMonomersPointToPoint(
- // page,
- // firstMonomer,
- // secondMonomer,
- // 'R1',
- // 'R3',
- // );
- // await selectEraseTool(page);
- // const bondLine = page.locator('g[pointer-events="stroke"]').first();
- // await bondLine.click();
- // await takeEditorScreenshot(page);
- // await clickUndo(page);
- // await takeEditorScreenshot(page);
- // });
- //
- // const testData4 = [
- // {
- // description: 'Sugar',
- // monomer: '25R',
- // monomerTestId: '25R___2,5-Ribose',
- // summaryTestId: 'summary-Sugars',
- // bondEndpoints: { first: 'R1', second: 'R2' },
- // },
- // {
- // description: 'Base',
- // monomer: 'meA',
- // monomerTestId: 'meA___N-Methyl-Adenine',
- // summaryTestId: 'summary-Bases',
- // bondEndpoints: { first: 'R1', second: 'R1' },
- // },
- // {
- // description: 'Phosphate',
- // monomer: 'nasP',
- // monomerTestId: 'nasP___Sodium Phosporothioate',
- // summaryTestId: 'summary-Phosphates',
- // bondEndpoints: { first: 'R1', second: 'R2' },
- // },
- // ];
- //
- // for (const data of testData4) {
- // test(`Delete macro structure ${data.description} in micro mode and Undo deletion`, async ({
- // page,
- // }) => {
- // /*
- // Test case: Macro-Micro-Switcher/#4530
- // Description: The test does not work properly because the connection of
- // monomers with microstructures is not implemented https://github.com/epam/ketcher/issues/4532
- // After removing the macro structure and then pressing Undo, the micro and macro structures are disconnected
- // */
- // const x = 750;
- // const y = 370;
- // const firstMonomer = await page.getByText('F1').locator('..');
- // const secondMonomer = await page
- // .getByText(data.monomer)
- // .locator('..')
- // .first();
- // await openFileAndAddToCanvas(
- // 'KET/atom-connected-to-R-Group-label-by-bond.ket',
- // page,
- // );
- // await turnOnMacromoleculesEditor(page);
- // await page.getByTestId('RNA-TAB').click();
- // await page.getByTestId(data.summaryTestId).click();
- // await page.getByTestId(data.monomerTestId).click();
- // await page.mouse.click(x, y);
- // await bondTwoMonomersPointToPoint(
- // page,
- // firstMonomer,
- // secondMonomer,
- // data.bondEndpoints.first,
- // data.bondEndpoints.second,
- // );
- // await turnOnMicromoleculesEditor(page);
- // await selectEraseTool(page);
- // await page.getByText(data.monomer).locator('..').click();
- // await takeEditorScreenshot(page);
- // await selectTopPanelButton(TopPanelButton.Undo, page);
- // await takeEditorScreenshot(page);
- // });
- // }
-
- // test('Delete bond between micro structure with attachment point and CHEM in micro mode and Undo deletion', async ({
- // page,
- // }) => {
- // /*
- // Test case: Macro-Micro-Switcher/#4530
- // Description: The test does not work properly because the connection of
- // monomers with microstructures is not implemented https://github.com/epam/ketcher/issues/4532
- // After removing the macro structure and then pressing Undo, the micro and macro structures are disconnected
- // */
- // // Waiting for test reimplementation after the change of https://github.com/epam/ketcher/issues/4530 requirements
- // test.fail();
- // const x = 750;
- // const y = 370;
- // const firstMonomer = await page.getByText('F1').locator('..');
- // const secondMonomer = await page
- // .getByText('Test-6-Ch')
- // .locator('..')
- // .first();
- // await openFileAndAddToCanvas(
- // 'KET/atom-connected-to-R-Group-label-by-bond.ket',
- // page,
- // );
- // await turnOnMacromoleculesEditor(page);
- // await page.getByTestId('CHEM-TAB').click();
- // await page.getByTestId('Test-6-Ch___Test-6-AP-Chem').click();
- // await page.mouse.click(x, y);
- // await bondTwoMonomersPointToPoint(
- // page,
- // firstMonomer,
- // secondMonomer,
- // 'R1',
- // 'R3',
- // );
- // await turnOnMicromoleculesEditor(page);
- // await selectEraseTool(page);
- // await page.getByText('Test-6-Ch').locator('..').click();
- // await takeEditorScreenshot(page);
- // await selectTopPanelButton(TopPanelButton.Undo, page);
- // await takeEditorScreenshot(page);
- // });
+ const testData = [
+ {
+ description: 'Sugar',
+ monomer: '25R',
+ monomerTestId: '25R___2,5-Ribose',
+ summaryTestId: 'summary-Sugars',
+ bondEndpoints: { first: 'R1', second: 'R2' },
+ },
+ {
+ description: 'Base',
+ monomer: 'meA',
+ monomerTestId: 'meA___N-Methyl-Adenine',
+ summaryTestId: 'summary-Bases',
+ bondEndpoints: { first: 'R1', second: 'R1' },
+ },
+ {
+ description: 'Phosphate',
+ monomer: 'nasP',
+ monomerTestId: 'nasP___Sodium Phosporothioate',
+ summaryTestId: 'summary-Phosphates',
+ bondEndpoints: { first: 'R1', second: 'R2' },
+ },
+ ];
+
+ for (const data of testData) {
+ test(`Connect micro structure with attachment point to ${data.description} in macro mode`, async ({
+ page,
+ }) => {
+ /*
+ Test case: Macro-Micro-Switcher/#4530
+ Description:
+ */
+ const x = 750;
+ const y = 370;
+ const firstMonomer = await page.getByText('F1').locator('..');
+ const secondMonomer = await page
+ .getByText(data.monomer)
+ .locator('..')
+ .first();
+ await openFileAndAddToCanvas(
+ 'KET/one-attachment-point-added-in-micro-mode.ket',
+ page,
+ );
+ await turnOnMacromoleculesEditor(page);
+ await page.getByTestId('RNA-TAB').click();
+ await page.getByTestId(data.summaryTestId).click();
+ await page.getByTestId(data.monomerTestId).click();
+ await page.mouse.click(x, y);
+ await bondTwoMonomersPointToPoint(
+ page,
+ firstMonomer,
+ secondMonomer,
+ data.bondEndpoints.first,
+ data.bondEndpoints.second,
+ );
+ const bondLine = page.locator('g[pointer-events="stroke"]').first();
+ await bondLine.hover();
+ await takeEditorScreenshot(page);
+ });
+ }
+
+ test('Connect micro structure with attachment point to CHEM in macro mode', async ({
+ page,
+ }) => {
+ /*
+ Test case: Macro-Micro-Switcher/#4530
+ Description: CHEM connected with micro structure.
+ */
+ const x = 750;
+ const y = 370;
+ const firstMonomer = await page.getByText('F1').locator('..');
+ const secondMonomer = await page
+ .getByText('Test-6-Ch')
+ .locator('..')
+ .first();
+ await openFileAndAddToCanvas(
+ 'KET/one-attachment-point-added-in-micro-mode.ket',
+ page,
+ );
+ await turnOnMacromoleculesEditor(page);
+ await page.getByTestId('CHEM-TAB').click();
+ await page.getByTestId('Test-6-Ch___Test-6-AP-Chem').click();
+ await page.mouse.click(x, y);
+ await bondTwoMonomersPointToPoint(
+ page,
+ firstMonomer,
+ secondMonomer,
+ 'R1',
+ 'R3',
+ );
+ const bondLine = page.locator('g[pointer-events="stroke"]').first();
+ await bondLine.hover();
+ await takeEditorScreenshot(page);
+ });
+
+ const testData2 = [
+ {
+ description: 'Sugar',
+ monomer: '25R',
+ monomerTestId: '25R___2,5-Ribose',
+ summaryTestId: 'summary-Sugars',
+ bondEndpoints: { first: 'R1', second: 'R2' },
+ },
+ {
+ description: 'Base',
+ monomer: 'meA',
+ monomerTestId: 'meA___N-Methyl-Adenine',
+ summaryTestId: 'summary-Bases',
+ bondEndpoints: { first: 'R1', second: 'R1' },
+ },
+ {
+ description: 'Phosphate',
+ monomer: 'moen',
+ monomerTestId: 'moen___2-Methoxyethylamino',
+ summaryTestId: 'summary-Phosphates',
+ bondEndpoints: { first: 'R1', second: 'R2' },
+ },
+ ];
- test('Connect molecule to monomer', async ({ page }) => {
+ for (const data of testData2) {
+ test(`Connect micro structure with attachment point to ${data.description} in macro mode(snake mode)`, async ({
+ page,
+ }) => {
+ /*
+ Test case: Macro-Micro-Switcher/#4530
+ Description:
+ */
+ const x = 750;
+ const y = 370;
+ const firstMonomer = await page.getByText('F1').locator('..');
+ const secondMonomer = await page
+ .getByText(data.monomer)
+ .locator('..')
+ .first();
+ await openFileAndAddToCanvas(
+ 'KET/one-attachment-point-added-in-micro-mode.ket',
+ page,
+ );
+ await turnOnMacromoleculesEditor(page);
+ await selectSnakeLayoutModeTool(page);
+ await page.getByTestId('RNA-TAB').click();
+ await page.getByTestId(data.summaryTestId).click();
+ await page.getByTestId(data.monomerTestId).click();
+ await page.mouse.click(x, y);
+ await bondTwoMonomersPointToPoint(
+ page,
+ firstMonomer,
+ secondMonomer,
+ data.bondEndpoints.first,
+ data.bondEndpoints.second,
+ );
+ const bondLine = page.locator('g[pointer-events="stroke"]').first();
+ await bondLine.hover();
+ await takeEditorScreenshot(page);
+ });
+ }
+
+ test('Connect micro structure with attachment point to CHEM in macro mode(snake mode)', async ({
+ page,
+ }) => {
/*
- Github ticket: https://github.com/epam/ketcher/issues/4532
- Description: Allow connection of molecule with monomer
+ Test case: Macro-Micro-Switcher/#4530
+ Description: CHEM connected with micro structure.
*/
+ const x = 750;
+ const y = 370;
+ const firstMonomer = await page.getByText('F1').locator('..');
+ const secondMonomer = await page
+ .getByText('Test-6-Ch')
+ .locator('..')
+ .first();
+ await openFileAndAddToCanvas(
+ 'KET/one-attachment-point-added-in-micro-mode.ket',
+ page,
+ );
await turnOnMacromoleculesEditor(page);
- await openFileAndAddToCanvasMacro(
- 'KET/molecule-connected-to-monomers.ket',
+ await selectSnakeLayoutModeTool(page);
+ await page.getByTestId('CHEM-TAB').click();
+ await page.getByTestId('Test-6-Ch___Test-6-AP-Chem').click();
+ await page.mouse.click(x, y);
+ await bondTwoMonomersPointToPoint(
page,
+ firstMonomer,
+ secondMonomer,
+ 'R1',
+ 'R3',
);
+ const bondLine = page.locator('g[pointer-events="stroke"]').first();
+ await bondLine.hover();
await takeEditorScreenshot(page);
- await turnOnMicromoleculesEditor(page);
+ });
+
+ const testData3 = [
+ {
+ description: 'Sugar',
+ monomer: '25R',
+ monomerTestId: '25R___2,5-Ribose',
+ summaryTestId: 'summary-Sugars',
+ bondEndpoints: { first: 'R1', second: 'R2' },
+ },
+ {
+ description: 'Base',
+ monomer: 'meA',
+ monomerTestId: 'meA___N-Methyl-Adenine',
+ summaryTestId: 'summary-Bases',
+ bondEndpoints: { first: 'R1', second: 'R1' },
+ },
+ {
+ description: 'Phosphate',
+ monomer: 'nasP',
+ monomerTestId: 'nasP___Sodium Phosporothioate',
+ summaryTestId: 'summary-Phosphates',
+ bondEndpoints: { first: 'R1', second: 'R2' },
+ },
+ ];
+
+ for (const data of testData3) {
+ test(`Delete bond between micro structure with attachment point and ${data.description} in macro mode and Undo deletion`, async ({
+ page,
+ }) => {
+ /*
+ Test case: Macro-Micro-Switcher/#4530
+ Description:
+ */
+ const x = 750;
+ const y = 370;
+ const firstMonomer = await page.getByText('F1').locator('..');
+ const secondMonomer = await page
+ .getByText(data.monomer)
+ .locator('..')
+ .first();
+ await openFileAndAddToCanvas(
+ 'KET/one-attachment-point-added-in-micro-mode.ket',
+ page,
+ );
+ await turnOnMacromoleculesEditor(page);
+ await page.getByTestId('RNA-TAB').click();
+ await page.getByTestId(data.summaryTestId).click();
+ await page.getByTestId(data.monomerTestId).click();
+ await page.mouse.click(x, y);
+ await bondTwoMonomersPointToPoint(
+ page,
+ firstMonomer,
+ secondMonomer,
+ data.bondEndpoints.first,
+ data.bondEndpoints.second,
+ );
+ await selectEraseTool(page);
+ const bondLine = page.locator('g[pointer-events="stroke"]').first();
+ await bondLine.click();
+ await takeEditorScreenshot(page);
+ await clickUndo(page);
+ await takeEditorScreenshot(page);
+ });
+ }
+
+ test('Delete bond between micro structure with attachment point and CHEM in macro mode and Undo deletion', async ({
+ page,
+ }) => {
+ /*
+ Test case: Macro-Micro-Switcher/#4530
+ Description: CHEM connected with micro structure.
+ */
+ const x = 750;
+ const y = 370;
+ const firstMonomer = await page.getByText('F1').locator('..');
+ const secondMonomer = await page
+ .getByText('Test-6-Ch')
+ .locator('..')
+ .first();
+ await openFileAndAddToCanvas(
+ 'KET/one-attachment-point-added-in-micro-mode.ket',
+ page,
+ );
+ await turnOnMacromoleculesEditor(page);
+ await page.getByTestId('CHEM-TAB').click();
+ await page.getByTestId('Test-6-Ch___Test-6-AP-Chem').click();
+ await page.mouse.click(x, y);
+ await bondTwoMonomersPointToPoint(
+ page,
+ firstMonomer,
+ secondMonomer,
+ 'R1',
+ 'R3',
+ );
+ await selectEraseTool(page);
+ const bondLine = page.locator('g[pointer-events="stroke"]').first();
+ await bondLine.click();
+ await takeEditorScreenshot(page);
+ await clickUndo(page);
+ await takeEditorScreenshot(page);
+ });
+
+ const testData4 = [
+ {
+ description: 'Sugar',
+ monomer: '25R',
+ monomerTestId: '25R___2,5-Ribose',
+ summaryTestId: 'summary-Sugars',
+ bondEndpoints: { first: 'R1', second: 'R2' },
+ },
+ {
+ description: 'Base',
+ monomer: 'meA',
+ monomerTestId: 'meA___N-Methyl-Adenine',
+ summaryTestId: 'summary-Bases',
+ bondEndpoints: { first: 'R1', second: 'R1' },
+ },
+ {
+ description: 'Phosphate',
+ monomer: 'nasP',
+ monomerTestId: 'nasP___Sodium Phosporothioate',
+ summaryTestId: 'summary-Phosphates',
+ bondEndpoints: { first: 'R1', second: 'R2' },
+ },
+ ];
+
+ for (const data of testData4) {
+ test.fail(
+ `Delete macro structure ${data.description} in micro mode and Undo deletion`,
+ async ({ page }) => {
+ /*
+ Test case: Macro-Micro-Switcher/#4530
+ Description: The test does not work properly because we have a bug https://github.com/epam/ketcher/issues/4734
+ After fix we need add snapshots and remove test.fail()
+ */
+ const x = 750;
+ const y = 370;
+ const firstMonomer = await page.getByText('F1').locator('..');
+ const secondMonomer = await page
+ .getByText(data.monomer)
+ .locator('..')
+ .first();
+ await openFileAndAddToCanvas(
+ 'KET/one-attachment-point-added-in-micro-mode.ket',
+ page,
+ );
+ await turnOnMacromoleculesEditor(page);
+ await page.getByTestId('RNA-TAB').click();
+ await page.getByTestId(data.summaryTestId).click();
+ await page.getByTestId(data.monomerTestId).click();
+ await page.mouse.click(x, y);
+ await bondTwoMonomersPointToPoint(
+ page,
+ firstMonomer,
+ secondMonomer,
+ data.bondEndpoints.first,
+ data.bondEndpoints.second,
+ );
+ await turnOnMicromoleculesEditor(page);
+ await selectEraseTool(page);
+ await page.getByText(data.monomer).locator('..').click();
+ await takeEditorScreenshot(page);
+ await waitForRender(page, async () => {
+ await selectTopPanelButton(TopPanelButton.Undo, page);
+ });
+ await takeEditorScreenshot(page);
+ },
+ );
+ }
+
+ test('Delete bond between micro structure with attachment point and CHEM in micro mode and Undo deletion', async ({
+ page,
+ }) => {
+ /*
+ Test case: Macro-Micro-Switcher/#4530
+ Description:
+ After removing bond and then pressing Undo, the micro and macro structures are disconnected
+ */
+ const x = 750;
+ const y = 370;
+ const firstMonomer = await page.getByText('F1').locator('..');
+ const secondMonomer = await page
+ .getByText('Test-6-Ch')
+ .locator('..')
+ .first();
+ await openFileAndAddToCanvas(
+ 'KET/one-attachment-point-added-in-micro-mode.ket',
+ page,
+ );
+ await turnOnMacromoleculesEditor(page);
+ await page.getByTestId('CHEM-TAB').click();
+ await page.getByTestId('Test-6-Ch___Test-6-AP-Chem').click();
+ await page.mouse.click(x, y);
+ await bondTwoMonomersPointToPoint(
+ page,
+ firstMonomer,
+ secondMonomer,
+ 'R1',
+ 'R3',
+ );
+ await turnOnMicromoleculesEditor(page);
+ await selectEraseTool(page);
+ await page.mouse.click(690, 350);
+ await takeEditorScreenshot(page);
+ await selectTopPanelButton(TopPanelButton.Undo, page);
+ await takeEditorScreenshot(page);
+ });
+
+ test('Check that it is not possible to change bond type between monomer and micromolecule in micro mode', async ({
+ page,
+ }) => {
+ /*
+ Test case: Macro-Micro-Switcher/#4530
+ Description:
+ it is not possible to change bond type between monomer and micromolecule in micro mode
+ */
+ const x = 750;
+ const y = 370;
+ const firstMonomer = await page.getByText('F1').locator('..');
+ const secondMonomer = await page
+ .getByText('Test-6-Ch')
+ .locator('..')
+ .first();
+ await openFileAndAddToCanvas(
+ 'KET/one-attachment-point-added-in-micro-mode.ket',
+ page,
+ );
+ await turnOnMacromoleculesEditor(page);
+ await page.getByTestId('CHEM-TAB').click();
+ await page.getByTestId('Test-6-Ch___Test-6-AP-Chem').click();
+ await page.mouse.click(x, y);
+ await bondTwoMonomersPointToPoint(
+ page,
+ firstMonomer,
+ secondMonomer,
+ 'R1',
+ 'R3',
+ );
+ await turnOnMicromoleculesEditor(page);
+ await selectDropdownTool(page, 'bonds', 'bond-double');
+ await page.mouse.click(690, 350);
+ await takeEditorScreenshot(page);
+ });
+
+ test('Check that AP label disappear if we delete bond between AP label and atom (stand alone AP label is not possible)', async ({
+ page,
+ }) => {
+ /*
+ Test case: Macro-Micro-Switcher/#4530
+ Description:
+ AP label disappear if we delete bond between AP label and atom (stand alone AP label is not possible)
+ */
+ await openFileAndAddToCanvas('KET/oxygen-on-attachment-point.ket', page);
+ await selectLeftPanelButton(LeftPanelButton.Erase, page);
+ await page.mouse.click(645, 318);
+ await takeEditorScreenshot(page);
+ });
+
+ test('Connect molecule to monomer', async ({ page }) => {
+ /*
+ Github ticket: https://github.com/epam/ketcher/issues/4532
+ Description: Allow connection of molecule with monomer
+ */
+ await turnOnMacromoleculesEditor(page);
+ await openFileAndAddToCanvasMacro(
+ 'KET/molecule-connected-to-monomers.ket',
+ page,
+ );
+ await takeEditorScreenshot(page);
+ await turnOnMicromoleculesEditor(page);
+ await takeEditorScreenshot(page);
+ });
+
+ test('Check it is impossible to create attachment point if atom is a part of s-group', async ({
+ page,
+ }) => {
+ /*
+ Github ticket: #4530
+ Description: It is impossible to create attachment point if atom is a part of s-group
+ */
+ await openFileAndAddToCanvasMacro('KET/part-chain-with-s-group.ket', page);
+ await clickOnAtom(page, 'C', 2, 'right');
+ await takeEditorScreenshot(page);
+ });
+
+ test('Check that attachment points and leaving groups are correctly represented in KET format', async ({
+ page,
+ }) => {
+ /*
+ Test case: #4530
+ Description: Attachment points and leaving groups are correctly represented in KET format.
+ */
+ await openFileAndAddToCanvas(
+ 'KET/one-attachment-point-added-in-micro-mode.ket',
+ page,
+ );
+ const expectedFile = await getKet(page);
+ await saveToFile(
+ 'KET/one-attachment-point-added-in-micro-mode-expected.ket',
+ expectedFile,
+ );
+
+ const { fileExpected: ketFileExpected, file: ketFile } =
+ await receiveFileComparisonData({
+ page,
+ expectedFileName:
+ 'tests/test-data/KET/one-attachment-point-added-in-micro-mode-expected.ket',
+ });
+
+ expect(ketFile).toEqual(ketFileExpected);
+ await openFileAndAddToCanvasAsNewProject(
+ 'KET/one-attachment-point-added-in-micro-mode-expected.ket',
+ page,
+ );
+ await takeEditorScreenshot(page);
+ });
+
+ test('Validate that we can save bond between micro and macro structures to KET', async ({
+ page,
+ }) => {
+ /*
+ Test case: #4530
+ Description: We can save bond between micro and macro structures to KET.
+ */
+ await openFileAndAddToCanvas(
+ 'KET/chem-connected-to-micro-structure.ket',
+ page,
+ );
+ const expectedFile = await getKet(page);
+ await saveToFile(
+ 'KET/chem-connected-to-micro-structure-expected.ket',
+ expectedFile,
+ );
+
+ await receiveFileComparisonData({
+ page,
+ expectedFileName:
+ 'tests/test-data/KET/chem-connected-to-micro-structure-expected.ket',
+ });
+
+ const hasConnectionTypeSingle = expectedFile.includes(
+ '"connectionType": "single"',
+ );
+ expect(hasConnectionTypeSingle).toBe(true);
+ });
+
+ test('Validate that we can save bond between micro and macro structures to Mol V3000 format', async ({
+ page,
+ }) => {
+ /*
+ Test case: #4530
+ Description: We can save bond between micro and macro structures to Mol V3000 format.
+ */
+ await openFileAndAddToCanvas(
+ 'KET/chem-connected-to-micro-structure.ket',
+ page,
+ );
+ const expectedFile = await getMolfile(page, 'v3000');
+ await saveToFile(
+ 'Molfiles-V3000/chem-connected-to-micro-structure-expected.mol',
+ expectedFile,
+ );
+
+ const METADATA_STRINGS_INDEXES = [1];
+
+ const { fileExpected: molFileExpected, file: molFile } =
+ await receiveFileComparisonData({
+ page,
+ expectedFileName:
+ 'tests/test-data/Molfiles-V3000/chem-connected-to-micro-structure-expected.mol',
+ metaDataIndexes: METADATA_STRINGS_INDEXES,
+ fileFormat: 'v3000',
+ });
+
+ expect(molFile).toEqual(molFileExpected);
+ });
+
+ test('Check that attachment points and leaving groups are correctly represented in Mol V3000 format', async ({
+ page,
+ }) => {
+ /*
+ Test case: #4530
+ Description: Attachment points and leaving groups are correctly represented in Mol V3000 format.
+ */
+ await openFileAndAddToCanvas(
+ 'KET/one-attachment-point-added-in-micro-mode.ket',
+ page,
+ );
+ const expectedFile = await getMolfile(page, 'v3000');
+ await saveToFile(
+ 'Molfiles-V3000/one-attachment-point-added-in-micro-mode-expected.mol',
+ expectedFile,
+ );
+
+ const METADATA_STRINGS_INDEXES = [1];
+
+ const { fileExpected: molFileExpected, file: molFile } =
+ await receiveFileComparisonData({
+ page,
+ expectedFileName:
+ 'tests/test-data/Molfiles-V3000/one-attachment-point-added-in-micro-mode-expected.mol',
+ metaDataIndexes: METADATA_STRINGS_INDEXES,
+ fileFormat: 'v3000',
+ });
+
+ expect(molFile).toEqual(molFileExpected);
+ await openFileAndAddToCanvasAsNewProject(
+ 'Molfiles-V3000/one-attachment-point-added-in-micro-mode-expected.mol',
+ page,
+ );
+ await takeEditorScreenshot(page);
+ });
+
+ test('Verify presence and correctness of attachment points (SAP) in the SGROUP segment of MOL V2000 molecular structure files', async ({
+ page,
+ }) => {
+ /*
+ Test case: #4530
+ Description: Attachment points and leaving groups are correctly represented in Mol V2000 format.
+ The structure after opening is not similar to the original one.
+ We have a bug https://github.com/epam/ketcher/issues/4785. After the fix, you need to update the screenshot.
+ */
+ await openFileAndAddToCanvas(
+ 'KET/one-attachment-point-added-in-micro-mode.ket',
+ page,
+ );
+ const expectedFile = await getMolfile(page, 'v2000');
+ await saveToFile(
+ 'Molfiles-V2000/one-attachment-point-added-in-micro-mode-expected.mol',
+ expectedFile,
+ );
+
+ const METADATA_STRINGS_INDEXES = [1];
+
+ const { fileExpected: molFileExpected, file: molFile } =
+ await receiveFileComparisonData({
+ page,
+ expectedFileName:
+ 'tests/test-data/Molfiles-V2000/one-attachment-point-added-in-micro-mode-expected.mol',
+ metaDataIndexes: METADATA_STRINGS_INDEXES,
+ fileFormat: 'v2000',
+ });
+
+ expect(molFile).toEqual(molFileExpected);
+ await openFileAndAddToCanvasAsNewProject(
+ 'Molfiles-V2000/one-attachment-point-added-in-micro-mode-expected.mol',
+ page,
+ );
+ await takeEditorScreenshot(page);
+ });
+
+ test('Verify presence and correctness of attachment points (SAP) in the SGROUP segment of SDF V2000 molecular structure files', async ({
+ page,
+ }) => {
+ /*
+ Test case: #4530
+ Description: Attachment points and leaving groups are correctly represented in SDF V2000 format.
+ */
+ await openFileAndAddToCanvas(
+ 'KET/one-attachment-point-added-in-micro-mode.ket',
+ page,
+ );
+ const expectedFile = await getSdf(page, 'v2000');
+ await saveToFile(
+ 'SDF/one-attachment-point-added-in-micro-modesdfv2000-expected.sdf',
+ expectedFile,
+ );
+
+ const METADATA_STRINGS_INDEXES = [1];
+
+ const { fileExpected: molFileExpected, file: molFile } =
+ await receiveFileComparisonData({
+ page,
+ expectedFileName:
+ 'tests/test-data/SDF/one-attachment-point-added-in-micro-modesdfv2000-expected.sdf',
+ metaDataIndexes: METADATA_STRINGS_INDEXES,
+ fileFormat: 'v2000',
+ });
+
+ expect(molFile).toEqual(molFileExpected);
+ await openFileAndAddToCanvasAsNewProject(
+ 'SDF/one-attachment-point-added-in-micro-modesdfv2000-expected.sdf',
+ page,
+ );
+ await takeEditorScreenshot(page);
+ });
+
+ test('Verify presence and correctness of attachment points (SAP) in the SGROUP segment of SDF V3000 molecular structure files', async ({
+ page,
+ }) => {
+ /*
+ Test case: #4530
+ Description: Attachment points and leaving groups are correctly represented in SDF V3000 format.
+ */
+ await openFileAndAddToCanvas(
+ 'KET/one-attachment-point-added-in-micro-mode.ket',
+ page,
+ );
+ const expectedFile = await getSdf(page, 'v3000');
+ await saveToFile(
+ 'SDF/one-attachment-point-added-in-micro-modesdfv3000-expected.sdf',
+ expectedFile,
+ );
+
+ const METADATA_STRINGS_INDEXES = [1];
+
+ const { fileExpected: molFileExpected, file: molFile } =
+ await receiveFileComparisonData({
+ page,
+ expectedFileName:
+ 'tests/test-data/SDF/one-attachment-point-added-in-micro-modesdfv3000-expected.sdf',
+ metaDataIndexes: METADATA_STRINGS_INDEXES,
+ fileFormat: 'v3000',
+ });
+
+ expect(molFile).toEqual(molFileExpected);
+ await openFileAndAddToCanvasAsNewProject(
+ 'SDF/one-attachment-point-added-in-micro-modesdfv3000-expected.sdf',
+ page,
+ );
+ await takeEditorScreenshot(page);
+ });
+
+ test('Verify presence and correctness of attachment points (SAP) in the SGROUP segment of CDX molecular structure files', async ({
+ page,
+ }) => {
+ /*
+ Test case: #4530
+ Description: Attachment points and leaving groups are correctly represented in CDX format.
+ Saved structure opens like blank canvas because we have bug https://github.com/epam/Indigo/issues/1994
+ After the fix, you need to update test.
+ */
+ await openFileAndAddToCanvas(
+ 'KET/one-attachment-point-added-in-micro-mode.ket',
+ page,
+ );
+ const expectedFile = await getCdx(page);
+ await saveToFile(
+ 'CDX/one-attachment-point-added-in-micro-mode-expected.cdx',
+ expectedFile,
+ );
+
+ const { fileExpected: cdxFileExpected, file: cdxFile } =
+ await receiveFileComparisonData({
+ page,
+ expectedFileName:
+ 'tests/test-data/CDX/one-attachment-point-added-in-micro-mode-expected.cdx',
+ });
+
+ expect(cdxFile).toEqual(cdxFileExpected);
+ await openCdxFile(page);
+ await takeEditorScreenshot(page);
+ });
+
+ test('Verify presence and correctness of attachment points (SAP) in the SGROUP segment of CDXML molecular structure files', async ({
+ page,
+ }) => {
+ /*
+ Test case: #4530
+ Description: Attachment points and leaving groups are correctly represented in CDX format.
+ Saved structure not opens because we have bug https://github.com/epam/Indigo/issues/1993
+ After the fix, you need to update test.
+ */
+ await openFileAndAddToCanvas(
+ 'KET/one-attachment-point-added-in-micro-mode.ket',
+ page,
+ );
+ const expectedFile = await getCdxml(page);
+ await saveToFile(
+ 'CDXML/one-attachment-point-added-in-micro-mode-expected.cdxml',
+ expectedFile,
+ );
+
+ const { fileExpected: cdxmlFileExpected, file: cdxmlFile } =
+ await receiveFileComparisonData({
+ page,
+ expectedFileName:
+ 'tests/test-data/CDXML/one-attachment-point-added-in-micro-mode-expected.cdxml',
+ });
+
+ expect(cdxmlFile).toEqual(cdxmlFileExpected);
+ await openCdxmlFile(page);
+ await takeEditorScreenshot(page);
+ });
+
+ test('Verify presence and correctness of attachment points (atomRefs) in the SuperatomSgroup segment of CML molecular structure files', async ({
+ page,
+ }) => {
+ /*
+ Test case: #4530
+ Description: Attachment points and leaving groups are correctly represented in CDX format.
+ Saved structure opens like blank canvas because we have bug https://github.com/epam/Indigo/issues/1990
+ After the fix, you need to update test.
+ */
+ await openFileAndAddToCanvas(
+ 'KET/one-attachment-point-added-in-micro-mode.ket',
+ page,
+ );
+ const expectedFile = await getCml(page);
+ await saveToFile(
+ 'CML/one-attachment-point-added-in-micro-mode-expected.cml',
+ expectedFile,
+ );
+
+ const { fileExpected: cmlFileExpected, file: cmlFile } =
+ await receiveFileComparisonData({
+ page,
+ expectedFileName:
+ 'tests/test-data/CML/one-attachment-point-added-in-micro-mode-expected.cml',
+ });
+
+ expect(cmlFile).toEqual(cmlFileExpected);
+ await openFileAndAddToCanvasAsNewProject(
+ 'CML/one-attachment-point-added-in-micro-mode-expected.cml',
+ page,
+ );
+ await takeEditorScreenshot(page);
+ });
+
+ test('Check that Undo-Redo invalidation if we change mode from micro to macro and back', async ({
+ page,
+ }) => {
+ /*
+ Test case: #4530
+ Description: Undo-Redo invalidation if we change mode from micro to macro and back.
+ */
+ await openFileAndAddToCanvas(
+ 'KET/one-attachment-point-added-in-micro-mode.ket',
+ page,
+ );
+ await turnOnMacromoleculesEditor(page);
+ await turnOnMicromoleculesEditor(page);
+ await takeTopToolbarScreenshot(page);
+ });
+
+ test('Check saving to SVG Document format', async ({ page }) => {
+ /*
+ Test case: #4530
+ Description: Structure saves in SVG Document format.
+ Test working not in proper way because we have bug https://github.com/epam/Indigo/issues/1991
+ After the fix, you need to update test.
+ */
+ await openFileAndAddToCanvas(
+ 'KET/one-attachment-point-added-in-micro-mode.ket',
+ page,
+ );
+ await saveFileAsPngOrSvgFormat(page, FileFormat.SVGDocument);
+ await takeEditorScreenshot(page);
+ });
+
+ test('Check saving to PNG Image format', async ({ page }) => {
+ /*
+ Test case: #4530
+ Description: Structure saves in PNG Image format.
+ Test working not in proper way because we have bug https://github.com/epam/Indigo/issues/1991
+ After the fix, you need to update test.
+ */
+ await openFileAndAddToCanvas(
+ 'KET/one-attachment-point-added-in-micro-mode.ket',
+ page,
+ );
+ await saveFileAsPngOrSvgFormat(page, FileFormat.PNGImage);
+ await takeEditorScreenshot(page);
+ });
+
+ test('Check that Aromatize/Dearomatize works for molecules with AP', async ({
+ page,
+ }) => {
+ /*
+ Test case: #4530
+ Description: Aromatize/Dearomatize works for molecules with AP.
+ Test working not in proper way because we have bug https://github.com/epam/ketcher/issues/4804
+ After the fix, you need to update test.
+ */
+ await openFileAndAddToCanvas(
+ 'KET/one-attachment-point-added-in-micro-mode.ket',
+ page,
+ );
+ await selectTopPanelButton(TopPanelButton.Aromatize, page);
+ await takeEditorScreenshot(page);
+ await selectTopPanelButton(TopPanelButton.Dearomatize, page);
+ await takeEditorScreenshot(page);
+ });
+
+ test('Check that Layout works for molecules with AP', async ({ page }) => {
+ /*
+ Test case: #4530
+ Description: Layout works for molecules with AP.
+ */
+ await openFileAndAddToCanvas(
+ 'KET/one-attachment-point-added-in-micro-mode.ket',
+ page,
+ );
+ await selectTopPanelButton(TopPanelButton.Layout, page);
+ await takeEditorScreenshot(page);
+ });
+
+ test('Check that Clean Up works for molecules with AP', async ({ page }) => {
+ /*
+ Test case: #4530
+ Description: Clean Up works for molecules with AP.
+ */
+ await openFileAndAddToCanvas('KET/distorted-r1-attachment-point.ket', page);
+ await takeEditorScreenshot(page);
+ await waitForSpinnerFinishedWork(
+ page,
+ async () => await selectTopPanelButton(TopPanelButton.Clean, page),
+ );
+ await takeEditorScreenshot(page, { maxDiffPixelRatio: 0.05 });
+ });
+
+ test('Check that Calculate CIPs works for molecules with AP', async ({
+ page,
+ }) => {
+ /*
+ Test case: #4530
+ Description: Calculate CIPs works for molecules with AP.
+ */
+ await openFileAndAddToCanvas('KET/structure-with-ap-and-stereo.ket', page);
+ await takeEditorScreenshot(page);
+ await waitForSpinnerFinishedWork(
+ page,
+ async () => await selectTopPanelButton(TopPanelButton.Calculate, page),
+ );
+ await takeEditorScreenshot(page);
+ });
+
+ test('Check that Structure Check works for molecules with AP', async ({
+ page,
+ }) => {
+ /*
+ Test case: #4530
+ Description: Structure Check works for molecules with AP.
+ */
+ await openFileAndAddToCanvas(
+ 'KET/one-attachment-point-added-in-micro-mode.ket',
+ page,
+ );
+ await waitForSpinnerFinishedWork(
+ page,
+ async () => await selectTopPanelButton(TopPanelButton.Check, page),
+ );
+ await takeEditorScreenshot(page, {
+ masks: [page.locator('[class*="Check-module_checkInfo"] > span')],
+ });
+ });
+
+ test('Check that Calculate values works for molecules with AP', async ({
+ page,
+ }) => {
+ /*
+ Test case: #4530
+ Description: Calculate values works for molecules with AP.
+ */
+ await openFileAndAddToCanvas(
+ 'KET/one-attachment-point-added-in-micro-mode.ket',
+ page,
+ );
+ await waitForSpinnerFinishedWork(
+ page,
+ async () => await selectTopPanelButton(TopPanelButton.Calculated, page),
+ );
+ await takeEditorScreenshot(page);
+ });
+
+ test('Check that 3D view works for molecules with AP but hydrohen is shown instead of AP', async ({
+ page,
+ }) => {
+ /*
+ Test case: #4530
+ Description: 3D view works for molecules with AP but hydrohen is shown instead of AP.
+ */
+ await openFileAndAddToCanvas(
+ 'KET/one-attachment-point-added-in-micro-mode.ket',
+ page,
+ );
+ await open3DViewer(page);
+ await expect(page).toHaveScreenshot({
+ animations: 'disabled',
+ maxDiffPixelRatio: 0.05,
+ });
+ });
+
+ const testData5 = [
+ { type: 'RNA', sequenceType: null },
+ { type: 'DNA', sequenceType: SequenceType.DNA },
+ { type: 'Peptide', sequenceType: SequenceType.PEPTIDE },
+ ];
+
+ for (const data of testData5) {
+ test(`Add to micro structure with free attachment point ${data.type} in sequence mode and ensure that a connection was formed when switching to flex or snake mode`, async ({
+ page,
+ }) => {
+ /*
+ Github ticket: #4530
+ Description: R2-R1 connection was formed when switching to flex or snake mode
+ */
+ await openFileAndAddToCanvas(
+ 'KET/two-attachment-points-added-in-micro-mode.ket',
+ page,
+ );
+ await turnOnMacromoleculesEditor(page);
+ await selectSequenceLayoutModeTool(page);
+
+ if (data.sequenceType) {
+ await switchSequenceEnteringType(page, data.sequenceType);
+ }
+
+ await clickOnSequenceSymbol(page, '@', { button: 'right' });
+ await page.getByTestId('edit_sequence').click();
+ await enterSequence(page, 'a');
+ await page.keyboard.press('Escape');
+ await selectSnakeLayoutModeTool(page);
+ await selectSingleBondTool(page);
+ await page.getByText('F1').locator('..').hover();
+ await takeEditorScreenshot(page);
+ });
+ }
+
+ const testData6 = [
+ { type: 'RNA', sequenceType: null },
+ { type: 'DNA', sequenceType: SequenceType.DNA },
+ { type: 'Peptide', sequenceType: SequenceType.PEPTIDE },
+ ];
+
+ for (const data of testData6) {
+ test(`Add to micro structure with NO free attachment point ${data.type} in sequence mode and ensure that a connection was NOt formed when switching to snake mode`, async ({
+ page,
+ }) => {
+ /*
+ Github ticket: #4530
+ Description: R2-R1 connection was formed when switching to flex or snake mode
+ */
+ await drawBenzeneRing(page);
+ await turnOnMacromoleculesEditor(page);
+ await selectSequenceLayoutModeTool(page);
+
+ if (data.sequenceType) {
+ await switchSequenceEnteringType(page, data.sequenceType);
+ }
+
+ await clickOnSequenceSymbol(page, '@', { button: 'right' });
+ await page.getByTestId('edit_sequence').click();
+ await enterSequence(page, 'a');
+ await takeEditorScreenshot(page);
+ });
+ }
+
+ test('Check it is NOT possible to attach old AP to new AP label', async ({
+ page,
+ }) => {
+ /*
+ Test case: Macro-Micro-Switcher/#4530
+ Description: It is NOT possible to attach old AP to new AP label.
+ */
+ await openFileAndAddToCanvas(
+ 'KET/one-attachment-point-added-in-micro-mode.ket',
+ page,
+ );
+ await selectDropdownTool(page, 'rgroup-label', 'rgroup-attpoints');
+ await page.getByText('R1').locator('..').click();
+ await takeEditorScreenshot(page);
+ await setAttachmentPoints(
+ page,
+ { label: 'C', index: 2 },
+ { primary: true },
+ 'Apply',
+ );
+ await takeEditorScreenshot(page);
+ });
+
+ test('Check it is possible to wrap AP labed to R-group (by fragment tool)', async ({
+ page,
+ }) => {
+ /*
+ Test case: Macro-Micro-Switcher/#4530
+ Description: It is possible to wrap AP labed to R-group (by fragment tool).
+ */
+ await openFileAndAddToCanvas(
+ 'KET/one-attachment-point-added-in-micro-mode.ket',
+ page,
+ );
+ await selectDropdownTool(page, 'rgroup-label', 'rgroup-fragment');
+ await page.getByText('R1').locator('..').click();
+ await page.getByText('R18').click();
+ await pressButton(page, 'Apply');
+ await takeEditorScreenshot(page);
+ });
+
+ test('Check it is NOT possible to attach R-Group to AP label', async ({
+ page,
+ }) => {
+ /*
+ Test case: Macro-Micro-Switcher/#4530
+ Description: It is NOT possible to attach R-Group to AP label.
+ */
+ await openFileAndAddToCanvas(
+ 'KET/one-attachment-point-added-in-micro-mode.ket',
+ page,
+ );
+ await selectLeftPanelButton(LeftPanelButton.R_GroupLabelTool, page);
+ await page.getByText('R1').locator('..').click();
+ await takeEditorScreenshot(page);
+ await clickOnAtom(page, 'C', 2);
+ await page.getByText('R8').click();
+ await pressButton(page, 'Apply');
+ await takeEditorScreenshot(page);
+ });
+
+ test('Check it is NOT possible to change charge of AP label (select it and use A+/A- buttons)', async ({
+ page,
+ }) => {
+ /*
+ Test case: Macro-Micro-Switcher/#4530
+ Description: It is NOT possible to change charge of AP label (select it and use A+/A- buttons).
+ */
+ await openFileAndAddToCanvas(
+ 'KET/one-attachment-point-added-in-micro-mode.ket',
+ page,
+ );
+ await selectLeftPanelButton(LeftPanelButton.ChargePlus, page);
+ await page.getByText('R1').locator('..').click();
+ await takeEditorScreenshot(page);
+ await clickOnAtom(page, 'C', 2);
+ await takeEditorScreenshot(page);
+ await selectLeftPanelButton(LeftPanelButton.ChargeMinus, page);
+ await page.getByText('R1').locator('..').click();
+ await takeEditorScreenshot(page);
+ await clickOnAtom(page, 'C', 2);
+ await takeEditorScreenshot(page);
+ });
+
+ test('Check it is NOT possible to attach bond to AP label', async ({
+ page,
+ }) => {
+ /*
+ Test case: Macro-Micro-Switcher/#4530
+ Description: It is NOT possible to attach bond to AP label.
+ */
+ await openFileAndAddToCanvas(
+ 'KET/one-attachment-point-added-in-micro-mode.ket',
+ page,
+ );
+ await selectLeftPanelButton(LeftPanelButton.SingleBond, page);
+ await page.getByText('R1').locator('..').click();
+ await takeEditorScreenshot(page);
+ });
+
+ test('Check we can attach AP to single atom', async ({ page }) => {
+ /*
+ Test case: Macro-Micro-Switcher/#4530
+ Description: AP attached to single atom.
+ */
+ await selectAtomInToolbar(AtomButton.Oxygen, page);
+ await clickInTheMiddleOfTheScreen(page);
+ await addSuperatomAttachmentPoint(page, 'O', 0);
+ await takeEditorScreenshot(page);
+ });
+
+ test('Connection one molecule to another one by drugging one over another - result indicate existence of AP label and it remain back after delete connection', async ({
+ page,
+ }) => {
+ /*
+ Test case: Macro-Micro-Switcher/#4530
+ Description: We can connect molecule to attachment point and when delete bond attachment point remains.
+ */
+ await openFileAndAddToCanvas(
+ 'KET/one-attachment-point-with-oxygen.ket',
+ page,
+ );
+ await takeEditorScreenshot(page);
+ await selectLeftPanelButton(LeftPanelButton.Erase, page);
+ await page.getByTestId('canvas').getByText('O').click();
+ await takeEditorScreenshot(page);
+ await turnOnMacromoleculesEditor(page);
+ await selectSingleBondTool(page);
+ await page.getByText('F1').locator('..').hover();
await takeEditorScreenshot(page);
});
});
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Add-to-micro-structure-wi-47af1-s-formed-when-switching-to-flex-or-snake-mode-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Add-to-micro-structure-wi-47af1-s-formed-when-switching-to-flex-or-snake-mode-1-chromium-linux.png
new file mode 100644
index 0000000000..135dc91fc8
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Add-to-micro-structure-wi-47af1-s-formed-when-switching-to-flex-or-snake-mode-1-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Add-to-micro-structure-wi-7ea44-s-formed-when-switching-to-flex-or-snake-mode-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Add-to-micro-structure-wi-7ea44-s-formed-when-switching-to-flex-or-snake-mode-1-chromium-linux.png
new file mode 100644
index 0000000000..2924c0e4f2
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Add-to-micro-structure-wi-7ea44-s-formed-when-switching-to-flex-or-snake-mode-1-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Add-to-micro-structure-wi-ce242-n-was-NOt-formed-when-switching-to-snake-mode-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Add-to-micro-structure-wi-ce242-n-was-NOt-formed-when-switching-to-snake-mode-1-chromium-linux.png
new file mode 100644
index 0000000000..f1f87a2385
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Add-to-micro-structure-wi-ce242-n-was-NOt-formed-when-switching-to-snake-mode-1-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Add-to-micro-structure-wi-d684e-n-was-NOt-formed-when-switching-to-snake-mode-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Add-to-micro-structure-wi-d684e-n-was-NOt-formed-when-switching-to-snake-mode-1-chromium-linux.png
new file mode 100644
index 0000000000..f1f87a2385
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Add-to-micro-structure-wi-d684e-n-was-NOt-formed-when-switching-to-snake-mode-1-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Add-to-micro-structure-wi-d8b6e-n-was-NOt-formed-when-switching-to-snake-mode-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Add-to-micro-structure-wi-d8b6e-n-was-NOt-formed-when-switching-to-snake-mode-1-chromium-linux.png
new file mode 100644
index 0000000000..f1f87a2385
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Add-to-micro-structure-wi-d8b6e-n-was-NOt-formed-when-switching-to-snake-mode-1-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Add-to-micro-structure-wi-d9d88-s-formed-when-switching-to-flex-or-snake-mode-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Add-to-micro-structure-wi-d9d88-s-formed-when-switching-to-flex-or-snake-mode-1-chromium-linux.png
new file mode 100644
index 0000000000..2f491255c3
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Add-to-micro-structure-wi-d9d88-s-formed-when-switching-to-flex-or-snake-mode-1-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-If-there-are-more-than-one-attachment-atom-for-same-R-Group-label-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-If-there-are-more-than-one-attachment-atom-for-same-R-Group-label-1-chromium-linux.png
deleted file mode 100644
index b62cfe4f57..0000000000
Binary files a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-If-there-are-more-than-one-attachment-atom-for-same-R-Group-label-1-chromium-linux.png and /dev/null differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-If-there-are-more-than-one-attachment-atom-for-same-R-Group-label-2-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-If-there-are-more-than-one-attachment-atom-for-same-R-Group-label-2-chromium-linux.png
deleted file mode 100644
index ea52f339fd..0000000000
Binary files a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-If-there-are-more-than-one-attachment-atom-for-same-R-Group-label-2-chromium-linux.png and /dev/null differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-it-is-NOT-possible--2dfeb-of-AP-label-select-it-and-use-A-A--buttons-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-it-is-NOT-possible--2dfeb-of-AP-label-select-it-and-use-A-A--buttons-1-chromium-linux.png
new file mode 100644
index 0000000000..550de451ae
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-it-is-NOT-possible--2dfeb-of-AP-label-select-it-and-use-A-A--buttons-1-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-it-is-NOT-possible--437df-of-AP-label-select-it-and-use-A-A--buttons-2-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-it-is-NOT-possible--437df-of-AP-label-select-it-and-use-A-A--buttons-2-chromium-linux.png
new file mode 100644
index 0000000000..06e8b1b0f2
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-it-is-NOT-possible--437df-of-AP-label-select-it-and-use-A-A--buttons-2-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-it-is-NOT-possible--75593-of-AP-label-select-it-and-use-A-A--buttons-3-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-it-is-NOT-possible--75593-of-AP-label-select-it-and-use-A-A--buttons-3-chromium-linux.png
new file mode 100644
index 0000000000..1531281ec7
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-it-is-NOT-possible--75593-of-AP-label-select-it-and-use-A-A--buttons-3-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-it-is-NOT-possible--b9358-of-AP-label-select-it-and-use-A-A--buttons-4-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-it-is-NOT-possible--b9358-of-AP-label-select-it-and-use-A-A--buttons-4-chromium-linux.png
new file mode 100644
index 0000000000..53e2aa4fe4
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-it-is-NOT-possible--b9358-of-AP-label-select-it-and-use-A-A--buttons-4-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-it-is-NOT-possible-to-attach-R-Group-to-AP-label-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-it-is-NOT-possible-to-attach-R-Group-to-AP-label-1-chromium-linux.png
new file mode 100644
index 0000000000..550de451ae
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-it-is-NOT-possible-to-attach-R-Group-to-AP-label-1-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-it-is-NOT-possible-to-attach-R-Group-to-AP-label-2-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-it-is-NOT-possible-to-attach-R-Group-to-AP-label-2-chromium-linux.png
new file mode 100644
index 0000000000..7d08b56dfa
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-it-is-NOT-possible-to-attach-R-Group-to-AP-label-2-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-it-is-NOT-possible-to-attach-bond-to-AP-label-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-it-is-NOT-possible-to-attach-bond-to-AP-label-1-chromium-linux.png
new file mode 100644
index 0000000000..e7a471eaf6
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-it-is-NOT-possible-to-attach-bond-to-AP-label-1-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-it-is-NOT-possible-to-attach-old-AP-to-new-AP-label-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-it-is-NOT-possible-to-attach-old-AP-to-new-AP-label-1-chromium-linux.png
new file mode 100644
index 0000000000..550de451ae
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-it-is-NOT-possible-to-attach-old-AP-to-new-AP-label-1-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-it-is-NOT-possible-to-attach-old-AP-to-new-AP-label-2-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-it-is-NOT-possible-to-attach-old-AP-to-new-AP-label-2-chromium-linux.png
new file mode 100644
index 0000000000..4bd7e13a24
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-it-is-NOT-possible-to-attach-old-AP-to-new-AP-label-2-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-it-is-NOT-possible-to-wrap-AP-labed-to-R-group-by-fragment-tool-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-it-is-NOT-possible-to-wrap-AP-labed-to-R-group-by-fragment-tool-1-chromium-linux.png
new file mode 100644
index 0000000000..412c2fa758
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-it-is-NOT-possible-to-wrap-AP-labed-to-R-group-by-fragment-tool-1-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-it-is-NOT-possible-to-wrap-AP-labed-to-R-group-by-fragment-tool-2-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-it-is-NOT-possible-to-wrap-AP-labed-to-R-group-by-fragment-tool-2-chromium-linux.png
new file mode 100644
index 0000000000..412c2fa758
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-it-is-NOT-possible-to-wrap-AP-labed-to-R-group-by-fragment-tool-2-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-it-is-impossible-to-bd4b1-attachment-point-if-atom-is-a-part-of-s-group-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-it-is-impossible-to-bd4b1-attachment-point-if-atom-is-a-part-of-s-group-1-chromium-linux.png
new file mode 100644
index 0000000000..2e537b5ed0
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-it-is-impossible-to-bd4b1-attachment-point-if-atom-is-a-part-of-s-group-1-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-it-is-possible-to-wrap-AP-labed-to-R-group-by-fragment-tool-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-it-is-possible-to-wrap-AP-labed-to-R-group-by-fragment-tool-1-chromium-linux.png
new file mode 100644
index 0000000000..68c9e97a16
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-it-is-possible-to-wrap-AP-labed-to-R-group-by-fragment-tool-1-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-saving-to-PNG-Image-format-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-saving-to-PNG-Image-format-1-chromium-linux.png
new file mode 100644
index 0000000000..a8c3c9220a
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-saving-to-PNG-Image-format-1-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-saving-to-SVG-Document-format-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-saving-to-SVG-Document-format-1-chromium-linux.png
new file mode 100644
index 0000000000..f0c39b5e8a
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-saving-to-SVG-Document-format-1-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-3D-view-works--91eb6-s-with-AP-but-hydrohen-is-shown-instead-of-AP-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-3D-view-works--91eb6-s-with-AP-but-hydrohen-is-shown-instead-of-AP-1-chromium-linux.png
new file mode 100644
index 0000000000..04def3cfcc
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-3D-view-works--91eb6-s-with-AP-but-hydrohen-is-shown-instead-of-AP-1-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-AP-label-disap-40d36-d-atom-stand-alone-AP-label-is-not-possible-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-AP-label-disap-40d36-d-atom-stand-alone-AP-label-is-not-possible-1-chromium-linux.png
new file mode 100644
index 0000000000..e1b69698ef
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-AP-label-disap-40d36-d-atom-stand-alone-AP-label-is-not-possible-1-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-AP-label-selection-works-but-not-saves-to-KET-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-AP-label-selection-works-but-not-saves-to-KET-1-chromium-linux.png
new file mode 100644
index 0000000000..396072a6a0
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-AP-label-selection-works-but-not-saves-to-KET-1-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-Aromatize-Dearomatize-works-for-molecules-with-AP-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-Aromatize-Dearomatize-works-for-molecules-with-AP-1-chromium-linux.png
new file mode 100644
index 0000000000..703d414ebf
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-Aromatize-Dearomatize-works-for-molecules-with-AP-1-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-Aromatize-Dearomatize-works-for-molecules-with-AP-2-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-Aromatize-Dearomatize-works-for-molecules-with-AP-2-chromium-linux.png
new file mode 100644
index 0000000000..bea21dc1ce
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-Aromatize-Dearomatize-works-for-molecules-with-AP-2-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-Atom-connected-6acc6--as-attachment-atom-when-switch-to-macro-mode-2-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-Atom-connected-6acc6--as-attachment-atom-when-switch-to-macro-mode-2-chromium-linux.png
deleted file mode 100644
index 00f21d36d5..0000000000
Binary files a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-Atom-connected-6acc6--as-attachment-atom-when-switch-to-macro-mode-2-chromium-linux.png and /dev/null differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-Atom-connected-f6915--as-attachment-atom-when-switch-to-macro-mode-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-Atom-connected-f6915--as-attachment-atom-when-switch-to-macro-mode-1-chromium-linux.png
deleted file mode 100644
index 4861afdfe7..0000000000
Binary files a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-Atom-connected-f6915--as-attachment-atom-when-switch-to-macro-mode-1-chromium-linux.png and /dev/null differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-Calculate-CIPs-works-for-molecules-with-AP-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-Calculate-CIPs-works-for-molecules-with-AP-1-chromium-linux.png
new file mode 100644
index 0000000000..a5b90ac57c
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-Calculate-CIPs-works-for-molecules-with-AP-1-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-Calculate-CIPs-works-for-molecules-with-AP-2-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-Calculate-CIPs-works-for-molecules-with-AP-2-chromium-linux.png
new file mode 100644
index 0000000000..7592ccc2b4
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-Calculate-CIPs-works-for-molecules-with-AP-2-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-Calculate-values-works-for-molecules-with-AP-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-Calculate-values-works-for-molecules-with-AP-1-chromium-linux.png
new file mode 100644
index 0000000000..52cec9e4a7
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-Calculate-values-works-for-molecules-with-AP-1-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-Clean-Up-works-for-molecules-with-AP-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-Clean-Up-works-for-molecules-with-AP-1-chromium-linux.png
new file mode 100644
index 0000000000..4679d49cbb
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-Clean-Up-works-for-molecules-with-AP-1-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-Clean-Up-works-for-molecules-with-AP-2-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-Clean-Up-works-for-molecules-with-AP-2-chromium-linux.png
new file mode 100644
index 0000000000..ed207bf5be
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-Clean-Up-works-for-molecules-with-AP-2-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-Layout-works-for-molecules-with-AP-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-Layout-works-for-molecules-with-AP-1-chromium-linux.png
new file mode 100644
index 0000000000..eaadb7a8ac
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-Layout-works-for-molecules-with-AP-1-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-Structure-Check-works-for-molecules-with-AP-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-Structure-Check-works-for-molecules-with-AP-1-chromium-linux.png
new file mode 100644
index 0000000000..fe30e73f3a
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-Structure-Check-works-for-molecules-with-AP-1-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-Undo-Redo-inva-8b9da-f-we-change-mode-from-micro-to-macro-and-back-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-Undo-Redo-inva-8b9da-f-we-change-mode-from-micro-to-macro-and-back-1-chromium-linux.png
new file mode 100644
index 0000000000..6a8e83cb88
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-Undo-Redo-inva-8b9da-f-we-change-mode-from-micro-to-macro-and-back-1-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-attachment-poi-0d145-roups-are-correctly-represented-in-KET-format-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-attachment-poi-0d145-roups-are-correctly-represented-in-KET-format-1-chromium-linux.png
new file mode 100644
index 0000000000..648c7f4212
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-attachment-poi-0d145-roups-are-correctly-represented-in-KET-format-1-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-attachment-poi-8c03d-as-attachment-point-when-switch-to-macro-mode-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-attachment-poi-8c03d-as-attachment-point-when-switch-to-macro-mode-1-chromium-linux.png
new file mode 100644
index 0000000000..703d414ebf
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-attachment-poi-8c03d-as-attachment-point-when-switch-to-macro-mode-1-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-attachment-poi-b3573-are-correctly-represented-in-Mol-V3000-format-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-attachment-poi-b3573-are-correctly-represented-in-Mol-V3000-format-1-chromium-linux.png
new file mode 100644
index 0000000000..d1c35d456f
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-attachment-poi-b3573-are-correctly-represented-in-Mol-V3000-format-1-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-attachment-poi-e88ec-as-attachment-point-when-switch-to-macro-mode-2-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-attachment-poi-e88ec-as-attachment-point-when-switch-to-macro-mode-2-chromium-linux.png
new file mode 100644
index 0000000000..e141bfd716
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-attachment-poi-e88ec-as-attachment-point-when-switch-to-macro-mode-2-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-in-context-menu-for-AP---only-Delete-avaliable-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-in-context-menu-for-AP---only-Delete-avaliable-1-chromium-linux.png
new file mode 100644
index 0000000000..4fb6cda160
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-in-context-menu-for-AP---only-Delete-avaliable-1-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-it-is-not-poss-5053b-tween-monomer-and-micromolecule-in-micro-mode-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-it-is-not-poss-5053b-tween-monomer-and-micromolecule-in-micro-mode-1-chromium-linux.png
new file mode 100644
index 0000000000..4f0f224d2c
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-it-is-not-poss-5053b-tween-monomer-and-micromolecule-in-micro-mode-1-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-multiple-attac-2ff17-as-attachment-point-when-switch-to-macro-mode-2-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-multiple-attac-2ff17-as-attachment-point-when-switch-to-macro-mode-2-chromium-linux.png
new file mode 100644
index 0000000000..dee938b043
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-multiple-attac-2ff17-as-attachment-point-when-switch-to-macro-mode-2-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-multiple-attac-4e4c3-as-attachment-point-when-switch-to-macro-mode-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-multiple-attac-4e4c3-as-attachment-point-when-switch-to-macro-mode-1-chromium-linux.png
new file mode 100644
index 0000000000..f0068353e3
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-multiple-attac-4e4c3-as-attachment-point-when-switch-to-macro-mode-1-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-system-start-t-e6102-1-R3-R8---attempt-to-add-causes-R2-selection-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-system-start-t-e6102-1-R3-R8---attempt-to-add-causes-R2-selection-1-chromium-linux.png
new file mode 100644
index 0000000000..fcf09b813e
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-that-system-start-t-e6102-1-R3-R8---attempt-to-add-causes-R2-selection-1-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-we-can-attach-AP-to-single-atom-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-we-can-attach-AP-to-single-atom-1-chromium-linux.png
new file mode 100644
index 0000000000..e92e1d0b51
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Check-we-can-attach-AP-to-single-atom-1-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Connection-one-molecule-t-1d87d-el-and-it-remain-back-after-delete-connection-2-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Connection-one-molecule-t-1d87d-el-and-it-remain-back-after-delete-connection-2-chromium-linux.png
new file mode 100644
index 0000000000..2452bb3a96
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Connection-one-molecule-t-1d87d-el-and-it-remain-back-after-delete-connection-2-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Connection-one-molecule-t-742eb-el-and-it-remain-back-after-delete-connection-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Connection-one-molecule-t-742eb-el-and-it-remain-back-after-delete-connection-1-chromium-linux.png
new file mode 100644
index 0000000000..38c56ae0d7
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Connection-one-molecule-t-742eb-el-and-it-remain-back-after-delete-connection-1-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Connection-one-molecule-t-e6098-el-and-it-remain-back-after-delete-connection-3-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Connection-one-molecule-t-e6098-el-and-it-remain-back-after-delete-connection-3-chromium-linux.png
new file mode 100644
index 0000000000..9612f55475
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Connection-one-molecule-t-e6098-el-and-it-remain-back-after-delete-connection-3-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Delete-bond-between-micro-d4be6-oint-and-CHEM-in-micro-mode-and-Undo-deletion-2-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Delete-bond-between-micro-d4be6-oint-and-CHEM-in-micro-mode-and-Undo-deletion-2-chromium-linux.png
index b30331f64a..c5d15ceba1 100644
Binary files a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Delete-bond-between-micro-d4be6-oint-and-CHEM-in-micro-mode-and-Undo-deletion-2-chromium-linux.png and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Delete-bond-between-micro-d4be6-oint-and-CHEM-in-micro-mode-and-Undo-deletion-2-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Delete-bond-between-micro-ece7d-oint-and-CHEM-in-micro-mode-and-Undo-deletion-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Delete-bond-between-micro-ece7d-oint-and-CHEM-in-micro-mode-and-Undo-deletion-1-chromium-linux.png
index 4861afdfe7..0aa2fa4f48 100644
Binary files a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Delete-bond-between-micro-ece7d-oint-and-CHEM-in-micro-mode-and-Undo-deletion-1-chromium-linux.png and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Delete-bond-between-micro-ece7d-oint-and-CHEM-in-micro-mode-and-Undo-deletion-1-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Ensure-that-new-attachmen-da0a2-ased-on-the-next-free-attachment-point-number-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Ensure-that-new-attachmen-da0a2-ased-on-the-next-free-attachment-point-number-1-chromium-linux.png
new file mode 100644
index 0000000000..49fe54a5d9
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Ensure-that-new-attachmen-da0a2-ased-on-the-next-free-attachment-point-number-1-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Ensure-that-system-does-n-0c3f2-te-s-group-if-structure-have-attachment-point-2-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Ensure-that-system-does-n-0c3f2-te-s-group-if-structure-have-attachment-point-2-chromium-linux.png
new file mode 100644
index 0000000000..45af7adaf2
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Ensure-that-system-does-n-0c3f2-te-s-group-if-structure-have-attachment-point-2-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Ensure-that-system-does-n-69d2f-te-s-group-if-structure-have-attachment-point-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Ensure-that-system-does-n-69d2f-te-s-group-if-structure-have-attachment-point-1-chromium-linux.png
new file mode 100644
index 0000000000..3cf848303b
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Ensure-that-system-does-n-69d2f-te-s-group-if-structure-have-attachment-point-1-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Ensure-that-system-does-n-6d676-te-s-group-if-structure-have-attachment-point-3-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Ensure-that-system-does-n-6d676-te-s-group-if-structure-have-attachment-point-3-chromium-linux.png
new file mode 100644
index 0000000000..d035ebeac0
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Ensure-that-system-does-n-6d676-te-s-group-if-structure-have-attachment-point-3-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Verify-attachment-points-can-be-added-removed-via-context-menu-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Verify-attachment-points-can-be-added-removed-via-context-menu-1-chromium-linux.png
new file mode 100644
index 0000000000..76414f038f
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Verify-attachment-points-can-be-added-removed-via-context-menu-1-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Verify-attachment-points-can-be-added-removed-via-context-menu-2-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Verify-attachment-points-can-be-added-removed-via-context-menu-2-chromium-linux.png
new file mode 100644
index 0000000000..a44e035afa
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Verify-attachment-points-can-be-added-removed-via-context-menu-2-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Verify-attachment-points-can-be-added-removed-via-context-menu-3-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Verify-attachment-points-can-be-added-removed-via-context-menu-3-chromium-linux.png
new file mode 100644
index 0000000000..da992de161
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Verify-attachment-points-can-be-added-removed-via-context-menu-3-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Verify-presence-and-corre-0e628-ROUP-segment-of-CDX-molecular-structure-files-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Verify-presence-and-corre-0e628-ROUP-segment-of-CDX-molecular-structure-files-1-chromium-linux.png
new file mode 100644
index 0000000000..fd28f239a4
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Verify-presence-and-corre-0e628-ROUP-segment-of-CDX-molecular-structure-files-1-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Verify-presence-and-corre-2ff77-egment-of-SDF-V3000-molecular-structure-files-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Verify-presence-and-corre-2ff77-egment-of-SDF-V3000-molecular-structure-files-1-chromium-linux.png
new file mode 100644
index 0000000000..d1c35d456f
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Verify-presence-and-corre-2ff77-egment-of-SDF-V3000-molecular-structure-files-1-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Verify-presence-and-corre-4a0ec-egment-of-MOL-V2000-molecular-structure-files-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Verify-presence-and-corre-4a0ec-egment-of-MOL-V2000-molecular-structure-files-1-chromium-linux.png
new file mode 100644
index 0000000000..71e289be1d
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Verify-presence-and-corre-4a0ec-egment-of-MOL-V2000-molecular-structure-files-1-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Verify-presence-and-corre-56dc9-UP-segment-of-CDXML-molecular-structure-files-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Verify-presence-and-corre-56dc9-UP-segment-of-CDXML-molecular-structure-files-1-chromium-linux.png
new file mode 100644
index 0000000000..e13cf3890b
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Verify-presence-and-corre-56dc9-UP-segment-of-CDXML-molecular-structure-files-1-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Verify-presence-and-corre-7ca9a-roup-segment-of-CML-molecular-structure-files-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Verify-presence-and-corre-7ca9a-roup-segment-of-CML-molecular-structure-files-1-chromium-linux.png
new file mode 100644
index 0000000000..e13cf3890b
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Verify-presence-and-corre-7ca9a-roup-segment-of-CML-molecular-structure-files-1-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Verify-presence-and-corre-eb66f-egment-of-SDF-V2000-molecular-structure-files-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Verify-presence-and-corre-eb66f-egment-of-SDF-V2000-molecular-structure-files-1-chromium-linux.png
new file mode 100644
index 0000000000..090487a2b0
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Verify-presence-and-corre-eb66f-egment-of-SDF-V2000-molecular-structure-files-1-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Verify-that-system-does-n-73232-points-R1-R8-already-exist-in-the-structure-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Verify-that-system-does-n-73232-points-R1-R8-already-exist-in-the-structure-1-chromium-linux.png
new file mode 100644
index 0000000000..54ad420cae
Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher.spec.ts-snapshots/Macro-Micro-Switcher-Verify-that-system-does-n-73232-points-R1-R8-already-exist-in-the-structure-1-chromium-linux.png differ
diff --git a/ketcher-autotests/tests/test-data/CDX/one-attachment-point-added-in-micro-mode-expected.cdx b/ketcher-autotests/tests/test-data/CDX/one-attachment-point-added-in-micro-mode-expected.cdx
new file mode 100644
index 0000000000..9bb5f333be
--- /dev/null
+++ b/ketcher-autotests/tests/test-data/CDX/one-attachment-point-added-in-micro-mode-expected.cdx
@@ -0,0 +1 @@
+VmpDRDAxMDAEAwIBAAAAAAAAAAAAAAAAAAAAAAUIBAAAAB4AGggCAAMAGwgCAAQAAAEkAAAAAgACAOn9BQBBcmlhbAMA6f0PAFRpbWVzIE5ldyBSb21hbgADMgAIAP///////wAAAAAAAP//AAAAAP////8AAAAA//8AAAAA/////wAAAAD/////AAD//wGAAAAAABAIAgABAA8IAgABAAOABAAAAASAEwAAAAAEAgAFAAOAFAAAAASABwAAAAACCAD//zsA7gA4AAAABIAFAAAAAAIIANMASwAAAB4AAAAEgAkAAAAAAggAziZpAAAAHgAAAASACgAAAAACCACCAHgAtBE4AAAABIAIAAAAAAIIAFcEaQC46FEAAAAEgAYAAAAAAggAGP1KALjoUQAAAASACwAAAAIEAgABAAACCAAAAB4AngU4AAaAAAAAAAACCAAAAB4AngU4ACMIAQAAAAcNAAEAAAADAGAAyAAAAEgAAAAABYAMAAAABAYEAAcAAAAFBgQABQAAAAAGAgACAAAABYANAAAABAYEAAUAAAAFBgQACQAAAAAABYAOAAAABAYEAAkAAAAFBgQACgAAAAAGAgACAAAABYAPAAAABAYEAAoAAAAFBgQACAAAAAAABYAQAAAABAYEAAgAAAAFBgQABgAAAAAGAgACAAAABYARAAAABAYEAAYAAAAFBgQABwAAAAAABYASAAAABAYEAAcAAAAFBgQACwAAAAAAAAAGgAAAAAAjCAEAAAUHAQAEAAcAAAAAAAAAAAAAAAAAAA==
\ No newline at end of file
diff --git a/ketcher-autotests/tests/test-data/CDXML/one-attachment-point-added-in-micro-mode-expected.cdxml b/ketcher-autotests/tests/test-data/CDXML/one-attachment-point-added-in-micro-mode-expected.cdxml
new file mode 100644
index 0000000000..dbe6e6df26
--- /dev/null
+++ b/ketcher-autotests/tests/test-data/CDXML/one-attachment-point-added-in-micro-mode-expected.cdxml
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ H
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ketcher-autotests/tests/test-data/CML/one-attachment-point-added-in-micro-mode-expected.cml b/ketcher-autotests/tests/test-data/CML/one-attachment-point-added-in-micro-mode-expected.cml
new file mode 100644
index 0000000000..c1382ce478
--- /dev/null
+++ b/ketcher-autotests/tests/test-data/CML/one-attachment-point-added-in-micro-mode-expected.cml
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ C
+
+
+
+ C
+
+
+
+ C
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ketcher-autotests/tests/test-data/KET/chain-with-eight-attachment-points.ket b/ketcher-autotests/tests/test-data/KET/chain-with-eight-attachment-points.ket
new file mode 100644
index 0000000000..ec8633af37
--- /dev/null
+++ b/ketcher-autotests/tests/test-data/KET/chain-with-eight-attachment-points.ket
@@ -0,0 +1,367 @@
+{
+ "root": {
+ "nodes": [
+ {
+ "$ref": "mol0"
+ }
+ ],
+ "connections": [],
+ "templates": []
+ },
+ "mol0": {
+ "type": "molecule",
+ "atoms": [
+ {
+ "label": "C",
+ "location": [
+ 3.7,
+ -5.025,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 4.5660254037844386,
+ -5.525,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 5.432050807568878,
+ -5.025,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 6.298076211353316,
+ -5.525,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 7.164101615137755,
+ -5.025,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 8.030127018922194,
+ -5.525,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 8.896152422706631,
+ -5.025,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 9.762177826491072,
+ -5.525,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 10.62820323027551,
+ -5.025,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 11.494228634059947,
+ -5.525,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 12.360254037844388,
+ -5.025,
+ 0
+ ]
+ },
+ {
+ "label": "H",
+ "location": [
+ 4.5660254037844386,
+ -6.525,
+ 0
+ ]
+ },
+ {
+ "label": "H",
+ "location": [
+ 5.432050807568878,
+ -4.025,
+ 0
+ ]
+ },
+ {
+ "label": "H",
+ "location": [
+ 6.298076211353316,
+ -6.525,
+ 0
+ ]
+ },
+ {
+ "label": "H",
+ "location": [
+ 7.164101615137755,
+ -4.025,
+ 0
+ ]
+ },
+ {
+ "label": "H",
+ "location": [
+ 8.030127018922194,
+ -6.525,
+ 0
+ ]
+ },
+ {
+ "label": "H",
+ "location": [
+ 8.89615242270663,
+ -4.025,
+ 0
+ ]
+ },
+ {
+ "label": "H",
+ "location": [
+ 9.762177826491074,
+ -6.525,
+ 0
+ ]
+ },
+ {
+ "label": "H",
+ "location": [
+ 10.62820323027551,
+ -4.025,
+ 0
+ ]
+ }
+ ],
+ "bonds": [
+ {
+ "type": 1,
+ "atoms": [
+ 0,
+ 1
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 1,
+ 2
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 2,
+ 3
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 3,
+ 4
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 4,
+ 5
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 5,
+ 6
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 6,
+ 7
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 7,
+ 8
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 8,
+ 9
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 9,
+ 10
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 1,
+ 11
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 2,
+ 12
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 3,
+ 13
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 4,
+ 14
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 5,
+ 15
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 6,
+ 16
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 7,
+ 17
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 8,
+ 18
+ ]
+ }
+ ],
+ "sgroups": [
+ {
+ "type": "SUP",
+ "atoms": [
+ 1,
+ 11,
+ 2,
+ 3,
+ 4,
+ 5,
+ 6,
+ 7,
+ 8,
+ 9,
+ 10,
+ 0,
+ 12,
+ 13,
+ 14,
+ 15,
+ 16,
+ 17,
+ 18
+ ],
+ "name": "",
+ "expanded": true,
+ "id": 0,
+ "attachmentPoints": [
+ {
+ "attachmentAtom": 1,
+ "leavingAtom": 11,
+ "attachmentId": "1"
+ },
+ {
+ "attachmentAtom": 2,
+ "leavingAtom": 12,
+ "attachmentId": "2"
+ },
+ {
+ "attachmentAtom": 3,
+ "leavingAtom": 13,
+ "attachmentId": "3"
+ },
+ {
+ "attachmentAtom": 4,
+ "leavingAtom": 14,
+ "attachmentId": "4"
+ },
+ {
+ "attachmentAtom": 5,
+ "leavingAtom": 15,
+ "attachmentId": "5"
+ },
+ {
+ "attachmentAtom": 6,
+ "leavingAtom": 16,
+ "attachmentId": "6"
+ },
+ {
+ "attachmentAtom": 7,
+ "leavingAtom": 17,
+ "attachmentId": "7"
+ },
+ {
+ "attachmentAtom": 8,
+ "leavingAtom": 18,
+ "attachmentId": "8"
+ }
+ ]
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ketcher-autotests/tests/test-data/KET/chem-connected-to-micro-structure-expected.ket b/ketcher-autotests/tests/test-data/KET/chem-connected-to-micro-structure-expected.ket
new file mode 100644
index 0000000000..20b392de85
--- /dev/null
+++ b/ketcher-autotests/tests/test-data/KET/chem-connected-to-micro-structure-expected.ket
@@ -0,0 +1,351 @@
+{
+ "root": {
+ "nodes": [
+ {
+ "$ref": "monomer3"
+ },
+ {
+ "$ref": "mol0"
+ }
+ ],
+ "connections": [
+ {
+ "connectionType": "single",
+ "endpoint1": {
+ "moleculeId": "mol0",
+ "atomId": "2"
+ },
+ "endpoint2": {
+ "monomerId": "monomer3",
+ "attachmentPointId": "R2"
+ }
+ }
+ ],
+ "templates": [
+ {
+ "$ref": "monomerTemplate-A6OH___6-amino-hexanol"
+ }
+ ]
+ },
+ "mol0": {
+ "type": "molecule",
+ "atoms": [
+ {
+ "label": "C",
+ "location": [
+ 10.569026868881105,
+ -8.00007432425331,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 12.299328564623972,
+ -7.999589136255906,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 11.435815226243777,
+ -7.49996679592889,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 12.299328564623972,
+ -9.00053197490085,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 10.569026868881105,
+ -9.00501996387684,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 11.437998572232097,
+ -9.500033018228516,
+ 0
+ ]
+ },
+ {
+ "label": "H",
+ "location": [
+ 11.436424886110105,
+ -6.499966981771483,
+ 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
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 2,
+ 6
+ ]
+ }
+ ],
+ "sgroups": [
+ {
+ "type": "SUP",
+ "atoms": [
+ 2,
+ 0,
+ 4,
+ 5,
+ 3,
+ 1,
+ 6
+ ],
+ "name": "",
+ "expanded": true,
+ "id": 0,
+ "attachmentPoints": [
+ {
+ "attachmentAtom": 2,
+ "leavingAtom": 6,
+ "attachmentId": "1"
+ }
+ ]
+ }
+ ]
+ },
+ "monomer3": {
+ "type": "monomer",
+ "id": "3",
+ "position": {
+ "x": 14.959177716752537,
+ "y": -7.199999907078703
+ },
+ "alias": "A6OH",
+ "templateId": "A6OH___6-amino-hexanol"
+ },
+ "monomerTemplate-A6OH___6-amino-hexanol": {
+ "type": "monomerTemplate",
+ "atoms": [
+ {
+ "label": "N",
+ "location": [
+ 3.1837706744863454,
+ 0,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 2.2373008012194098,
+ 0.4468046329222854,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 1.3767468492510937,
+ -0.14888838634135776,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 0.43027697598415804,
+ 0.2978465096318215,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ -0.43027697598415804,
+ -0.2978465096318215,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ -1.3766771123019876,
+ 0.14888838634135776,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ -2.2373008012194098,
+ -0.4468046329222854,
+ 0
+ ]
+ },
+ {
+ "label": "O",
+ "location": [
+ -3.1837706744863454,
+ 0,
+ 0
+ ]
+ },
+ {
+ "label": "H",
+ "location": [
+ 3.8717954143663618,
+ 0.47637309934323885,
+ 0
+ ]
+ },
+ {
+ "label": "H",
+ "location": [
+ -3.8717954143663618,
+ -0.47637309934323885,
+ 0
+ ]
+ }
+ ],
+ "bonds": [
+ {
+ "type": 1,
+ "atoms": [
+ 0,
+ 1
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 1,
+ 2
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 2,
+ 3
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 3,
+ 4
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 4,
+ 5
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 5,
+ 6
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 6,
+ 7
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 0,
+ 8
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 7,
+ 9
+ ]
+ }
+ ],
+ "class": "CHEM",
+ "classHELM": "CHEM",
+ "id": "A6OH___6-amino-hexanol",
+ "fullName": "6-amino-hexanol",
+ "alias": "A6OH",
+ "attachmentPoints": [
+ {
+ "attachmentAtom": 7,
+ "leavingGroup": {
+ "atoms": [
+ 9
+ ]
+ },
+ "type": "left"
+ },
+ {
+ "attachmentAtom": 0,
+ "leavingGroup": {
+ "atoms": [
+ 8
+ ]
+ },
+ "type": "right"
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ketcher-autotests/tests/test-data/KET/chem-connected-to-micro-structure.ket b/ketcher-autotests/tests/test-data/KET/chem-connected-to-micro-structure.ket
new file mode 100644
index 0000000000..16fd6cdc78
--- /dev/null
+++ b/ketcher-autotests/tests/test-data/KET/chem-connected-to-micro-structure.ket
@@ -0,0 +1,351 @@
+{
+ "root": {
+ "nodes": [
+ {
+ "$ref": "monomer61"
+ },
+ {
+ "$ref": "mol0"
+ }
+ ],
+ "connections": [
+ {
+ "connectionType": "single",
+ "endpoint1": {
+ "moleculeId": "mol0",
+ "atomId": "2"
+ },
+ "endpoint2": {
+ "monomerId": "monomer61",
+ "attachmentPointId": "R2"
+ }
+ }
+ ],
+ "templates": [
+ {
+ "$ref": "monomerTemplate-A6OH___6-amino-hexanol"
+ }
+ ]
+ },
+ "mol0": {
+ "type": "molecule",
+ "atoms": [
+ {
+ "label": "C",
+ "location": [
+ 13.684849152128567,
+ -8.150074417174608,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 15.415150847871434,
+ -8.149589229177204,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 14.55163750949124,
+ -7.649966888850187,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 15.415150847871434,
+ -9.150532067822148,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 13.684849152128567,
+ -9.155020056798138,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 14.55382085547956,
+ -9.650033111149813,
+ 0
+ ]
+ },
+ {
+ "label": "H",
+ "location": [
+ 14.552247169357567,
+ -6.649967074692781,
+ 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
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 2,
+ 6
+ ]
+ }
+ ],
+ "sgroups": [
+ {
+ "type": "SUP",
+ "atoms": [
+ 2,
+ 0,
+ 4,
+ 5,
+ 3,
+ 1,
+ 6
+ ],
+ "name": "",
+ "expanded": true,
+ "id": 0,
+ "attachmentPoints": [
+ {
+ "attachmentAtom": 2,
+ "leavingAtom": 6,
+ "attachmentId": "1"
+ }
+ ]
+ }
+ ]
+ },
+ "monomer61": {
+ "type": "monomer",
+ "id": "61",
+ "position": {
+ "x": 18.075,
+ "y": -7.3500000000000005
+ },
+ "alias": "A6OH",
+ "templateId": "A6OH___6-amino-hexanol"
+ },
+ "monomerTemplate-A6OH___6-amino-hexanol": {
+ "type": "monomerTemplate",
+ "atoms": [
+ {
+ "label": "N",
+ "location": [
+ 3.1837706744863454,
+ 0,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 2.2373008012194098,
+ 0.4468046329222854,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 1.3767468492510937,
+ -0.14888838634135776,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 0.43027697598415804,
+ 0.2978465096318215,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ -0.43027697598415804,
+ -0.2978465096318215,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ -1.3766771123019876,
+ 0.14888838634135776,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ -2.2373008012194098,
+ -0.4468046329222854,
+ 0
+ ]
+ },
+ {
+ "label": "O",
+ "location": [
+ -3.1837706744863454,
+ 0,
+ 0
+ ]
+ },
+ {
+ "label": "H",
+ "location": [
+ 3.8717954143663618,
+ 0.47637309934323885,
+ 0
+ ]
+ },
+ {
+ "label": "H",
+ "location": [
+ -3.8717954143663618,
+ -0.47637309934323885,
+ 0
+ ]
+ }
+ ],
+ "bonds": [
+ {
+ "type": 1,
+ "atoms": [
+ 0,
+ 1
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 1,
+ 2
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 2,
+ 3
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 3,
+ 4
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 4,
+ 5
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 5,
+ 6
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 6,
+ 7
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 0,
+ 8
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 7,
+ 9
+ ]
+ }
+ ],
+ "class": "CHEM",
+ "classHELM": "CHEM",
+ "id": "A6OH___6-amino-hexanol",
+ "fullName": "6-amino-hexanol",
+ "alias": "A6OH",
+ "attachmentPoints": [
+ {
+ "attachmentAtom": 7,
+ "leavingGroup": {
+ "atoms": [
+ 9
+ ]
+ },
+ "type": "left"
+ },
+ {
+ "attachmentAtom": 0,
+ "leavingGroup": {
+ "atoms": [
+ 8
+ ]
+ },
+ "type": "right"
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ketcher-autotests/tests/test-data/KET/more-than-one-attachment-atom-for-R-Group.ket b/ketcher-autotests/tests/test-data/KET/distorted-r1-attachment-point.ket
similarity index 56%
rename from ketcher-autotests/tests/test-data/KET/more-than-one-attachment-atom-for-R-Group.ket
rename to ketcher-autotests/tests/test-data/KET/distorted-r1-attachment-point.ket
index 864bbffe30..9cc864c33b 100644
--- a/ketcher-autotests/tests/test-data/KET/more-than-one-attachment-atom-for-R-Group.ket
+++ b/ketcher-autotests/tests/test-data/KET/distorted-r1-attachment-point.ket
@@ -14,51 +14,56 @@
{
"label": "C",
"location": [
- 13.334849152128573,
- -10.850074417174614,
+ 14.818488532234602,
+ -9.830806381596753,
0
]
},
{
"label": "C",
"location": [
- 15.065150847871442,
- -10.84958922917721,
+ 16.54980088635856,
+ -9.830320961481194,
0
]
},
{
- "type": "rg-label",
+ "label": "C",
"location": [
- 14.201637509491247,
- -10.349966888850194,
+ 15.685783598232907,
+ -9.330405953315324,
0
- ],
- "$refs": [
- "rg-1"
]
},
{
"label": "C",
"location": [
- 15.065150847871442,
- -11.850532067822154,
+ 16.54980088635856,
+ -10.831847564032149,
0
]
},
{
"label": "C",
"location": [
- 13.334849152128573,
- -11.855020056798145,
+ 14.818488532234602,
+ -10.836338415356652,
0
]
},
{
"label": "C",
"location": [
- 14.203820855479567,
- -12.350033111149818,
+ 15.687966558241781,
+ -11.331640501913554,
+ 0
+ ]
+ },
+ {
+ "label": "H",
+ "location": [
+ 15.591088320774075,
+ -4.709104531143846,
0
]
}
@@ -105,6 +110,37 @@
1,
2
]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 2,
+ 6
+ ]
+ }
+ ],
+ "sgroups": [
+ {
+ "type": "SUP",
+ "atoms": [
+ 2,
+ 0,
+ 4,
+ 5,
+ 3,
+ 1,
+ 6
+ ],
+ "name": "",
+ "expanded": true,
+ "id": 0,
+ "attachmentPoints": [
+ {
+ "attachmentAtom": 2,
+ "leavingAtom": 6,
+ "attachmentId": "1"
+ }
+ ]
}
]
}
diff --git a/ketcher-autotests/tests/test-data/KET/long-chain.ket b/ketcher-autotests/tests/test-data/KET/long-chain.ket
new file mode 100644
index 0000000000..5a4b468fe6
--- /dev/null
+++ b/ketcher-autotests/tests/test-data/KET/long-chain.ket
@@ -0,0 +1,296 @@
+{
+ "root": {
+ "nodes": [
+ {
+ "$ref": "mol0"
+ }
+ ],
+ "connections": [],
+ "templates": []
+ },
+ "mol0": {
+ "type": "molecule",
+ "atoms": [
+ {
+ "label": "C",
+ "location": [
+ 1.1786290322580655,
+ -3.7512096774193555,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 2.0446544360425043,
+ -4.2512096774193555,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 2.910679839826943,
+ -3.7512096774193555,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 3.7767052436113815,
+ -4.2512096774193555,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 4.642730647395821,
+ -3.7512096774193555,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 5.508756051180259,
+ -4.2512096774193555,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 6.3747814549646975,
+ -3.7512096774193555,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 7.240806858749137,
+ -4.2512096774193555,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 8.106832262533576,
+ -3.7512096774193555,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 8.972857666318014,
+ -4.2512096774193555,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 9.838883070102453,
+ -3.7512096774193555,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 10.704908473886892,
+ -4.2512096774193555,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 11.57093387767133,
+ -3.7512096774193555,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 12.436959281455769,
+ -4.2512096774193555,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 13.302984685240208,
+ -3.7512096774193555,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 14.169010089024646,
+ -4.2512096774193555,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 15.035035492809085,
+ -3.7512096774193555,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 15.901060896593524,
+ -4.2512096774193555,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 16.76708630037796,
+ -3.7512096774193555,
+ 0
+ ]
+ }
+ ],
+ "bonds": [
+ {
+ "type": 1,
+ "atoms": [
+ 0,
+ 1
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 1,
+ 2
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 2,
+ 3
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 3,
+ 4
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 4,
+ 5
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 5,
+ 6
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 6,
+ 7
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 7,
+ 8
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 8,
+ 9
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 9,
+ 10
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 10,
+ 11
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 11,
+ 12
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 12,
+ 13
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 13,
+ 14
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 14,
+ 15
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 15,
+ 16
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 16,
+ 17
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 17,
+ 18
+ ]
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ketcher-autotests/tests/test-data/KET/more-than-one-attachment-point.ket b/ketcher-autotests/tests/test-data/KET/more-than-one-attachment-point.ket
new file mode 100644
index 0000000000..40d0beaa6c
--- /dev/null
+++ b/ketcher-autotests/tests/test-data/KET/more-than-one-attachment-point.ket
@@ -0,0 +1,252 @@
+{
+ "root": {
+ "nodes": [
+ {
+ "$ref": "mol0"
+ }
+ ],
+ "connections": [],
+ "templates": []
+ },
+ "mol0": {
+ "type": "molecule",
+ "atoms": [
+ {
+ "label": "C",
+ "location": [
+ 16.009849152128567,
+ -9.500074417174607,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 17.740150847871433,
+ -9.499589229177204,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 16.87663750949124,
+ -8.999966888850187,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 17.740150847871433,
+ -10.500532067822148,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 16.009849152128567,
+ -10.505020056798138,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 16.878820855479557,
+ -11.000033111149811,
+ 0
+ ]
+ },
+ {
+ "label": "H",
+ "location": [
+ 16.877247169357567,
+ -7.999967074692781,
+ 0
+ ]
+ },
+ {
+ "label": "H",
+ "location": [
+ 18.60640895057588,
+ -8.999992492299459,
+ 0
+ ]
+ },
+ {
+ "label": "H",
+ "location": [
+ 18.60665682524083,
+ -10.999698764611011,
+ 0
+ ]
+ },
+ {
+ "label": "H",
+ "location": [
+ 16.88267857968565,
+ -12.000025670104101,
+ 0
+ ]
+ },
+ {
+ "label": "H",
+ "location": [
+ 15.145275269918834,
+ -11.007525780348416,
+ 0
+ ]
+ },
+ {
+ "label": "H",
+ "location": [
+ 15.143895794491593,
+ -8.999949650344117,
+ 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
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 2,
+ 6
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 1,
+ 7
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 3,
+ 8
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 5,
+ 9
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 4,
+ 10
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 0,
+ 11
+ ]
+ }
+ ],
+ "sgroups": [
+ {
+ "type": "SUP",
+ "atoms": [
+ 2,
+ 0,
+ 4,
+ 5,
+ 3,
+ 1,
+ 6,
+ 7,
+ 8,
+ 9,
+ 10,
+ 11
+ ],
+ "name": "",
+ "expanded": true,
+ "id": 0,
+ "attachmentPoints": [
+ {
+ "attachmentAtom": 2,
+ "leavingAtom": 6,
+ "attachmentId": "1"
+ },
+ {
+ "attachmentAtom": 1,
+ "leavingAtom": 7,
+ "attachmentId": "2"
+ },
+ {
+ "attachmentAtom": 3,
+ "leavingAtom": 8,
+ "attachmentId": "3"
+ },
+ {
+ "attachmentAtom": 5,
+ "leavingAtom": 9,
+ "attachmentId": "4"
+ },
+ {
+ "attachmentAtom": 4,
+ "leavingAtom": 10,
+ "attachmentId": "5"
+ },
+ {
+ "attachmentAtom": 0,
+ "leavingAtom": 11,
+ "attachmentId": "6"
+ }
+ ]
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ketcher-autotests/tests/test-data/KET/atom-connected-to-R-Group-label-by-bond.ket b/ketcher-autotests/tests/test-data/KET/one-attachment-point-added-in-micro-mode-expected.ket
similarity index 64%
rename from ketcher-autotests/tests/test-data/KET/atom-connected-to-R-Group-label-by-bond.ket
rename to ketcher-autotests/tests/test-data/KET/one-attachment-point-added-in-micro-mode-expected.ket
index b8094b108f..4cf3455dc7 100644
--- a/ketcher-autotests/tests/test-data/KET/atom-connected-to-R-Group-label-by-bond.ket
+++ b/ketcher-autotests/tests/test-data/KET/one-attachment-point-added-in-micro-mode-expected.ket
@@ -14,60 +14,57 @@
{
"label": "C",
"location": [
- 13.334849152128573,
- -10.850074417174614,
+ 13.834849152128568,
+ -8.000074324253312,
0
]
},
{
"label": "C",
"location": [
- 15.065150847871442,
- -10.84958922917721,
+ 15.565150847871436,
+ -7.999589136255908,
0
]
},
{
"label": "C",
"location": [
- 14.201637509491247,
- -10.349966888850194,
+ 14.701637509491242,
+ -7.499966795928891,
0
]
},
{
"label": "C",
"location": [
- 15.065150847871442,
- -11.850532067822154,
+ 15.565150847871436,
+ -9.000531974900852,
0
]
},
{
"label": "C",
"location": [
- 13.334849152128573,
- -11.855020056798145,
+ 13.834849152128568,
+ -9.005019963876842,
0
]
},
{
"label": "C",
"location": [
- 14.203820855479567,
- -12.350033111149818,
+ 14.703820855479561,
+ -9.500033018228516,
0
]
},
{
- "type": "rg-label",
+ "label": "H",
"location": [
- 14.202247169357575,
- -9.349967074692785,
+ 14.70224716935757,
+ -6.4999669817714825,
0
- ],
- "$refs": [
- "rg-1"
]
}
],
@@ -121,6 +118,30 @@
6
]
}
+ ],
+ "sgroups": [
+ {
+ "type": "SUP",
+ "atoms": [
+ 2,
+ 0,
+ 4,
+ 5,
+ 3,
+ 1,
+ 6
+ ],
+ "name": "",
+ "expanded": true,
+ "id": 0,
+ "attachmentPoints": [
+ {
+ "attachmentAtom": 2,
+ "leavingAtom": 6,
+ "attachmentId": "1"
+ }
+ ]
+ }
]
}
}
\ No newline at end of file
diff --git a/ketcher-autotests/tests/test-data/KET/one-attachment-point-added-in-micro-mode.ket b/ketcher-autotests/tests/test-data/KET/one-attachment-point-added-in-micro-mode.ket
new file mode 100644
index 0000000000..9da0fd72c5
--- /dev/null
+++ b/ketcher-autotests/tests/test-data/KET/one-attachment-point-added-in-micro-mode.ket
@@ -0,0 +1,147 @@
+{
+ "root": {
+ "nodes": [
+ {
+ "$ref": "mol0"
+ }
+ ],
+ "connections": [],
+ "templates": []
+ },
+ "mol0": {
+ "type": "molecule",
+ "atoms": [
+ {
+ "label": "C",
+ "location": [
+ 13.334849152128568,
+ -10.850074417174609,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 15.065150847871434,
+ -10.849589229177205,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 14.20163750949124,
+ -10.349966888850188,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 15.065150847871434,
+ -11.850532067822149,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 13.334849152128568,
+ -11.85502005679814,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 14.20382085547956,
+ -12.350033111149813,
+ 0
+ ]
+ },
+ {
+ "label": "H",
+ "location": [
+ 14.202247169357568,
+ -9.349967074692781,
+ 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
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 2,
+ 6
+ ]
+ }
+ ],
+ "sgroups": [
+ {
+ "type": "SUP",
+ "atoms": [
+ 2,
+ 0,
+ 4,
+ 5,
+ 3,
+ 1,
+ 6
+ ],
+ "name": "",
+ "expanded": true,
+ "id": 0,
+ "attachmentPoints": [
+ {
+ "attachmentAtom": 2,
+ "leavingAtom": 6,
+ "attachmentId": "1"
+ }
+ ]
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ketcher-autotests/tests/test-data/KET/one-attachment-point-with-oxygen.ket b/ketcher-autotests/tests/test-data/KET/one-attachment-point-with-oxygen.ket
new file mode 100644
index 0000000000..c1e690a439
--- /dev/null
+++ b/ketcher-autotests/tests/test-data/KET/one-attachment-point-with-oxygen.ket
@@ -0,0 +1,163 @@
+{
+ "root": {
+ "nodes": [
+ {
+ "$ref": "mol0"
+ }
+ ],
+ "connections": [],
+ "templates": []
+ },
+ "mol0": {
+ "type": "molecule",
+ "atoms": [
+ {
+ "label": "C",
+ "location": [
+ 14.284849152128567,
+ -10.125074417174607,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 16.015150847871436,
+ -10.124589229177204,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 15.15163750949124,
+ -9.624966888850187,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 16.015150847871436,
+ -11.125532067822148,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 14.284849152128567,
+ -11.130020056798138,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 15.153820855479559,
+ -11.625033111149811,
+ 0
+ ]
+ },
+ {
+ "label": "H",
+ "location": [
+ 15.152247169357567,
+ -8.62496707469278,
+ 0
+ ]
+ },
+ {
+ "label": "O",
+ "location": [
+ 15.859353950544115,
+ -7.917860293506232,
+ 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
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 2,
+ 6
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 6,
+ 7
+ ]
+ }
+ ],
+ "sgroups": [
+ {
+ "type": "SUP",
+ "atoms": [
+ 2,
+ 0,
+ 4,
+ 5,
+ 3,
+ 1,
+ 6,
+ 7
+ ],
+ "name": "",
+ "expanded": true,
+ "id": 0,
+ "attachmentPoints": [
+ {
+ "attachmentAtom": 2,
+ "leavingAtom": 6,
+ "attachmentId": "1"
+ }
+ ]
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ketcher-autotests/tests/test-data/KET/oxygen-on-attachment-point.ket b/ketcher-autotests/tests/test-data/KET/oxygen-on-attachment-point.ket
new file mode 100644
index 0000000000..63daf84919
--- /dev/null
+++ b/ketcher-autotests/tests/test-data/KET/oxygen-on-attachment-point.ket
@@ -0,0 +1,152 @@
+{
+ "root": {
+ "nodes": [
+ {
+ "$ref": "mol0"
+ }
+ ],
+ "connections": [],
+ "templates": []
+ },
+ "mol0": {
+ "type": "molecule",
+ "atoms": [
+ {
+ "label": "C",
+ "location": [
+ 14.884849152128567,
+ -10.525074417174608,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 16.615150847871433,
+ -10.524589229177204,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 15.751637509491239,
+ -10.024966888850187,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 16.615150847871433,
+ -11.525532067822148,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 14.884849152128567,
+ -11.530020056798138,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 15.753820855479558,
+ -12.025033111149813,
+ 0
+ ]
+ },
+ {
+ "label": "O",
+ "location": [
+ 15.752247169357567,
+ -9.02496707469278,
+ 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
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 2,
+ 6
+ ]
+ }
+ ],
+ "sgroups": [
+ {
+ "type": "SUP",
+ "atoms": [
+ 2,
+ 0,
+ 4,
+ 5,
+ 3,
+ 1,
+ 6
+ ],
+ "name": "",
+ "expanded": true,
+ "id": 0,
+ "attachmentPoints": [
+ {
+ "attachmentAtom": 2,
+ "leavingAtom": 6,
+ "attachmentId": "1"
+ }
+ ]
+ }
+ ],
+ "stereoFlagPosition": {
+ "x": 16.59015084787144,
+ "y": 8.025,
+ "z": 0
+ }
+ }
+}
\ No newline at end of file
diff --git a/ketcher-autotests/tests/test-data/KET/part-chain-with-s-group.ket b/ketcher-autotests/tests/test-data/KET/part-chain-with-s-group.ket
new file mode 100644
index 0000000000..079ab6b7a8
--- /dev/null
+++ b/ketcher-autotests/tests/test-data/KET/part-chain-with-s-group.ket
@@ -0,0 +1,161 @@
+{
+ "root": {
+ "nodes": [
+ {
+ "$ref": "mol0"
+ }
+ ],
+ "connections": [],
+ "templates": []
+ },
+ "mol0": {
+ "type": "molecule",
+ "atoms": [
+ {
+ "label": "C",
+ "location": [
+ 8.200000000000001,
+ -7.275,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 9.06602540378444,
+ -7.775,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 9.932050807568878,
+ -7.275,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 10.798076211353317,
+ -7.775,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 11.664101615137756,
+ -7.275,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 12.530127018922194,
+ -7.775,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 13.396152422706633,
+ -7.275,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 14.262177826491072,
+ -7.775,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 15.12820323027551,
+ -7.275,
+ 0
+ ]
+ }
+ ],
+ "bonds": [
+ {
+ "type": 1,
+ "atoms": [
+ 0,
+ 1
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 1,
+ 2
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 2,
+ 3
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 3,
+ 4
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 4,
+ 5
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 5,
+ 6
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 6,
+ 7
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 7,
+ 8
+ ]
+ }
+ ],
+ "sgroups": [
+ {
+ "type": "SUP",
+ "atoms": [
+ 0,
+ 1,
+ 2,
+ 3,
+ 4
+ ],
+ "name": "Test",
+ "expanded": true,
+ "id": 0
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ketcher-autotests/tests/test-data/KET/structure-with-ap-and-stereo.ket b/ketcher-autotests/tests/test-data/KET/structure-with-ap-and-stereo.ket
new file mode 100644
index 0000000000..2e5c15a95a
--- /dev/null
+++ b/ketcher-autotests/tests/test-data/KET/structure-with-ap-and-stereo.ket
@@ -0,0 +1,183 @@
+{
+ "root": {
+ "nodes": [
+ {
+ "$ref": "mol0"
+ }
+ ],
+ "connections": [],
+ "templates": []
+ },
+ "mol0": {
+ "type": "molecule",
+ "atoms": [
+ {
+ "label": "C",
+ "location": [
+ 14.818491994286914,
+ -9.830808036388733,
+ 0
+ ],
+ "stereoLabel": "abs"
+ },
+ {
+ "label": "C",
+ "location": [
+ 16.549803068393892,
+ -9.830322616097284,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 15.685787374545013,
+ -9.330407426789847,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 16.549803068393892,
+ -10.831849581546123,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 14.818491994286914,
+ -10.836340434497862,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 15.687970335344872,
+ -11.331643654199308,
+ 0
+ ],
+ "stereoLabel": "abs"
+ },
+ {
+ "label": "H",
+ "location": [
+ 15.666092089949704,
+ -8.3341056436138,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 13.95253843397001,
+ -9.330683992378296,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 15.691828026341883,
+ -12.33163621328171,
+ 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
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 2,
+ 6
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 0,
+ 7
+ ],
+ "stereo": 1
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 5,
+ 8
+ ],
+ "stereo": 1
+ }
+ ],
+ "sgroups": [
+ {
+ "type": "SUP",
+ "atoms": [
+ 6,
+ 2,
+ 0,
+ 4,
+ 5,
+ 3,
+ 1,
+ 7,
+ 8
+ ],
+ "name": "",
+ "expanded": true,
+ "id": 0,
+ "attachmentPoints": [
+ {
+ "attachmentAtom": 2,
+ "leavingAtom": 6,
+ "attachmentId": "1"
+ }
+ ]
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ketcher-autotests/tests/test-data/KET/structure-with-two-attachment-points-expected.ket b/ketcher-autotests/tests/test-data/KET/structure-with-two-attachment-points-expected.ket
new file mode 100644
index 0000000000..d96937f2d0
--- /dev/null
+++ b/ketcher-autotests/tests/test-data/KET/structure-with-two-attachment-points-expected.ket
@@ -0,0 +1,202 @@
+{
+ "root": {
+ "nodes": [
+ {
+ "$ref": "mol0"
+ }
+ ],
+ "connections": [],
+ "templates": []
+ },
+ "mol0": {
+ "type": "molecule",
+ "atoms": [
+ {
+ "label": "C",
+ "location": [
+ 13.942741353249712,
+ -8.975514415273055,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 13.942942292156495,
+ -7.973130678783804,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 14.64803691605963,
+ -7.26793558542728,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 14.648237854966412,
+ -9.68080997808297,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 15.650521122002273,
+ -9.68080997808297,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 16.35581668481219,
+ -8.975514415273055,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 16.355716215358797,
+ -7.973130678783804,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 15.650521122002273,
+ -7.267835115973888,
+ 0
+ ]
+ },
+ {
+ "label": "H",
+ "location": [
+ 13.044183315187814,
+ -7.56543102512855,
+ 0
+ ],
+ "selected": true
+ },
+ {
+ "label": "H",
+ "location": [
+ 14.29031242217327,
+ -6.319190021917031,
+ 0
+ ],
+ "selected": true
+ }
+ ],
+ "bonds": [
+ {
+ "type": 1,
+ "atoms": [
+ 1,
+ 0
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 0,
+ 3
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 3,
+ 4
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 4,
+ 5
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 5,
+ 6
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 6,
+ 7
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 7,
+ 2
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 2,
+ 1
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 1,
+ 8
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 2,
+ 9
+ ]
+ }
+ ],
+ "sgroups": [
+ {
+ "type": "SUP",
+ "atoms": [
+ 1,
+ 0,
+ 3,
+ 4,
+ 5,
+ 6,
+ 7,
+ 2,
+ 8,
+ 9
+ ],
+ "name": "",
+ "expanded": true,
+ "id": 0,
+ "attachmentPoints": [
+ {
+ "attachmentAtom": 1,
+ "leavingAtom": 8,
+ "attachmentId": "1"
+ },
+ {
+ "attachmentAtom": 2,
+ "leavingAtom": 9,
+ "attachmentId": "2"
+ }
+ ]
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ketcher-autotests/tests/test-data/KET/structure-with-two-attachment-points.ket b/ketcher-autotests/tests/test-data/KET/structure-with-two-attachment-points.ket
new file mode 100644
index 0000000000..72c4640011
--- /dev/null
+++ b/ketcher-autotests/tests/test-data/KET/structure-with-two-attachment-points.ket
@@ -0,0 +1,205 @@
+{
+ "root": {
+ "nodes": [
+ {
+ "$ref": "mol0"
+ }
+ ],
+ "connections": [],
+ "templates": []
+ },
+ "mol0": {
+ "type": "molecule",
+ "atoms": [
+ {
+ "label": "C",
+ "location": [
+ 15.79664766989873,
+ -11.856764334078372,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 15.796848608805513,
+ -10.85438059758912,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 16.501943232708648,
+ -10.149185504232596,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 16.50214417161543,
+ -12.562059896888288,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 17.50442743865129,
+ -12.562059896888288,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 18.209723001461207,
+ -11.856764334078372,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 18.209622532007813,
+ -10.85438059758912,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 17.50442743865129,
+ -10.149085034779205,
+ 0
+ ]
+ },
+ {
+ "label": "H",
+ "location": [
+ 14.898089631836832,
+ -10.446680943933867,
+ 0
+ ]
+ },
+ {
+ "label": "H",
+ "location": [
+ 16.14421873882229,
+ -9.200439940722347,
+ 0
+ ]
+ }
+ ],
+ "bonds": [
+ {
+ "type": 1,
+ "atoms": [
+ 1,
+ 0
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 0,
+ 3
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 3,
+ 4
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 4,
+ 5
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 5,
+ 6
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 6,
+ 7
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 7,
+ 2
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 2,
+ 1
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 1,
+ 8
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 2,
+ 9
+ ]
+ }
+ ],
+ "sgroups": [
+ {
+ "type": "SUP",
+ "atoms": [
+ 1,
+ 0,
+ 3,
+ 4,
+ 5,
+ 6,
+ 7,
+ 2,
+ 8,
+ 9
+ ],
+ "name": "",
+ "expanded": true,
+ "id": 0,
+ "attachmentPoints": [
+ {
+ "attachmentAtom": 1,
+ "leavingAtom": 8,
+ "attachmentId": "1"
+ },
+ {
+ "attachmentAtom": 2,
+ "leavingAtom": 9,
+ "attachmentId": "2"
+ }
+ ]
+ }
+ ],
+ "stereoFlagPosition": {
+ "x": 18.209723001461207,
+ "y": 8.200439940722347,
+ "z": 0
+ }
+ }
+}
\ No newline at end of file
diff --git a/ketcher-autotests/tests/test-data/KET/two-attachment-points-added-in-micro-mode.ket b/ketcher-autotests/tests/test-data/KET/two-attachment-points-added-in-micro-mode.ket
new file mode 100644
index 0000000000..0c098ca67f
--- /dev/null
+++ b/ketcher-autotests/tests/test-data/KET/two-attachment-points-added-in-micro-mode.ket
@@ -0,0 +1,168 @@
+{
+ "root": {
+ "nodes": [
+ {
+ "$ref": "mol0"
+ }
+ ],
+ "connections": [],
+ "templates": []
+ },
+ "mol0": {
+ "type": "molecule",
+ "atoms": [
+ {
+ "label": "C",
+ "location": [
+ 11.984849152128568,
+ -8.125074417174607,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 13.715150847871435,
+ -8.124589229177204,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 12.85163750949124,
+ -7.624966888850187,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 13.715150847871435,
+ -9.125532067822148,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 11.984849152128568,
+ -9.130020056798138,
+ 0
+ ]
+ },
+ {
+ "label": "C",
+ "location": [
+ 12.85382085547956,
+ -9.625033111149813,
+ 0
+ ]
+ },
+ {
+ "label": "H",
+ "location": [
+ 11.118895794491594,
+ -7.624949650344116,
+ 0
+ ]
+ },
+ {
+ "label": "H",
+ "location": [
+ 14.581408950575883,
+ -7.624992492299459,
+ 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
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 0,
+ 6
+ ]
+ },
+ {
+ "type": 1,
+ "atoms": [
+ 1,
+ 7
+ ]
+ }
+ ],
+ "sgroups": [
+ {
+ "type": "SUP",
+ "atoms": [
+ 0,
+ 4,
+ 5,
+ 3,
+ 1,
+ 2,
+ 6,
+ 7
+ ],
+ "name": "",
+ "expanded": true,
+ "id": 0,
+ "attachmentPoints": [
+ {
+ "attachmentAtom": 0,
+ "leavingAtom": 6,
+ "attachmentId": "1"
+ },
+ {
+ "attachmentAtom": 1,
+ "leavingAtom": 7,
+ "attachmentId": "2"
+ }
+ ]
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/ketcher-autotests/tests/test-data/Molfiles-V2000/one-attachment-point-added-in-micro-mode-expected.mol b/ketcher-autotests/tests/test-data/Molfiles-V2000/one-attachment-point-added-in-micro-mode-expected.mol
new file mode 100644
index 0000000000..1d1eacbd41
--- /dev/null
+++ b/ketcher-autotests/tests/test-data/Molfiles-V2000/one-attachment-point-added-in-micro-mode-expected.mol
@@ -0,0 +1,24 @@
+
+ Ketcher 6112411462D 1 1.00000 0.00000 0
+
+ 7 7 0 0 0 0 0 0 0 0999 V2000
+ 13.8348 -8.0001 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 15.5652 -7.9996 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 14.7016 -7.5000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 15.5652 -9.0005 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 13.8348 -9.0050 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 14.7038 -9.5000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 14.7022 -6.5000 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0
+ 3 1 2 0 0 0
+ 1 5 1 0 0 0
+ 5 6 2 0 0 0
+ 6 4 1 0 0 0
+ 4 2 2 0 0 0
+ 2 3 1 0 0 0
+ 3 7 1 0 0 0
+M STY 1 1 SUP
+M SLB 1 1 1
+M SAP 1 1 3 7 1
+M SAL 1 7 3 1 5 6 4 2 7
+M SDS EXP 1 1
+M END
diff --git a/ketcher-autotests/tests/test-data/Molfiles-V3000/chem-connected-to-micro-structure-expected.mol b/ketcher-autotests/tests/test-data/Molfiles-V3000/chem-connected-to-micro-structure-expected.mol
new file mode 100644
index 0000000000..431155c83b
--- /dev/null
+++ b/ketcher-autotests/tests/test-data/Molfiles-V3000/chem-connected-to-micro-structure-expected.mol
@@ -0,0 +1,74 @@
+
+ -INDIGO-06142409592D
+
+ 0 0 0 0 0 0 0 0 0 0 0 V3000
+M V30 BEGIN CTAB
+M V30 COUNTS 8 8 1 0 0
+M V30 BEGIN ATOM
+M V30 1 C 10.569 -8.0 0.0 0
+M V30 2 C 12.2993 -7.99959 0.0 0
+M V30 3 C 11.4358 -7.49997 0.0 0
+M V30 4 C 12.2993 -9.00053 0.0 0
+M V30 5 C 10.569 -9.00502 0.0 0
+M V30 6 C 11.438 -9.50003 0.0 0
+M V30 7 H 11.4364 -6.49997 0.0 0
+M V30 8 A6OH 14.9592 -7.2 0.0 0 CLASS=LINKER ATTCHORD=(2 3 Br)
+M V30 END ATOM
+M V30 BEGIN BOND
+M V30 1 2 3 1
+M V30 2 1 1 5
+M V30 3 2 5 6
+M V30 4 1 6 4
+M V30 5 2 4 2
+M V30 6 1 2 3
+M V30 7 1 3 7
+M V30 8 1 3 8
+M V30 END BOND
+M V30 BEGIN SGROUP
+M V30 1 SUP 1 ATOMS=(7 3 1 5 6 4 2 7) BRKXYZ=(9 0.000000 0.000000 0.000000 0-
+M V30 .000000 0.000000 0.000000 0.000000 0.000000 0.000000) BRKXYZ=(9 0.0000-
+M V30 00 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.00-
+M V30 0000) ESTATE=E SAP=(3 3 7 1)
+M V30 END SGROUP
+M V30 END CTAB
+M V30 BEGIN TEMPLATE
+M V30 TEMPLATE 1 LINKER/A6OH/A6OH
+M V30 BEGIN CTAB
+M V30 COUNTS 10 9 3 0 0
+M V30 BEGIN ATOM
+M V30 1 N 3.18377 0.0 0.0 0
+M V30 2 C 2.2373 0.446805 0.0 0
+M V30 3 C 1.37675 -0.148888 0.0 0
+M V30 4 C 0.430277 0.297846 0.0 0
+M V30 5 C -0.430277 -0.297846 0.0 0
+M V30 6 C -1.37668 0.148888 0.0 0
+M V30 7 C -2.2373 -0.446805 0.0 0
+M V30 8 O -3.18377 0.0 0.0 0
+M V30 9 H 3.8718 0.476373 0.0 0
+M V30 10 H -3.8718 -0.476373 0.0 0
+M V30 END ATOM
+M V30 BEGIN BOND
+M V30 1 1 1 2
+M V30 2 1 2 3
+M V30 3 1 3 4
+M V30 4 1 4 5
+M V30 5 1 5 6
+M V30 6 1 6 7
+M V30 7 1 7 8
+M V30 8 1 1 9
+M V30 9 1 8 10
+M V30 END BOND
+M V30 BEGIN SGROUP
+M V30 1 SUP 1 ATOMS=(1 10) XBONDS=(1 9) BRKXYZ=(9 0.344012 0.238187 0.000000-
+M V30 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000) LABEL=H CLASS=-
+M V30 LGRP
+M V30 2 SUP 2 ATOMS=(1 9) XBONDS=(1 8) BRKXYZ=(9 -0.344012 -0.238187 0.00000-
+M V30 0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000) LABEL=H CLASS-
+M V30 =LGRP
+M V30 3 SUP 3 ATOMS=(8 1 2 3 4 5 6 7 8) XBONDS=(2 8 9) BRKXYZ=(9 0.344012 0.-
+M V30 238187 0.000000 -0.344012 -0.238187 0.000000 0.000000 0.000000 0.00000-
+M V30 0) LABEL=A6OH CLASS=LINKER SAP=(3 8 10 Al) SAP=(3 1 9 Br)
+M V30 END SGROUP
+M V30 END CTAB
+M V30 END TEMPLATE
+M END
diff --git a/ketcher-autotests/tests/test-data/Molfiles-V3000/one-attachment-point-added-in-micro-mode-expected.mol b/ketcher-autotests/tests/test-data/Molfiles-V3000/one-attachment-point-added-in-micro-mode-expected.mol
new file mode 100644
index 0000000000..65819df0a6
--- /dev/null
+++ b/ketcher-autotests/tests/test-data/Molfiles-V3000/one-attachment-point-added-in-micro-mode-expected.mol
@@ -0,0 +1,32 @@
+
+ -INDIGO-06102408392D
+
+ 0 0 0 0 0 0 0 0 0 0 0 V3000
+M V30 BEGIN CTAB
+M V30 COUNTS 7 7 1 0 0
+M V30 BEGIN ATOM
+M V30 1 C 13.8348 -8.0 0.0 0
+M V30 2 C 15.5652 -7.99959 0.0 0
+M V30 3 C 14.7016 -7.49997 0.0 0
+M V30 4 C 15.5652 -9.00053 0.0 0
+M V30 5 C 13.8348 -9.00502 0.0 0
+M V30 6 C 14.7038 -9.50003 0.0 0
+M V30 7 H 14.7022 -6.49997 0.0 0
+M V30 END ATOM
+M V30 BEGIN BOND
+M V30 1 2 3 1
+M V30 2 1 1 5
+M V30 3 2 5 6
+M V30 4 1 6 4
+M V30 5 2 4 2
+M V30 6 1 2 3
+M V30 7 1 3 7
+M V30 END BOND
+M V30 BEGIN SGROUP
+M V30 1 SUP 1 ATOMS=(7 3 1 5 6 4 2 7) BRKXYZ=(9 0.000000 0.000000 0.000000 0-
+M V30 .000000 0.000000 0.000000 0.000000 0.000000 0.000000) BRKXYZ=(9 0.0000-
+M V30 00 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.00-
+M V30 0000) ESTATE=E SAP=(3 3 7 1)
+M V30 END SGROUP
+M V30 END CTAB
+M END
diff --git a/ketcher-autotests/tests/test-data/SDF/one-attachment-point-added-in-micro-modesdfv2000-expected.sdf b/ketcher-autotests/tests/test-data/SDF/one-attachment-point-added-in-micro-modesdfv2000-expected.sdf
new file mode 100644
index 0000000000..275d1bbc1b
--- /dev/null
+++ b/ketcher-autotests/tests/test-data/SDF/one-attachment-point-added-in-micro-modesdfv2000-expected.sdf
@@ -0,0 +1,27 @@
+
+ -INDIGO-06112411552D
+
+ 7 7 0 0 0 0 0 0 0 0999 V2000
+ 13.8348 -8.0001 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 15.5652 -7.9996 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 14.7016 -7.5000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 15.5652 -9.0005 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 13.8348 -9.0050 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 14.7038 -9.5000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 14.7022 -6.5000 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0
+ 3 1 2 0 0 0 0
+ 1 5 1 0 0 0 0
+ 5 6 2 0 0 0 0
+ 6 4 1 0 0 0 0
+ 4 2 2 0 0 0 0
+ 2 3 1 0 0 0 0
+ 3 7 1 0 0 0 0
+M STY 1 1 SUP
+M SLB 1 1 1
+M SAL 1 7 3 1 5 6 4 2 7
+M SDS EXP 1 1
+M SAP 1 1 3 7 1
+M SDI 1 4 0.0000 0.0000 0.0000 0.0000
+M SDI 1 4 0.0000 0.0000 0.0000 0.0000
+M END
+$$$$
diff --git a/ketcher-autotests/tests/test-data/SDF/one-attachment-point-added-in-micro-modesdfv3000-expected.sdf b/ketcher-autotests/tests/test-data/SDF/one-attachment-point-added-in-micro-modesdfv3000-expected.sdf
new file mode 100644
index 0000000000..9ed06dca1b
--- /dev/null
+++ b/ketcher-autotests/tests/test-data/SDF/one-attachment-point-added-in-micro-modesdfv3000-expected.sdf
@@ -0,0 +1,33 @@
+
+ -INDIGO-06112412052D
+
+ 0 0 0 0 0 0 0 0 0 0 0 V3000
+M V30 BEGIN CTAB
+M V30 COUNTS 7 7 1 0 0
+M V30 BEGIN ATOM
+M V30 1 C 13.8348 -8.0 0.0 0
+M V30 2 C 15.5652 -7.99959 0.0 0
+M V30 3 C 14.7016 -7.49997 0.0 0
+M V30 4 C 15.5652 -9.00053 0.0 0
+M V30 5 C 13.8348 -9.00502 0.0 0
+M V30 6 C 14.7038 -9.50003 0.0 0
+M V30 7 H 14.7022 -6.49997 0.0 0
+M V30 END ATOM
+M V30 BEGIN BOND
+M V30 1 2 3 1
+M V30 2 1 1 5
+M V30 3 2 5 6
+M V30 4 1 6 4
+M V30 5 2 4 2
+M V30 6 1 2 3
+M V30 7 1 3 7
+M V30 END BOND
+M V30 BEGIN SGROUP
+M V30 1 SUP 1 ATOMS=(7 3 1 5 6 4 2 7) BRKXYZ=(9 0.000000 0.000000 0.000000 0-
+M V30 .000000 0.000000 0.000000 0.000000 0.000000 0.000000) BRKXYZ=(9 0.0000-
+M V30 00 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.00-
+M V30 0000) ESTATE=E SAP=(3 3 7 1)
+M V30 END SGROUP
+M V30 END CTAB
+M END
+$$$$
diff --git a/ketcher-autotests/tests/utils/canvas/atoms/superatomAttachmentPoints.ts b/ketcher-autotests/tests/utils/canvas/atoms/superatomAttachmentPoints.ts
index df4a6f935a..eb1d65fd54 100644
--- a/ketcher-autotests/tests/utils/canvas/atoms/superatomAttachmentPoints.ts
+++ b/ketcher-autotests/tests/utils/canvas/atoms/superatomAttachmentPoints.ts
@@ -11,3 +11,13 @@ export async function addSuperatomAttachmentPoint(
await clickOnAtom(page, atomLabel, atomIndex, 'right');
await page.getByText('Add attachment point').click();
}
+
+export async function removeSuperatomAttachmentPoint(
+ page: Page,
+ atomLabel: AtomLabelType,
+ atomIndex: number,
+) {
+ await page.keyboard.press('Escape');
+ await clickOnAtom(page, atomLabel, atomIndex, 'right');
+ await page.getByText('Remove attachment point').click();
+}