Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/epam/ketcher into 6326-au…
Browse files Browse the repository at this point in the history
…totests-tests-for-support-for-single-atom-properties-in-macromolecules-mode
  • Loading branch information
Zhirnoff committed Jan 23, 2025
2 parents 1ead98e + ac8d70f commit 9caf541
Show file tree
Hide file tree
Showing 110 changed files with 5,481 additions and 65 deletions.
1 change: 1 addition & 0 deletions demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --passWithNoTests --watchAll=false",
"test:types": "tsc --noEmit",
"eject": "react-scripts eject",
"serve": "serve -s build"
},
Expand Down
1 change: 1 addition & 0 deletions example-ssr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"scripts": {
"dev": "next dev -p 5173",
"build": "next build",
"test:types": "tsc --noEmit",
"start": "next start",
"lint": "next lint"
},
Expand Down
4 changes: 2 additions & 2 deletions ketcher-autotests/constants/monomers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ export enum Chem {
export enum Nucleotides {
_2_damdA = '2-damdA___2,6-Diaminopurine',
_5hMedC = '5hMedC___Hydroxymethyl dC',
Super_G = 'Super G___8-aza-7-deazaguanosine',
Super_G = 'Super-G___8-aza-7-deazaguanosine',
AmMC6T = 'AmMC6T___Amino Modifier C6 dT',
Super_T = 'Super T___5-hydroxybutynl-2’-deoxyuridine',
Super_T = 'Super-T___5-hydroxybutynl-2’-deoxyuridine',
_5Br_dU = '5Br-dU___5-Bromo-deoxyuridine',
_5NitInd = '5NitInd___5-Nitroindole',
}
Expand Down
1 change: 1 addition & 0 deletions ketcher-autotests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"test:trace": "npx playwright test --trace on",
"check:code": "npm run check:types && npm run check:lint",
"check:types": "tsc --noEmit",
"test:types": "tsc --noEmit",
"check:lint": "eslint .",
"lint:fix": "eslint . --fix",
"prettier:write": "prettier --write \"./**/*.{js,ts}\" ",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import {
selectAllStructuresOnCanvas,
selectClearCanvasTool,
selectLayoutTool,
setHashSpacingOptionUnit,
setHashSpacingValue,
} from '@utils';
import {
FileType,
Expand Down Expand Up @@ -485,6 +487,90 @@ test.describe('Tests for API setMolecule/getMolecule', () => {
await takeEditorScreenshot(page);
});

test('The Hash spacing setting with pt option is applied, click on layout and it should be save to CDXML specification', async ({
page,
}) => {
/*
Test case: https://github.com/epam/Indigo/issues/2176
Description: Add new settings for ACS style for convert and layout functions
The Hash spacing setting is applied, click on layout and it should be save to CDXML specification
*/
await openFileAndAddToCanvas('KET/layout-with-catalyst.ket', page);
await openSettings(page);
await bondsSettings(page);
await setHashSpacingOptionUnit(page, 'pt-option');
await setHashSpacingValue(page, '54.8');
await pressButton(page, 'Apply');
await selectTopPanelButton(TopPanelButton.Layout, page);
await takeEditorScreenshot(page);
await verifyFileExport(
page,
'CDXML/layout-with-catalyst-pt-hash-spacing-expected.cdxml',
FileType.CDXML,
);
await openFileAndAddToCanvasAsNewProject(
'CDXML/layout-with-catalyst-pt-hash-spacing-expected.cdxml',
page,
);
await takeEditorScreenshot(page);
});

test('The Hash spacing setting with cm option is applied, click on layout and it should be save to CDXML specification', async ({
page,
}) => {
/*
Test case: https://github.com/epam/Indigo/issues/2176
Description: Add new settings for ACS style for convert and layout functions
The Hash spacing setting is applied, click on layout and it should be save to CDXML specification
*/
await openFileAndAddToCanvas('KET/layout-with-catalyst.ket', page);
await openSettings(page);
await bondsSettings(page);
await setHashSpacingOptionUnit(page, 'cm-option');
await setHashSpacingValue(page, '7.8');
await pressButton(page, 'Apply');
await selectTopPanelButton(TopPanelButton.Layout, page);
await takeEditorScreenshot(page);
await verifyFileExport(
page,
'CDXML/layout-with-catalyst-cm-hash-spacing-expected.cdxml',
FileType.CDXML,
);
await openFileAndAddToCanvasAsNewProject(
'CDXML/layout-with-catalyst-cm-hash-spacing-expected.cdxml',
page,
);
await takeEditorScreenshot(page);
});

test('The Hash spacing setting with inch option is applied, click on layout and it should be save to CDXML specification', async ({
page,
}) => {
/*
Test case: https://github.com/epam/Indigo/issues/2176
Description: Add new settings for ACS style for convert and layout functions
The Hash spacing setting is applied, click on layout and it should be save to CDXML specification
*/
await openFileAndAddToCanvas('KET/layout-with-catalyst.ket', page);
await openSettings(page);
await bondsSettings(page);
await setHashSpacingOptionUnit(page, 'inch-option');
await setHashSpacingValue(page, '7.8');
await pressButton(page, 'Apply');
await selectTopPanelButton(TopPanelButton.Layout, page);
await takeEditorScreenshot(page);
await verifyFileExport(
page,
'CDXML/layout-with-catalyst-inch-hash-spacing-expected.cdxml',
FileType.CDXML,
);
await openFileAndAddToCanvasAsNewProject(
'CDXML/layout-with-catalyst-inch-hash-spacing-expected.cdxml',
page,
);
await takeEditorScreenshot(page);
});

test('The Reaction component margin size setting with px option is applied, click on layout and it should be save to CDXML specification', async ({
page,
}) => {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ import {
setReactionMarginSizeValue,
openSettings,
selectLayoutTool,
setHashSpacingOptionUnit,
setHashSpacingValue,
} from '@utils';
import {
FileType,
verifyFileExport,
} from '@utils/files/receiveFileComparisonData';
import { getCml } from '@utils/formats';

async function openFileAddToCanvasTakeScreenshot(page: Page, fileName: string) {
Expand Down Expand Up @@ -589,6 +595,34 @@ test.describe('CML files', () => {
await takeEditorScreenshot(page);
});

test('The Hash spacing setting with pt option is applied, click on layout and it should be save to CML specification', async ({
page,
}) => {
/*
Test case: https://github.com/epam/Indigo/issues/2176
Description: Add new settings for ACS style for convert and layout functions
The Hash spacing setting is applied, click on layout and it should be save to CML specification
*/
await openFileAndAddToCanvas('KET/layout-with-catalyst.ket', page);
await openSettings(page);
await bondsSettings(page);
await setHashSpacingOptionUnit(page, 'pt-option');
await setHashSpacingValue(page, '54.8');
await pressButton(page, 'Apply');
await selectLayoutTool(page);
await takeEditorScreenshot(page);
await verifyFileExport(
page,
'CML/layout-with-catalyst-pt-hash-spacing-expected.cml',
FileType.CML,
);
await openFileAndAddToCanvasAsNewProject(
'CML/layout-with-catalyst-pt-hash-spacing-expected.cml',
page,
);
await takeEditorScreenshot(page);
});

test('The Reaction component margin size setting with cm option is applied, click on layout and it should be save to CML specification', async ({
page,
}) => {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
/* eslint-disable max-len */
import { expect, test } from '@playwright/test';
import {
bondsSettings,
openFileAndAddToCanvas,
openFileAndAddToCanvasAsNewProject,
openSettings,
pressButton,
scrollToDownInSetting,
selectLayoutTool,
setBondLengthOptionUnit,
setBondLengthValue,
setHashSpacingOptionUnit,
setHashSpacingValue,
setReactionMarginSizeOptionUnit,
setReactionMarginSizeValue,
takeEditorScreenshot,
Expand Down Expand Up @@ -98,6 +102,36 @@ test.describe('Ket files', () => {
);
});

test('The Hash spacing setting with px option is applied, click on layout and it should be saved to KET specification', async ({
page,
}) => {
/*
Test case: https://github.com/epam/Indigo/issues/2176
Description: Add new settings for ACS style for convert and layout functions.
The Hash spacing setting is applied, click on layout, and it should be saved to KET specification.
*/
await openFileAndAddToCanvas('KET/layout-with-catalyst.ket', page);
await takeEditorScreenshot(page);
await openSettings(page);
await bondsSettings(page);
await scrollToDownInSetting(page);
await setHashSpacingOptionUnit(page, 'px-option');
await setHashSpacingValue(page, '57.8');
await pressButton(page, 'Apply');
await selectLayoutTool(page);
await takeEditorScreenshot(page);
await verifyFileExport(
page,
'KET/layout-with-catalyst-px-hash-spacing-expected.ket',
FileType.KET,
);
await openFileAndAddToCanvasAsNewProject(
'KET/layout-with-catalyst-px-hash-spacing-expected.ket',
page,
);
await takeEditorScreenshot(page);
});

test('The Bond length setting with pt option is applied, click on layout and it should be save to KET specification', async ({
page,
}) => {
Expand All @@ -123,6 +157,35 @@ test.describe('Ket files', () => {
);
});

test('The Hash spacing setting with pt option is applied, click on layout and it should be save to KET specification', async ({
page,
}) => {
/*
Test case: https://github.com/epam/Indigo/issues/2176
Description: Add new settings for ACS style for convert and layout functions
The Hash spacing setting is applied, click on layout and it should be save to KET specification
*/
await openFileAndAddToCanvas('KET/layout-with-diagonally-arrow.ket', page);
await openSettings(page);
await bondsSettings(page);
await scrollToDownInSetting(page);
await setHashSpacingOptionUnit(page, 'pt-option');
await setHashSpacingValue(page, '27.8');
await pressButton(page, 'Apply');
await selectLayoutTool(page);
await takeEditorScreenshot(page);
await verifyFileExport(
page,
'KET/layout-with-diagonally-arrow-pt-hash-spacing-expected.ket',
FileType.KET,
);
await openFileAndAddToCanvasAsNewProject(
'KET/layout-with-diagonally-arrow-pt-hash-spacing-expected.ket',
page,
);
await takeEditorScreenshot(page);
});

test('The Bond length setting with inch option is applied, click on layout and it should be save to KET specification', async ({
page,
}) => {
Expand All @@ -148,6 +211,35 @@ test.describe('Ket files', () => {
);
});

test('The Hash spacing setting with inch option is applied, click on layout and it should be save to KET specification', async ({
page,
}) => {
/*
Test case: https://github.com/epam/Indigo/issues/2176
Description: Add new settings for ACS style for convert and layout functions
The Hash spacing setting is applied, click on layout and it should be save to KET specification
*/
await openFileAndAddToCanvas('KET/layout-with-long-molecule.ket', page);
await openSettings(page);
await bondsSettings(page);
await scrollToDownInSetting(page);
await setHashSpacingOptionUnit(page, 'inch-option');
await setHashSpacingValue(page, '1.8');
await pressButton(page, 'Apply');
await selectLayoutTool(page);
await takeEditorScreenshot(page);
await verifyFileExport(
page,
'KET/layout-with-long-molecule-inch-hash-spacing-expected.ket',
FileType.KET,
);
await openFileAndAddToCanvasAsNewProject(
'KET/layout-with-long-molecule-inch-hash-spacing-expected.ket',
page,
);
await takeEditorScreenshot(page);
});

test('The Reaction component margin size setting with px option is applied, click on layout and it should be save to KET specification', async ({
page,
}) => {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 9caf541

Please sign in to comment.