diff --git a/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts b/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts new file mode 100644 index 0000000000..b927368ca1 --- /dev/null +++ b/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts @@ -0,0 +1,156 @@ +import { test } from '@playwright/test'; +import { + waitForPageInit, + Bases, + Peptides, + selectMonomer, + takeEditorScreenshot, + clickOnTheCanvas, +} from '@utils'; +import { turnOnMacromoleculesEditor } from '@utils/macromolecules'; +import { goToRNATab, MonomerLocationTabs } from '@utils/macromolecules/library'; + +interface IAmbiguousMonomerName { + testDescription: string; + AmbiguousMonomerName: Peptides | Bases; + MonomerLocationTab: MonomerLocationTabs; + // Set shouldFail to true if you expect test to fail because of existed bug and put issues link to issueNumber + shouldFail?: boolean; + // issueNumber is mandatory if shouldFail === true + issueNumber?: string; + // set pageReloadNeeded to true if you need to restart ketcher before test (f.ex. to restart font renderer) + pageReloadNeeded?: boolean; +} + +test.beforeEach(async ({ page }) => { + await waitForPageInit(page); + await turnOnMacromoleculesEditor(page); +}); + +const AmbiguousMonomers: IAmbiguousMonomerName[] = [ + { + testDescription: "1. 'X' ambiguous peptide", + AmbiguousMonomerName: Peptides.X, + MonomerLocationTab: MonomerLocationTabs.PEPTIDES, + }, + { + testDescription: "2. 'B' ambiguous peptide", + AmbiguousMonomerName: Peptides.B, + MonomerLocationTab: MonomerLocationTabs.PEPTIDES, + }, + { + testDescription: "3. 'J' ambiguous peptide", + AmbiguousMonomerName: Peptides.J, + MonomerLocationTab: MonomerLocationTabs.PEPTIDES, + }, + { + testDescription: "4. 'Z' ambiguous peptide", + AmbiguousMonomerName: Peptides.Z, + MonomerLocationTab: MonomerLocationTabs.PEPTIDES, + }, + { + testDescription: "5. 'N' ambiguous DNA base", + AmbiguousMonomerName: Bases.DNA_N, + MonomerLocationTab: MonomerLocationTabs.BASES, + }, + { + testDescription: "6. 'B' ambiguous DNA base", + AmbiguousMonomerName: Bases.DNA_B, + MonomerLocationTab: MonomerLocationTabs.BASES, + }, + { + testDescription: "7. 'H' ambiguous DNA base", + AmbiguousMonomerName: Bases.DNA_H, + MonomerLocationTab: MonomerLocationTabs.BASES, + }, + { + testDescription: "8. 'K' ambiguous DNA base", + AmbiguousMonomerName: Bases.DNA_K, + MonomerLocationTab: MonomerLocationTabs.BASES, + }, + { + testDescription: "9. 'W' ambiguous DNA base", + AmbiguousMonomerName: Bases.DNA_W, + MonomerLocationTab: MonomerLocationTabs.BASES, + }, + { + testDescription: "10. 'Y' ambiguous DNA base", + AmbiguousMonomerName: Bases.DNA_Y, + MonomerLocationTab: MonomerLocationTabs.BASES, + }, + { + testDescription: "11. 'N' ambiguous RNA base", + AmbiguousMonomerName: Bases.RNA_N, + MonomerLocationTab: MonomerLocationTabs.BASES, + }, + { + testDescription: "12. 'B' ambiguous RNA base", + AmbiguousMonomerName: Bases.RNA_B, + MonomerLocationTab: MonomerLocationTabs.BASES, + }, + { + testDescription: "13. 'H' ambiguous RNA base", + AmbiguousMonomerName: Bases.RNA_H, + MonomerLocationTab: MonomerLocationTabs.BASES, + }, + { + testDescription: "14. 'K' ambiguous RNA base", + AmbiguousMonomerName: Bases.RNA_K, + MonomerLocationTab: MonomerLocationTabs.BASES, + }, + { + testDescription: "15. 'W' ambiguous RNA base", + AmbiguousMonomerName: Bases.RNA_W, + MonomerLocationTab: MonomerLocationTabs.BASES, + }, + { + testDescription: "16. 'Y' ambiguous RNA base", + AmbiguousMonomerName: Bases.RNA_Y, + MonomerLocationTab: MonomerLocationTabs.BASES, + }, + { + testDescription: "17. 'M' ambiguous base", + AmbiguousMonomerName: Bases.M, + MonomerLocationTab: MonomerLocationTabs.BASES, + }, + { + testDescription: "18. 'R' ambiguous base", + AmbiguousMonomerName: Bases.R, + MonomerLocationTab: MonomerLocationTabs.BASES, + }, + { + testDescription: "19. 'S' ambiguous base", + AmbiguousMonomerName: Bases.S, + MonomerLocationTab: MonomerLocationTabs.BASES, + }, + { + testDescription: "20. 'V' ambiguous base", + AmbiguousMonomerName: Bases.V, + MonomerLocationTab: MonomerLocationTabs.BASES, + }, +]; + +test.describe('Put ambiguous monomer on the canvas from library:', () => { + for (const AmbiguousMonomer of AmbiguousMonomers) { + test(`${AmbiguousMonomer.testDescription}`, async ({ page }) => { + /* + Test task: https://github.com/epam/ketcher/issues/5558 + 8. Verify the addition of ambuguous monomers to the canvas + Case: + 1. Find monomer at the library and click on it + 2. Click at the center of canvas + 3. Take screenshot of the canvas to make sure selected monomer appeared on the canvas + */ + await goToRNATab(page); + await selectMonomer(page, AmbiguousMonomer.AmbiguousMonomerName); + await clickOnTheCanvas(page, 0, 0); + await takeEditorScreenshot(page); + + // Test should be skipped if related bug exists + test.fixme( + AmbiguousMonomer.shouldFail === true, + `That test fails because of ${AmbiguousMonomer.issueNumber} issue.`, + ); + }); + } +}); diff --git a/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-1-X-ambiguous-peptide-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-1-X-ambiguous-peptide-1-chromium-linux.png new file mode 100644 index 0000000000..8c03b69e98 Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-1-X-ambiguous-peptide-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-10-Y-ambiguous-DNA-base-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-10-Y-ambiguous-DNA-base-1-chromium-linux.png new file mode 100644 index 0000000000..20dae08496 Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-10-Y-ambiguous-DNA-base-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-11-N-ambiguous-RNA-base-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-11-N-ambiguous-RNA-base-1-chromium-linux.png new file mode 100644 index 0000000000..1131f0fe95 Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-11-N-ambiguous-RNA-base-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-12-B-ambiguous-RNA-base-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-12-B-ambiguous-RNA-base-1-chromium-linux.png new file mode 100644 index 0000000000..d813922639 Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-12-B-ambiguous-RNA-base-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-13-H-ambiguous-RNA-base-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-13-H-ambiguous-RNA-base-1-chromium-linux.png new file mode 100644 index 0000000000..ccfe2e8e83 Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-13-H-ambiguous-RNA-base-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-14-K-ambiguous-RNA-base-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-14-K-ambiguous-RNA-base-1-chromium-linux.png new file mode 100644 index 0000000000..2412c8a6f9 Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-14-K-ambiguous-RNA-base-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-15-W-ambiguous-RNA-base-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-15-W-ambiguous-RNA-base-1-chromium-linux.png new file mode 100644 index 0000000000..72b42d15fa Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-15-W-ambiguous-RNA-base-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-16-Y-ambiguous-RNA-base-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-16-Y-ambiguous-RNA-base-1-chromium-linux.png new file mode 100644 index 0000000000..e522c8c7f8 Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-16-Y-ambiguous-RNA-base-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-17-M-ambiguous-base-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-17-M-ambiguous-base-1-chromium-linux.png new file mode 100644 index 0000000000..fca295d5b7 Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-17-M-ambiguous-base-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-18-R-ambiguous-base-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-18-R-ambiguous-base-1-chromium-linux.png new file mode 100644 index 0000000000..64a139cf38 Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-18-R-ambiguous-base-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-19-S-ambiguous-base-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-19-S-ambiguous-base-1-chromium-linux.png new file mode 100644 index 0000000000..6f72a8fbf0 Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-19-S-ambiguous-base-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-2-B-ambiguous-peptide-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-2-B-ambiguous-peptide-1-chromium-linux.png new file mode 100644 index 0000000000..a1c14598c9 Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-2-B-ambiguous-peptide-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-20-V-ambiguous-base-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-20-V-ambiguous-base-1-chromium-linux.png new file mode 100644 index 0000000000..e660162747 Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-20-V-ambiguous-base-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-3-J-ambiguous-peptide-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-3-J-ambiguous-peptide-1-chromium-linux.png new file mode 100644 index 0000000000..a2b1107872 Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-3-J-ambiguous-peptide-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-4-Z-ambiguous-peptide-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-4-Z-ambiguous-peptide-1-chromium-linux.png new file mode 100644 index 0000000000..837b0940f6 Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-4-Z-ambiguous-peptide-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-5-N-ambiguous-DNA-base-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-5-N-ambiguous-DNA-base-1-chromium-linux.png new file mode 100644 index 0000000000..98d6074b99 Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-5-N-ambiguous-DNA-base-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-6-B-ambiguous-DNA-base-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-6-B-ambiguous-DNA-base-1-chromium-linux.png new file mode 100644 index 0000000000..8bf2561dde Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-6-B-ambiguous-DNA-base-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-7-H-ambiguous-DNA-base-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-7-H-ambiguous-DNA-base-1-chromium-linux.png new file mode 100644 index 0000000000..6fecc75356 Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-7-H-ambiguous-DNA-base-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-8-K-ambiguous-DNA-base-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-8-K-ambiguous-DNA-base-1-chromium-linux.png new file mode 100644 index 0000000000..5742baaff8 Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-8-K-ambiguous-DNA-base-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-9-W-ambiguous-DNA-base-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-9-W-ambiguous-DNA-base-1-chromium-linux.png new file mode 100644 index 0000000000..ad81ac688c Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Ambiguous-Monomers/ambiguous-monomer-add-to-canvas.spec.ts-snapshots/Put-ambiguous-monomer-on-the-canvas-from-library-9-W-ambiguous-DNA-base-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Macromolecule-editor/RNA-Builder/rna-library.spec.ts b/ketcher-autotests/tests/Macromolecule-editor/RNA-Builder/rna-library.spec.ts index 5df8cb9888..100c60cc32 100644 --- a/ketcher-autotests/tests/Macromolecule-editor/RNA-Builder/rna-library.spec.ts +++ b/ketcher-autotests/tests/Macromolecule-editor/RNA-Builder/rna-library.spec.ts @@ -42,15 +42,16 @@ import { pressNewPresetButton, toggleBasesAccordion, toggleNucleotidesAccordion, - togglePhosphatesAccordion, toggleRnaBuilderAccordion, toggleSugarsAccordion, } from '@utils/macromolecules/rnaBuilder'; import { Chems } from '@utils/selectors/macromoleculeEditor'; import { goToCHEMTab, + goToMonomerLocationTab, goToPeptidesTab, goToRNATab, + MonomerLocationTabs, } from '@utils/macromolecules/library'; async function drawThreeMonomers(page: Page) { @@ -1385,16 +1386,6 @@ test.describe('RNA Library', () => { await page.getByTestId('cancel-btn').click(); }); - enum MonomerLocationTabs { - PEPTIDES = 'Peptides', - PRESETS = 'Presets', - SUGARS = 'Sugars', - BASES = 'Bases', - PHOSPHATES = 'Phosphates', - NUCLEOTIDES = 'Nucleotides', - CHEM = 'CHEM', - } - interface ISearchString { testDescription: string; SearchString: string; @@ -1408,42 +1399,6 @@ test.describe('RNA Library', () => { pageReloadNeeded?: boolean; } - async function goToMonomerLocationTab( - page: Page, - monomerLocation: MonomerLocationTabs, - ) { - switch (monomerLocation) { - case 'Peptides': - await goToPeptidesTab(page); - break; - case 'Presets': - await goToRNATab(page); - // Presets tab openned by default - break; - case 'Sugars': - await goToRNATab(page); - await toggleSugarsAccordion(page); - break; - case 'Bases': - await goToRNATab(page); - await toggleBasesAccordion(page); - break; - case 'Phosphates': - await goToRNATab(page); - await togglePhosphatesAccordion(page); - break; - case 'Nucleotides': - await toggleNucleotidesAccordion(page); - break; - case 'CHEM': - await goToCHEMTab(page); - break; - default: - await goToRNATab(page); - break; - } - } - async function searchMonomerByName(page: Page, monomerName: string) { const rnaLibrarySearch = page.getByTestId('monomer-library-input'); await rnaLibrarySearch.fill(monomerName); @@ -1678,7 +1633,7 @@ test.describe('RNA Library', () => { }) => { /* Test task: https://github.com/epam/ketcher/issues/5558 - Verify ambiguous monomer search functionality in the library + 7. Verify ambiguous monomer search functionality in the library Case: 1. Fill Search field with value 2. Switch to monomer's tab to see it diff --git a/ketcher-autotests/tests/utils/macromolecules/library.ts b/ketcher-autotests/tests/utils/macromolecules/library.ts index c0053a834d..632410b3c0 100644 --- a/ketcher-autotests/tests/utils/macromolecules/library.ts +++ b/ketcher-autotests/tests/utils/macromolecules/library.ts @@ -5,6 +5,12 @@ import { PEPTIDES_TAB, RNA_TAB, } from '@constants/testIdConstants'; +import { + toggleSugarsAccordion, + toggleBasesAccordion, + togglePhosphatesAccordion, + toggleNucleotidesAccordion, +} from './rnaBuilder'; export async function goToRNATab(page: Page) { await page.getByTestId(FAVORITES_TAB).click(); @@ -17,3 +23,49 @@ export async function goToCHEMTab(page: Page) { export async function goToPeptidesTab(page: Page) { await page.getByTestId(PEPTIDES_TAB).click(); } + +export enum MonomerLocationTabs { + PEPTIDES = 'Peptides', + PRESETS = 'Presets', + SUGARS = 'Sugars', + BASES = 'Bases', + PHOSPHATES = 'Phosphates', + NUCLEOTIDES = 'Nucleotides', + CHEM = 'CHEM', +} + +export async function goToMonomerLocationTab( + page: Page, + monomerLocation: MonomerLocationTabs, +) { + switch (monomerLocation) { + case 'Peptides': + await goToPeptidesTab(page); + break; + case 'Presets': + await goToRNATab(page); + // Presets tab openned by default + break; + case 'Sugars': + await goToRNATab(page); + await toggleSugarsAccordion(page); + break; + case 'Bases': + await goToRNATab(page); + await toggleBasesAccordion(page); + break; + case 'Phosphates': + await goToRNATab(page); + await togglePhosphatesAccordion(page); + break; + case 'Nucleotides': + await toggleNucleotidesAccordion(page); + break; + case 'CHEM': + await goToCHEMTab(page); + break; + default: + await goToRNATab(page); + break; + } +} diff --git a/ketcher-autotests/tests/utils/selectors/templateModal.ts b/ketcher-autotests/tests/utils/selectors/templateModal.ts index 881af36f31..f974c34d70 100644 --- a/ketcher-autotests/tests/utils/selectors/templateModal.ts +++ b/ketcher-autotests/tests/utils/selectors/templateModal.ts @@ -99,6 +99,9 @@ export enum Peptides { X = '_A___Alanine_C___Cysteine_D___Aspartic acid_E___Glutamic acid_F___Phenylalanine_G___Glycine_H___' + 'Histidine_I___Isoleucine_K___Lysine_L___Leucine_M___Methionine_N___Asparagine_O___Pyrrolysine_P__' + '_Proline_Q___Glutamine_R___Arginine_S___Serine_T___Threonine_U___Selenocysteine_V___Valine_W___Tryptophan_Y___Tyrosine', + B = '_D___Aspartic acid_N___Asparagine', + J = '_L___Leucine_I___Isoleucine', + Z = '_E___Glutamic acid_Q___Glutamine', } export enum Sugars { @@ -119,8 +122,23 @@ export enum Bases { NBebnzylAdenine = 'baA___N-benzyl-adenine', TClampOMe = 'clA___T-clamp OMe', DNA_N = '_A___Adenine_C___Cytosine_G___Guanine_T___Thymine', + DNA_B = '_C___Cytosine_G___Guanine_T___Thymine', + DNA_D = '_A___Adenine_G___Guanine_T___Thymine', + DNA_H = '_A___Adenine_C___Cytosine_T___Thymine', + DNA_K = '_G___Guanine_T___Thymine', + DNA_W = '_A___Adenine_T___Thymine', + DNA_Y = '_C___Cytosine_T___Thymine', RNA_N = '_A___Adenine_C___Cytosine_G___Guanine_U___Uracil', + RNA_B = '_C___Cytosine_G___Guanine_U___Uracil', + RNA_D = '_A___Adenine_G___Guanine_U___Uracil', + RNA_H = '_A___Adenine_C___Cytosine_U___Uracil', + RNA_K = '_G___Guanine_U___Uracil', + RNA_W = '_A___Adenine_U___Uracil', + RNA_Y = '_C___Cytosine_U___Uracil', M = '_A___Adenine_C___Cytosine', + R = '_A___Adenine_G___Guanine', + S = '_C___Cytosine_G___Guanine', + V = '_A___Adenine_C___Cytosine_G___Guanine', } export async function selectBase(baseName: Bases, page: Page) {