diff --git a/ketcher-autotests/tests/Macromolecule-editor/Chem-monomers/chem-add-to-canvas.spec.ts b/ketcher-autotests/tests/Macromolecule-editor/Chem-monomers/chem-add-to-canvas.spec.ts index 2ccc5d2c7e..519ab3686d 100644 --- a/ketcher-autotests/tests/Macromolecule-editor/Chem-monomers/chem-add-to-canvas.spec.ts +++ b/ketcher-autotests/tests/Macromolecule-editor/Chem-monomers/chem-add-to-canvas.spec.ts @@ -1,5 +1,9 @@ import { test } from '@playwright/test'; -import { clickInTheMiddleOfTheScreen, waitForPageInit } from '@utils'; +import { + clickInTheMiddleOfTheScreen, + takePageScreenshot, + waitForPageInit, +} from '@utils'; import { POLYMER_TOGGLER } from '../../../constants/testIdConstants'; /* @@ -20,9 +24,5 @@ test('Select chem and drag it to canvas', async ({ page }) => { // Click on #polymer-editor-canvas await clickInTheMiddleOfTheScreen(page); - // Take full page screenshot - await page.screenshot({ - path: 'tests/Macromolecule-editor/screenshots/chem-add-to-canvas.png', - fullPage: true, - }); + await takePageScreenshot(page); }); diff --git a/ketcher-autotests/tests/Macromolecule-editor/Chem-monomers/chem-add-to-canvas.spec.ts-snapshots/Select-chem-and-drag-it-to-canvas-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Chem-monomers/chem-add-to-canvas.spec.ts-snapshots/Select-chem-and-drag-it-to-canvas-1-chromium-linux.png new file mode 100644 index 0000000000..7588a62a83 Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Chem-monomers/chem-add-to-canvas.spec.ts-snapshots/Select-chem-and-drag-it-to-canvas-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Macromolecule-editor/Chem-monomers/chem-library.spec.ts b/ketcher-autotests/tests/Macromolecule-editor/Chem-monomers/chem-library.spec.ts index 2600b40f0d..6ea361d69b 100644 --- a/ketcher-autotests/tests/Macromolecule-editor/Chem-monomers/chem-library.spec.ts +++ b/ketcher-autotests/tests/Macromolecule-editor/Chem-monomers/chem-library.spec.ts @@ -1,11 +1,13 @@ import { test, expect } from '@playwright/test'; import { POLYMER_TOGGLER } from '../../../constants/testIdConstants'; import { waitForPageInit } from '@utils/common'; +import { takePageScreenshot } from '@utils'; test.describe('Open Ketcher', () => { test.beforeEach(async ({ page }) => { await waitForPageInit(page); }); + test('Switch to Polymer Editor', async ({ page }) => { /* Test case: #2496 - chem monomer library @@ -25,8 +27,6 @@ test.describe('Open Ketcher', () => { await page.getByTestId(POLYMER_TOGGLER).click(); await page.getByText('CHEM').click(); await expect(page.getByText('A6OH')).toBeVisible(); - await page.screenshot({ - path: 'tests/Macromolecule-editor/screenshots/chem-library.png', - }); + await takePageScreenshot(page); }); }); diff --git a/ketcher-autotests/tests/Macromolecule-editor/Chem-monomers/chem-library.spec.ts-snapshots/Open-Ketcher-Open-Chem-tab-in-library-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Chem-monomers/chem-library.spec.ts-snapshots/Open-Ketcher-Open-Chem-tab-in-library-1-chromium-linux.png new file mode 100644 index 0000000000..ce37d2b4a4 Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Chem-monomers/chem-library.spec.ts-snapshots/Open-Ketcher-Open-Chem-tab-in-library-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Macromolecule-editor/Erase-Tool/erase-tool.spec.ts b/ketcher-autotests/tests/Macromolecule-editor/Erase-Tool/erase-tool.spec.ts index 26b78c9ae9..ae6ec46f30 100644 --- a/ketcher-autotests/tests/Macromolecule-editor/Erase-Tool/erase-tool.spec.ts +++ b/ketcher-autotests/tests/Macromolecule-editor/Erase-Tool/erase-tool.spec.ts @@ -4,6 +4,7 @@ import { selectEraseTool, selectSingleBondTool, takeEditorScreenshot, + waitForPageInit, } from '@utils'; import { turnOnMacromoleculesEditor } from '@utils/macromolecules'; import { bondTwoMonomers } from '@utils/macromolecules/polymerBond'; @@ -11,9 +12,10 @@ import { bondTwoMonomers } from '@utils/macromolecules/polymerBond'; test.describe('Erase Tool', () => { test.beforeEach(async ({ page }) => { - await page.goto(''); + await waitForPageInit(page); await turnOnMacromoleculesEditor(page); }); + test('Delete monomer bonded with another monomers', async ({ page }) => { /* Test case: #2370 - "Erase" tool for macromolecules editor diff --git a/ketcher-autotests/tests/Macromolecule-editor/Favorites/favorites-add-to-canvas.spec.ts b/ketcher-autotests/tests/Macromolecule-editor/Favorites/favorites-add-to-canvas.spec.ts index 6b0aa412e8..933a5b7353 100644 --- a/ketcher-autotests/tests/Macromolecule-editor/Favorites/favorites-add-to-canvas.spec.ts +++ b/ketcher-autotests/tests/Macromolecule-editor/Favorites/favorites-add-to-canvas.spec.ts @@ -1,25 +1,25 @@ import { test } from '@playwright/test'; -import { POLYMER_TOGGLER } from '@constants/testIdConstants'; import { clickInTheMiddleOfTheScreen, - takePolymerEditorScreenshot, + takePageScreenshot, waitForPageInit, } from '@utils'; import { ALANINE, getFavoriteButtonSelector, } from '@utils/selectors/macromoleculeEditor'; +import { turnOnMacromoleculesEditor } from '@utils/macromolecules'; test('Add molecule to favorites, switch to Favorites tab and drag it to the canvas', async ({ page, }) => { await waitForPageInit(page); + await turnOnMacromoleculesEditor(page); - await page.getByTestId(POLYMER_TOGGLER).click(); await page.click(getFavoriteButtonSelector(ALANINE)); await page.getByText('Favorites').click(); await page.click(ALANINE); await clickInTheMiddleOfTheScreen(page); - await takePolymerEditorScreenshot(page); + await takePageScreenshot(page); }); diff --git a/ketcher-autotests/tests/Macromolecule-editor/Ket/ket-deserialize.spec.ts b/ketcher-autotests/tests/Macromolecule-editor/Ket/ket-deserialize.spec.ts index b7f77ee6a2..5b8062cbd3 100644 --- a/ketcher-autotests/tests/Macromolecule-editor/Ket/ket-deserialize.spec.ts +++ b/ketcher-autotests/tests/Macromolecule-editor/Ket/ket-deserialize.spec.ts @@ -1,12 +1,17 @@ import { test } from '@playwright/test'; -import { openFileAndAddToCanvas, takeEditorScreenshot } from '@utils'; +import { + openFileAndAddToCanvas, + takeEditorScreenshot, + waitForPageInit, +} from '@utils'; import { turnOnMacromoleculesEditor } from '@utils/macromolecules'; test.describe('Ket Deserialize', () => { test.beforeEach(async ({ page }) => { - await page.goto(''); + await waitForPageInit(page); await turnOnMacromoleculesEditor(page); }); + test('Open ket file with monomers and bonds', async ({ page }) => { /* Test case: #3230 - Support parsing KET file for macromolecules on ketcher side diff --git a/ketcher-autotests/tests/Macromolecule-editor/Peptides/peptides-add-to-canvas.spec.ts b/ketcher-autotests/tests/Macromolecule-editor/Peptides/peptides-add-to-canvas.spec.ts index 1b35202759..5e1b9e4dbd 100644 --- a/ketcher-autotests/tests/Macromolecule-editor/Peptides/peptides-add-to-canvas.spec.ts +++ b/ketcher-autotests/tests/Macromolecule-editor/Peptides/peptides-add-to-canvas.spec.ts @@ -1,7 +1,11 @@ import { test } from '@playwright/test'; -import { clickInTheMiddleOfTheScreen, waitForPageInit } from '@utils'; +import { + clickInTheMiddleOfTheScreen, + takePageScreenshot, + waitForPageInit, +} from '@utils'; import { ALANINE } from '@utils/selectors/macromoleculeEditor'; -import { POLYMER_TOGGLER } from '../../../constants/testIdConstants'; +import { turnOnMacromoleculesEditor } from '@utils/macromolecules'; /* Test case: #3063 - Add e2e tests for Macromolecule editor @@ -9,19 +13,10 @@ Test case: #3063 - Add e2e tests for Macromolecule editor test('Select peptide and drag it to canvas', async ({ page }) => { await waitForPageInit(page); + await turnOnMacromoleculesEditor(page); - // Click on POLYMER_TOGGLER - await page.getByTestId(POLYMER_TOGGLER).click(); - - // Click on
"A ★" await page.click(ALANINE); - - // Click on #polymer-editor-canvas await clickInTheMiddleOfTheScreen(page); - // Take full page screenshot - await page.screenshot({ - path: 'tests/Macromolecule-editor/screenshots/peptides-add-to-canvas.png', - fullPage: true, - }); + await takePageScreenshot(page); }); diff --git a/ketcher-autotests/tests/Macromolecule-editor/Peptides/peptides-add-to-canvas.spec.ts-snapshots/Select-peptide-and-drag-it-to-canvas-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Peptides/peptides-add-to-canvas.spec.ts-snapshots/Select-peptide-and-drag-it-to-canvas-1-chromium-linux.png new file mode 100644 index 0000000000..6fb92f85e6 Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Peptides/peptides-add-to-canvas.spec.ts-snapshots/Select-peptide-and-drag-it-to-canvas-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Macromolecule-editor/Polymer-Bond-Tool/attachment-point-rotation.spec.ts b/ketcher-autotests/tests/Macromolecule-editor/Polymer-Bond-Tool/attachment-point-rotation.spec.ts index 6e0231f218..4af329efc9 100644 --- a/ketcher-autotests/tests/Macromolecule-editor/Polymer-Bond-Tool/attachment-point-rotation.spec.ts +++ b/ketcher-autotests/tests/Macromolecule-editor/Polymer-Bond-Tool/attachment-point-rotation.spec.ts @@ -4,6 +4,8 @@ import { dragMouseTo, selectRectangleSelectionTool, selectSingleBondTool, + takePageScreenshot, + waitForPageInit, } from '@utils'; import { turnOnMacromoleculesEditor } from '@utils/macromolecules'; import { bondTwoMonomers } from '@utils/macromolecules/polymerBond'; @@ -11,7 +13,7 @@ import { bondTwoMonomers } from '@utils/macromolecules/polymerBond'; test.describe('Check attachment point rotation', () => { test.beforeEach(async ({ page }) => { - await page.goto(''); + await waitForPageInit(page); await turnOnMacromoleculesEditor(page); }); test('Select monomer and bonds and then hover monomer', async ({ page }) => { @@ -46,16 +48,12 @@ test.describe('Check attachment point rotation', () => { // Hover 1th peptide await peptide1.hover(); - await page.screenshot({ - path: 'tests/Macromolecule-editor/screenshots/attachment-point-rotation-1.png', - }); + await takePageScreenshot(page); // Hover 2nd peptide await peptide2.hover(); - await page.screenshot({ - path: 'tests/Macromolecule-editor/screenshots/attachment-point-rotation-2.png', - }); + await takePageScreenshot(page); }); test('Move monomer bonded with another monomers and check attachment points', async ({ @@ -87,9 +85,7 @@ test.describe('Check attachment point rotation', () => { // Hover 1th peptide await peptide1.hover(); - await page.screenshot({ - path: 'tests/Macromolecule-editor/screenshots/attachment-point-rotation-3.png', - }); + await takePageScreenshot(page); // Move selected monomer await selectRectangleSelectionTool(page); @@ -102,8 +98,6 @@ test.describe('Check attachment point rotation', () => { // Hover 1th peptide await peptide1.hover(); - await page.screenshot({ - path: 'tests/Macromolecule-editor/screenshots/attachment-point-rotation-4.png', - }); + await takePageScreenshot(page); }); }); diff --git a/ketcher-autotests/tests/Macromolecule-editor/Polymer-Bond-Tool/attachment-point-rotation.spec.ts-snapshots/Check-attachment-point-rotation-Move-monomer-b-29ea5--another-monomers-and-check-attachment-points-2-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Polymer-Bond-Tool/attachment-point-rotation.spec.ts-snapshots/Check-attachment-point-rotation-Move-monomer-b-29ea5--another-monomers-and-check-attachment-points-2-chromium-linux.png new file mode 100644 index 0000000000..5fb332653f Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Polymer-Bond-Tool/attachment-point-rotation.spec.ts-snapshots/Check-attachment-point-rotation-Move-monomer-b-29ea5--another-monomers-and-check-attachment-points-2-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Macromolecule-editor/Polymer-Bond-Tool/attachment-point-rotation.spec.ts-snapshots/Check-attachment-point-rotation-Move-monomer-b-c144d--another-monomers-and-check-attachment-points-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Polymer-Bond-Tool/attachment-point-rotation.spec.ts-snapshots/Check-attachment-point-rotation-Move-monomer-b-c144d--another-monomers-and-check-attachment-points-1-chromium-linux.png new file mode 100644 index 0000000000..ad341a502b Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Polymer-Bond-Tool/attachment-point-rotation.spec.ts-snapshots/Check-attachment-point-rotation-Move-monomer-b-c144d--another-monomers-and-check-attachment-points-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Macromolecule-editor/Polymer-Bond-Tool/attachment-point-rotation.spec.ts-snapshots/Check-attachment-point-rotation-Select-monomer-and-bonds-and-then-hover-monomer-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Polymer-Bond-Tool/attachment-point-rotation.spec.ts-snapshots/Check-attachment-point-rotation-Select-monomer-and-bonds-and-then-hover-monomer-1-chromium-linux.png new file mode 100644 index 0000000000..d637d7aa68 Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Polymer-Bond-Tool/attachment-point-rotation.spec.ts-snapshots/Check-attachment-point-rotation-Select-monomer-and-bonds-and-then-hover-monomer-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Macromolecule-editor/Polymer-Bond-Tool/attachment-point-rotation.spec.ts-snapshots/Check-attachment-point-rotation-Select-monomer-and-bonds-and-then-hover-monomer-2-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Polymer-Bond-Tool/attachment-point-rotation.spec.ts-snapshots/Check-attachment-point-rotation-Select-monomer-and-bonds-and-then-hover-monomer-2-chromium-linux.png new file mode 100644 index 0000000000..94abcccbf5 Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Polymer-Bond-Tool/attachment-point-rotation.spec.ts-snapshots/Check-attachment-point-rotation-Select-monomer-and-bonds-and-then-hover-monomer-2-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Macromolecule-editor/Polymer-Bond-Tool/polymer-bond-tool.spec.ts b/ketcher-autotests/tests/Macromolecule-editor/Polymer-Bond-Tool/polymer-bond-tool.spec.ts index 7c04e1133b..ba59b7c576 100644 --- a/ketcher-autotests/tests/Macromolecule-editor/Polymer-Bond-Tool/polymer-bond-tool.spec.ts +++ b/ketcher-autotests/tests/Macromolecule-editor/Polymer-Bond-Tool/polymer-bond-tool.spec.ts @@ -1,20 +1,22 @@ import { test } from '@playwright/test'; -import { selectSingleBondTool, waitForPageInit } from '@utils'; +import { + selectSingleBondTool, + waitForPageInit, + takePageScreenshot, +} from '@utils'; import { turnOnMacromoleculesEditor } from '@utils/macromolecules'; /* eslint-disable no-magic-numbers */ test.describe('Polymer Bond Tool', () => { test.beforeEach(async ({ page }) => { await waitForPageInit(page); + await turnOnMacromoleculesEditor(page); }); test('Create bond between two peptides', async ({ page }) => { /* Test case: #2334 - Create peptide chain (HELM style) - Center-to-Center Description: Polymer bond tool */ - - await turnOnMacromoleculesEditor(page); - // Choose peptide await page.getByText('Tza').click(); @@ -37,14 +39,11 @@ test.describe('Polymer Bond Tool', () => { // Create bonds between peptides, taking screenshots in middle states await peptide1.hover(); await page.mouse.down(); - await page.screenshot({ - path: 'tests/Macromolecule-editor/screenshots/polymer-bond-tool.png', - }); + + await takePageScreenshot(page); await peptide2.hover(); await page.mouse.up(); - await page.screenshot({ - path: 'tests/Macromolecule-editor/screenshots/polymer-bond-tool2.png', - }); + await takePageScreenshot(page); await page.mouse.down(); await peptide3.hover(); @@ -58,9 +57,7 @@ test.describe('Polymer Bond Tool', () => { // Wait error popup await page.waitForSelector('#error-tooltip'); - await page.screenshot({ - path: 'tests/Macromolecule-editor/screenshots/polymer-bond-tool3.png', - }); + await takePageScreenshot(page); }); test('Create bond between two chems', async ({ page }) => { @@ -68,9 +65,6 @@ test.describe('Polymer Bond Tool', () => { Test case: #2497 - Adding chems to canvas - Center-to-Center Description: Polymer bond tool */ - - await turnOnMacromoleculesEditor(page); - // Choose chems await page.getByText('CHEM').click(); await page.getByTestId('hxy___Hexynyl alcohol').click(); @@ -90,13 +84,10 @@ test.describe('Polymer Bond Tool', () => { // Create bonds between chems, taking screenshots in middle states await chem1.hover(); await page.mouse.down(); - await page.screenshot({ - path: 'tests/Macromolecule-editor/screenshots/polymer-bond-tool-chem1.png', - }); + await takePageScreenshot(page); await chem2.hover(); await page.mouse.up(); - await page.screenshot({ - path: 'tests/Macromolecule-editor/screenshots/polymer-bond-tool-chem2.png', - }); + + await takePageScreenshot(page); }); }); diff --git a/ketcher-autotests/tests/Macromolecule-editor/Polymer-Bond-Tool/polymer-bond-tool.spec.ts-snapshots/Polymer-Bond-Tool-Create-bond-between-two-chems-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Polymer-Bond-Tool/polymer-bond-tool.spec.ts-snapshots/Polymer-Bond-Tool-Create-bond-between-two-chems-1-chromium-linux.png new file mode 100644 index 0000000000..ce3f9be1bc Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Polymer-Bond-Tool/polymer-bond-tool.spec.ts-snapshots/Polymer-Bond-Tool-Create-bond-between-two-chems-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Macromolecule-editor/screenshots/polymer-bond-tool-chem2.png b/ketcher-autotests/tests/Macromolecule-editor/Polymer-Bond-Tool/polymer-bond-tool.spec.ts-snapshots/Polymer-Bond-Tool-Create-bond-between-two-chems-2-chromium-linux.png similarity index 100% rename from ketcher-autotests/tests/Macromolecule-editor/screenshots/polymer-bond-tool-chem2.png rename to ketcher-autotests/tests/Macromolecule-editor/Polymer-Bond-Tool/polymer-bond-tool.spec.ts-snapshots/Polymer-Bond-Tool-Create-bond-between-two-chems-2-chromium-linux.png diff --git a/ketcher-autotests/tests/Macromolecule-editor/Polymer-Bond-Tool/polymer-bond-tool.spec.ts-snapshots/Polymer-Bond-Tool-Create-bond-between-two-peptides-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Polymer-Bond-Tool/polymer-bond-tool.spec.ts-snapshots/Polymer-Bond-Tool-Create-bond-between-two-peptides-1-chromium-linux.png new file mode 100644 index 0000000000..f4fb00fec1 Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Polymer-Bond-Tool/polymer-bond-tool.spec.ts-snapshots/Polymer-Bond-Tool-Create-bond-between-two-peptides-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Macromolecule-editor/Polymer-Bond-Tool/polymer-bond-tool.spec.ts-snapshots/Polymer-Bond-Tool-Create-bond-between-two-peptides-2-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Polymer-Bond-Tool/polymer-bond-tool.spec.ts-snapshots/Polymer-Bond-Tool-Create-bond-between-two-peptides-2-chromium-linux.png new file mode 100644 index 0000000000..95b3bcc68b Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Polymer-Bond-Tool/polymer-bond-tool.spec.ts-snapshots/Polymer-Bond-Tool-Create-bond-between-two-peptides-2-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Macromolecule-editor/Polymer-Bond-Tool/polymer-bond-tool.spec.ts-snapshots/Polymer-Bond-Tool-Create-bond-between-two-peptides-3-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Polymer-Bond-Tool/polymer-bond-tool.spec.ts-snapshots/Polymer-Bond-Tool-Create-bond-between-two-peptides-3-chromium-linux.png new file mode 100644 index 0000000000..9edda06481 Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Polymer-Bond-Tool/polymer-bond-tool.spec.ts-snapshots/Polymer-Bond-Tool-Create-bond-between-two-peptides-3-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Macromolecule-editor/RNAEditor/add-custom-preset.spec.ts b/ketcher-autotests/tests/Macromolecule-editor/RNAEditor/add-custom-preset.spec.ts index 12ba2ca6af..2143be4601 100644 --- a/ketcher-autotests/tests/Macromolecule-editor/RNAEditor/add-custom-preset.spec.ts +++ b/ketcher-autotests/tests/Macromolecule-editor/RNAEditor/add-custom-preset.spec.ts @@ -1,4 +1,4 @@ -import { test } from '@playwright/test'; +import { Page, test } from '@playwright/test'; import { POLYMER_TOGGLER, RNA_TAB, @@ -8,84 +8,68 @@ import { BUTTON__ADD_TO_PRESETS, } from '../../../constants/testIdConstants'; import { waitForPageInit } from '@utils/common'; +import { takePageScreenshot } from '@utils'; /* Test case: #3063 - Add e2e tests for Macromolecule editor */ +async function createRNA(page: Page) { + await page.getByTestId(POLYMER_TOGGLER).click(); + await page.getByTestId(RNA_TAB).click(); + await page.fill('[placeholder="Name your structure"]', 'MyRNA'); + await page.press('[placeholder="Name your structure"]', 'Enter'); +} + +async function selectRNAComponents( + page: Page, + { + sugar, + base, + phosphate, + }: { + sugar: string; + base: string; + phosphate: string; + }, +) { + await page.getByTestId(SUGAR).click(); + await page.getByTestId(sugar).click(); + + await page.getByTestId(BASE).click(); + await page.getByTestId(base).click(); + + await page.getByTestId(PHOSPHATE).click(); + await page.getByTestId(phosphate).click(); +} + test.describe('Macromolecules custom presets', () => { test.beforeEach(async ({ page }) => { await waitForPageInit(page); - - // Click on POLYMER_TOGGLER - await page.getByTestId(POLYMER_TOGGLER).click(); - - // Click on
"Sugar Not selected" - await page.getByTestId(SUGAR).click(); - - // Click on
"25R ★" - await page.click('[data-testid="25R___2,5-Ribose"]'); - // Click on
"Base Not selected" - await page.getByTestId(BASE).click(); - - // Click on
"baA ★" - await page.click('[data-testid="baA___N-benzyl-adenine"]'); - - // Click on
"Phosphate Not selected" - await page.getByTestId(PHOSPHATE).click(); - - // Click on
"bP ★" - await page.click('[data-testid="bP___Boranophosphate"]'); - - // Click on
+
+
{ +export const RnaBuilder = ({ libraryName }) => { const dispatch = useAppDispatch(); const hasError = useAppSelector(selectHasUniqueNameError); const monomers = useAppSelector(selectFilteredMonomers); @@ -48,7 +48,7 @@ export const RnaBuilder = () => { return ( - + Preset with name "{activePreset?.name}" already exists. Please choose diff --git a/packages/ketcher-polymer-editor-react/src/components/monomerLibrary/tabsContent.tsx b/packages/ketcher-polymer-editor-react/src/components/monomerLibrary/tabsContent.tsx index 3898e87650..83cb1ca4c4 100644 --- a/packages/ketcher-polymer-editor-react/src/components/monomerLibrary/tabsContent.tsx +++ b/packages/ketcher-polymer-editor-react/src/components/monomerLibrary/tabsContent.tsx @@ -23,6 +23,9 @@ export const tabsContent = [ caption: 'RNA', testId: 'RNA_TAB', component: RnaBuilder, + props: { + libraryName: MONOMER_TYPES.RNA, + }, }, { caption: 'CHEM',