diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher2.spec.ts b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher2.spec.ts index 0801205784..0b674bca7e 100644 --- a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher2.spec.ts +++ b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher2.spec.ts @@ -4,6 +4,7 @@ Tests below moved here from macro-micro-switcher since they are designed to be e and can't be executed in "clear canvas way" */ import { + chooseFileFormat, turnOnMacromoleculesEditor, turnOnMicromoleculesEditor, } from '@utils/macromolecules'; @@ -29,9 +30,19 @@ import { Bases, selectMacroBond, moveMouseAway, + selectRingButton, + RingButton, + selectSaveFileFormat, + FileFormatOption, + moveMouseToTheMiddleOfTheScreen, + selectSaveTool, + clickOnCanvas, + pasteFromClipboardByKeyboard, + copyToClipboardByIcon, } from '@utils'; import { Peptides } from '@utils/selectors/macromoleculeEditor'; import { MacroBondTool } from '@utils/canvas/tools/selectNestedTool/types'; +import { closeErrorAndInfoModals } from '@utils/common/helpers'; async function addToFavoritesMonomers(page: Page) { await page.getByTestId(Peptides.BetaAlanine).getByText('★').click(); @@ -344,4 +355,72 @@ test.describe('Macro-Micro-Switcher2', () => { await turnOnMicromoleculesEditor(page); await takeEditorScreenshot(page); }); + + test('Verify that the "Copy to Clipboard" icon appears in the export window in molecules mode', async ({ + page, + }) => { + /* + Test case: https://github.com/epam/ketcher/issues/5854 + Description: The "Copy to Clipboard" icon appears in the export window in molecules mode + */ + await selectRingButton(RingButton.Benzene, page); + await clickInTheMiddleOfTheScreen(page); + await selectSaveFileFormat(page, FileFormatOption.KET); + await moveMouseToTheMiddleOfTheScreen(page); + await takeEditorScreenshot(page); + }); + + test('Verify that the "Copy to Clipboard" icon appears in the export window in macromolecules mode', async ({ + page, + }) => { + /* + Test case: https://github.com/epam/ketcher/issues/5854 + Description: The "Copy to Clipboard" icon appears in the export window in macromolecules mode + */ + await selectRingButton(RingButton.Benzene, page); + await clickInTheMiddleOfTheScreen(page); + await turnOnMacromoleculesEditor(page); + await selectSaveTool(page); + await chooseFileFormat(page, 'Ket'); + await moveMouseToTheMiddleOfTheScreen(page); + await takeEditorScreenshot(page); + }); + + test('Verify that the "Copy to Clipboard" icon disappears after clicking on the preview section and appears when hovering again', async ({ + page, + }) => { + /* + Test case: https://github.com/epam/ketcher/issues/5854 + Description: The "Copy to Clipboard" icon disappears after clicking on the preview section and appears when hovering again + */ + await selectRingButton(RingButton.Benzene, page); + await clickInTheMiddleOfTheScreen(page); + await selectSaveFileFormat(page, FileFormatOption.KET); + await moveMouseToTheMiddleOfTheScreen(page); + await takeEditorScreenshot(page); + await clickInTheMiddleOfTheScreen(page); + await takeEditorScreenshot(page); + await clickOnCanvas(page, 100, 100); + await moveMouseToTheMiddleOfTheScreen(page); + await takeEditorScreenshot(page); + }); + + test('Verify that clicking on the "Copy to Clipboard" icon copies all exportable information to the clipboard', async ({ + page, + }) => { + /* + Test case: https://github.com/epam/ketcher/issues/5854 + Description: Clicking on the "Copy to Clipboard" icon copies all exportable information to the clipboard + */ + await selectRingButton(RingButton.Benzene, page); + await clickInTheMiddleOfTheScreen(page); + await selectSaveFileFormat(page, FileFormatOption.KET); + await moveMouseToTheMiddleOfTheScreen(page); + await copyToClipboardByIcon(page); + await closeErrorAndInfoModals(page); + await pasteFromClipboardByKeyboard(page); + await moveMouseAway(page); + await clickOnCanvas(page, 300, 300); + await takeEditorScreenshot(page); + }); }); diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher2.spec.ts-snapshots/Macro-Micro-Switcher2-Verify-that-a-tooltip-ap-f16b1-en-hovering-over-the-Copy-to-Clipboard-icon-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher2.spec.ts-snapshots/Macro-Micro-Switcher2-Verify-that-a-tooltip-ap-f16b1-en-hovering-over-the-Copy-to-Clipboard-icon-1-chromium-linux.png new file mode 100644 index 0000000000..aaeb1f84df Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher2.spec.ts-snapshots/Macro-Micro-Switcher2-Verify-that-a-tooltip-ap-f16b1-en-hovering-over-the-Copy-to-Clipboard-icon-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher2.spec.ts-snapshots/Macro-Micro-Switcher2-Verify-that-clicking-on--95768-s-all-exportable-information-to-the-clipboard-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher2.spec.ts-snapshots/Macro-Micro-Switcher2-Verify-that-clicking-on--95768-s-all-exportable-information-to-the-clipboard-1-chromium-linux.png new file mode 100644 index 0000000000..8abf7d6e17 Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher2.spec.ts-snapshots/Macro-Micro-Switcher2-Verify-that-clicking-on--95768-s-all-exportable-information-to-the-clipboard-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher2.spec.ts-snapshots/Macro-Micro-Switcher2-Verify-that-the-Copy-to-39c50-ppears-in-the-export-window-in-molecules-mode-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher2.spec.ts-snapshots/Macro-Micro-Switcher2-Verify-that-the-Copy-to-39c50-ppears-in-the-export-window-in-molecules-mode-1-chromium-linux.png new file mode 100644 index 0000000000..aaeb1f84df Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher2.spec.ts-snapshots/Macro-Micro-Switcher2-Verify-that-the-Copy-to-39c50-ppears-in-the-export-window-in-molecules-mode-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher2.spec.ts-snapshots/Macro-Micro-Switcher2-Verify-that-the-Copy-to-766c2-eview-section-and-appears-when-hovering-again-3-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher2.spec.ts-snapshots/Macro-Micro-Switcher2-Verify-that-the-Copy-to-766c2-eview-section-and-appears-when-hovering-again-3-chromium-linux.png new file mode 100644 index 0000000000..55fcee01ae Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher2.spec.ts-snapshots/Macro-Micro-Switcher2-Verify-that-the-Copy-to-766c2-eview-section-and-appears-when-hovering-again-3-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher2.spec.ts-snapshots/Macro-Micro-Switcher2-Verify-that-the-Copy-to-7f339-s-in-the-export-window-in-macromolecules-mode-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher2.spec.ts-snapshots/Macro-Micro-Switcher2-Verify-that-the-Copy-to-7f339-s-in-the-export-window-in-macromolecules-mode-1-chromium-linux.png new file mode 100644 index 0000000000..825e94cf25 Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher2.spec.ts-snapshots/Macro-Micro-Switcher2-Verify-that-the-Copy-to-7f339-s-in-the-export-window-in-macromolecules-mode-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher2.spec.ts-snapshots/Macro-Micro-Switcher2-Verify-that-the-Copy-to-94259-eview-section-and-appears-when-hovering-again-1-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher2.spec.ts-snapshots/Macro-Micro-Switcher2-Verify-that-the-Copy-to-94259-eview-section-and-appears-when-hovering-again-1-chromium-linux.png new file mode 100644 index 0000000000..aaeb1f84df Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher2.spec.ts-snapshots/Macro-Micro-Switcher2-Verify-that-the-Copy-to-94259-eview-section-and-appears-when-hovering-again-1-chromium-linux.png differ diff --git a/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher2.spec.ts-snapshots/Macro-Micro-Switcher2-Verify-that-the-Copy-to-c1896-eview-section-and-appears-when-hovering-again-2-chromium-linux.png b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher2.spec.ts-snapshots/Macro-Micro-Switcher2-Verify-that-the-Copy-to-c1896-eview-section-and-appears-when-hovering-again-2-chromium-linux.png new file mode 100644 index 0000000000..cab06ac22d Binary files /dev/null and b/ketcher-autotests/tests/Macromolecule-editor/Macro-Micro-Switcher/macro-micro-switcher2.spec.ts-snapshots/Macro-Micro-Switcher2-Verify-that-the-Copy-to-c1896-eview-section-and-appears-when-hovering-again-2-chromium-linux.png differ diff --git a/ketcher-autotests/tests/utils/canvas/helpers.ts b/ketcher-autotests/tests/utils/canvas/helpers.ts index ca54ad6cc3..691899d773 100644 --- a/ketcher-autotests/tests/utils/canvas/helpers.ts +++ b/ketcher-autotests/tests/utils/canvas/helpers.ts @@ -498,3 +498,7 @@ export async function selectRedoByKeyboard( await page.keyboard.press(`${modifier}+Shift+KeyZ`, options); }); } + +export async function copyToClipboardByIcon(page: Page) { + await page.getByTestId('copy-to-clipboard').click(); +}