Skip to content

Commit 300818d

Browse files
authored
Autotests: #5984 - autotests introduce hydrogen bonds in macromolecules mode (#6000)
* Monomer on Micro save to KET uncomment out * Verify that user can save/load macromolecule structures with hydrogen bonds to a .ket file * Verify that only one hydrogen bond can be established between two monomers * Verify that hydrogen bonds don't require attachment points and can be established multiple times for one monomer * 1. Verify that only one hydrogen bond can be established between two monomers 2. Verify error message when trying to establish multiple hydrogen bonds between the same two monomers(error message: "Unable to establish multiple hydrogen bonds between two monomers * Verify error message when trying to establish hydrogen bond between monomers connected by a single bond(an error message: "Unable to establish a hydrogen bond between two monomers connected with a single bond.) * Verify that hydrogen bonds behave as side-chain connections for layout purposes * Verify that hydrogen bonds are highlighted along with monomers when hovered over * 1. Verify that switching from macromolecules mode to small molecules mode hides hydrogen bonds if monomer got expanded 2. Verify that switching back to macromolecules mode restores the hydrogen bonds after monomer got collapsed * Verify that no "Edit Connection Points" dialog appears for hydrogen bonds * Verify undo/redo functionality when adding or removing hydrogen bonds in macromolecules mode * Verify deleting functionality of hydrogen bonds in macromolecules mode * Verify deleting functionality of hydrogen bonds in macromolecules mode * Verify switch to flex/snake/sequence modes functionality of hydrogen bonds in macromolecules mode * Verify that hydrogen bond option located and can be selected from the bond menu in the sidebar * Verify that hydrogen bonds cannot be established between small molecules in macromolecules mode * Bug fix pack * Small addition * Extra fix * One more fix * One more fix * one more
1 parent f873318 commit 300818d

File tree

1,449 files changed

+110789
-351
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,449 files changed

+110789
-351
lines changed

ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-attachment-points.spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ import {
1212
openStructurePasteFromClipboard,
1313
waitForSpinnerFinishedWork,
1414
selectClearCanvasTool,
15-
selectSingleBondTool,
15+
selectMacroBond,
1616
} from '@utils';
1717
import { pageReload } from '@utils/common/helpers';
18+
import { MacroBondTool } from '@utils/canvas/tools/selectNestedTool/types';
1819

1920
let page: Page;
2021
let sharedContext: BrowserContext;
@@ -353,7 +354,7 @@ test.describe('Monomer APs checks: ', () => {
353354
await zoomWithMouseWheel(page, -600);
354355

355356
await loadHELMFromClipboard(page, ambiguousMonomer.HELMString);
356-
await selectSingleBondTool(page);
357+
await selectMacroBond(page, MacroBondTool.SINGLE);
357358
await hoverMouseOverMonomer(page, ambiguousMonomer.monomerLocatorIndex);
358359
await takeEditorScreenshot(page, {
359360
masks: [page.getByTestId('polymer-library-preview')],

ketcher-autotests/tests/Macromolecule-editor/Chem-monomers/chem-add-to-canvas.spec.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ import {
33
clickInTheMiddleOfTheScreen,
44
openFileAndAddToCanvasMacro,
55
pressButton,
6-
selectSingleBondTool,
6+
selectMacroBond,
77
takeEditorScreenshot,
88
waitForPageInit,
99
} from '@utils';
10+
import { MacroBondTool } from '@utils/canvas/tools/selectNestedTool/types';
1011
import {
1112
hideMonomerPreview,
1213
turnOnMacromoleculesEditor,
@@ -47,7 +48,7 @@ test.describe('Actions with CHEM', () => {
4748
Description: CHEM name fits in its icon when placed on canvas.
4849
*/
4950
await openFileAndAddToCanvasMacro('KET/all-chems.ket', page);
50-
await selectSingleBondTool(page);
51+
await selectMacroBond(page, MacroBondTool.SINGLE);
5152
await takeEditorScreenshot(page);
5253
});
5354

@@ -60,7 +61,7 @@ test.describe('Actions with CHEM', () => {
6061
Description: APs are not redrawn incorrectly after opening the modal window.
6162
*/
6263
await openFileAndAddToCanvasMacro('KET/chems-not-connected.ket', page);
63-
await selectSingleBondTool(page);
64+
await selectMacroBond(page, MacroBondTool.SINGLE);
6465
await page.getByText('Test-6-Ch').locator('..').hover();
6566
await page.mouse.down();
6667
await page.getByText('A6OH').locator('..').hover();

ketcher-autotests/tests/Macromolecule-editor/Clear-Tool/clear-tool.spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ import {
33
addSingleMonomerToCanvas,
44
openFileAndAddToCanvasAsNewProject,
55
selectClearCanvasTool,
6+
selectMacroBond,
67
selectPartOfMolecules,
7-
selectSingleBondTool,
88
takeEditorScreenshot,
99
waitForPageInit,
1010
} from '@utils';
11+
import { MacroBondTool } from '@utils/canvas/tools/selectNestedTool/types';
1112
import {
1213
turnOnMacromoleculesEditor,
1314
turnOnMicromoleculesEditor,
@@ -67,7 +68,7 @@ test.describe('Clear Canvas Tool', () => {
6768
);
6869

6970
// Select bond tool
70-
await selectSingleBondTool(page);
71+
await selectMacroBond(page, MacroBondTool.SINGLE);
7172

7273
// Create bonds between peptides
7374
await bondTwoMonomers(page, peptide1, peptide2);

ketcher-autotests/tests/Macromolecule-editor/Erase-Tool/erase-tool.spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import {
1111
saveToFile,
1212
selectEraseTool,
1313
selectPartOfMolecules,
14-
selectSingleBondTool,
1514
selectSnakeLayoutModeTool,
1615
takeEditorScreenshot,
1716
waitForPageInit,
@@ -22,7 +21,9 @@ import {
2221
selectRectangleSelectionTool,
2322
Bases,
2423
selectAllStructuresOnCanvas,
24+
selectMacroBond,
2525
} from '@utils';
26+
import { MacroBondTool } from '@utils/canvas/tools/selectNestedTool/types';
2627
import {
2728
hideMonomerPreview,
2829
turnOnMacromoleculesEditor,
@@ -83,7 +84,7 @@ test.describe('Erase Tool', () => {
8384
);
8485

8586
// Select bond tool
86-
await selectSingleBondTool(page);
87+
await selectMacroBond(page, MacroBondTool.SINGLE);
8788

8889
// Create bonds between peptides
8990
await bondTwoMonomers(page, peptide1, peptide2);

ketcher-autotests/tests/Macromolecule-editor/Hotkeys/hotkeys.spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@ import { turnOnMacromoleculesEditor } from '@utils/macromolecules';
22
import { test } from '@playwright/test';
33
import {
44
openFileAndAddToCanvasMacro,
5-
selectSingleBondTool,
65
selectSequenceLayoutModeTool,
76
typeAllEnglishAlphabet,
87
takeEditorScreenshot,
98
takeLeftToolbarMacromoleculeScreenshot,
109
takeTopToolbarScreenshot,
1110
waitForPageInit,
1211
selectAllStructuresOnCanvas,
12+
selectMacroBond,
1313
} from '@utils';
14+
import { MacroBondTool } from '@utils/canvas/tools/selectNestedTool/types';
1415

1516
test.describe('Hotkeys', () => {
1617
test.beforeEach(async ({ page }) => {
@@ -75,7 +76,7 @@ test.describe('Hotkeys', () => {
7576
*/
7677
await page.keyboard.press('Delete');
7778
await takeLeftToolbarMacromoleculeScreenshot(page);
78-
await selectSingleBondTool(page);
79+
await selectMacroBond(page, MacroBondTool.SINGLE);
7980
await page.keyboard.press('Backspace');
8081
await takeLeftToolbarMacromoleculeScreenshot(page);
8182
await page.keyboard.press('Shift+Tab');
-238 Bytes
Loading

ketcher-autotests/tests/Macromolecule-editor/Import-Saving-Files/import-saving-idt.spec.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import {
2020
selectMacromoleculesPanelButton,
2121
MacromoleculesTopPanelButton,
2222
selectClearCanvasTool,
23-
selectSingleBondTool,
2423
waitForRender,
2524
takePolymerEditorScreenshot,
2625
openStructurePasteFromClipboard,
@@ -34,7 +33,9 @@ import {
3433
copyToClipboardByKeyboard,
3534
pasteFromClipboardByKeyboard,
3635
selectAllStructuresOnCanvas,
36+
selectMacroBond,
3737
} from '@utils';
38+
import { MacroBondTool } from '@utils/canvas/tools/selectNestedTool/types';
3839
import {
3940
closeErrorMessage,
4041
closeOpenStructure,
@@ -559,7 +560,7 @@ test.describe('Import-Saving .idt Files', () => {
559560
`/52MOErA/*/i2MOErC/*/32MOErT/`,
560561
);
561562
const bondLine = page.locator('g[pointer-events="stroke"]').first();
562-
await selectSingleBondTool(page);
563+
await selectMacroBond(page, MacroBondTool.SINGLE);
563564
await bondLine.hover();
564565
await takeEditorScreenshot(page);
565566
});
@@ -782,7 +783,7 @@ test.describe('Import-Saving .idt Files', () => {
782783
'IDT',
783784
`/52MOErA/*/i2MOErC/*/i2MOErG/*/i2MOErC/*/i2MOErG/*/iMe-dC/*G*A*/iMe-dC/*T*A*T*A*/iMe-dC/*G*/i2MOErC/*/i2MOErG/*/i2MOErC/*/i2MOErC/*/32MOErT/`,
784785
);
785-
await selectSingleBondTool(page);
786+
await selectMacroBond(page, MacroBondTool.SINGLE);
786787
await page.getByText('iMe').locator('..').nth(1).hover();
787788
await takeEditorScreenshot(page);
788789
});
@@ -806,7 +807,7 @@ test.describe('Import-Saving .idt Files', () => {
806807
'R2',
807808
'R1',
808809
);
809-
await selectSingleBondTool(page);
810+
await selectMacroBond(page, MacroBondTool.SINGLE);
810811
await page.getByText('iMe').locator('..').hover();
811812
await takeEditorScreenshot(page);
812813
});
@@ -836,7 +837,7 @@ test.describe('Import-Saving .idt Files', () => {
836837
'R3',
837838
'R4',
838839
);
839-
await selectSingleBondTool(page);
840+
await selectMacroBond(page, MacroBondTool.SINGLE);
840841
await page.getByText('iMe').locator('..').hover();
841842
await takeEditorScreenshot(page);
842843
});
@@ -933,7 +934,7 @@ test.describe('Import-Saving .idt Files', () => {
933934
await pasteFromClipboardAndAddToMacromoleculesCanvas('IDT', `/iMe-dC/`);
934935
await page.getByTestId('1Nal___3-(1-naphthyl)-alanine').click();
935936
await page.mouse.click(x, y);
936-
await selectSingleBondTool(page);
937+
await selectMacroBond(page, MacroBondTool.SINGLE);
937938
await page.getByText('1Nal').locator('..').first().click();
938939
await page.mouse.down();
939940
await page.getByText('iMe-dC').locator('..').first().hover();
@@ -954,7 +955,7 @@ test.describe('Import-Saving .idt Files', () => {
954955
await page.getByTestId('1Nal___3-(1-naphthyl)-alanine').click();
955956
await page.mouse.click(x, y);
956957
await selectSnakeLayoutModeTool(page);
957-
await selectSingleBondTool(page);
958+
await selectMacroBond(page, MacroBondTool.SINGLE);
958959
await page.getByText('1Nal').locator('..').first().click();
959960
await page.mouse.down();
960961
await page.getByText('iMe-dC').locator('..').first().hover();
@@ -975,7 +976,7 @@ test.describe('Import-Saving .idt Files', () => {
975976
await chooseTab(page, Tabs.Chem);
976977
await page.getByTestId('Test-6-Ch___Test-6-AP-Chem').click();
977978
await page.mouse.click(x, y);
978-
await selectSingleBondTool(page);
979+
await selectMacroBond(page, MacroBondTool.SINGLE);
979980
await page.getByText('iMe-dC').locator('..').click();
980981
await page.mouse.down();
981982
await page.getByText('Test-6-Ch').locator('..').first().hover();

0 commit comments

Comments
 (0)