Skip to content

Commit

Permalink
#4146 - Macro: UI for Open/Save As FASTA
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-asiyuk-epam committed Mar 15, 2024
1 parent 714ea29 commit eac45d8
Show file tree
Hide file tree
Showing 269 changed files with 2,495 additions and 722 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
waitForSpinnerFinishedWork,
addFragment,
selectRectangleArea,
openFileAndAddToCanvas,
openFileAndAddToCanvasMacro,
dragMouseTo,
} from '@utils';

Expand All @@ -33,7 +33,7 @@ test.describe('addFragment', () => {
test.beforeEach(async ({ page }) => {
await waitForPageInit(page);
await turnOnMacromoleculesEditor(page);
await openFileAndAddToCanvas(fileName, page);
await openFileAndAddToCanvasMacro(fileName, page);
await shiftStructure(page);
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { test, expect } from '@playwright/test';
import {
openFileAndAddToCanvas,
openFileAndAddToCanvasMacro,
readFileContents,
waitForPageInit,
turnOnMacromoleculesEditor,
Expand All @@ -15,7 +15,7 @@ test.describe('getKet', () => {
});

test('with two monomers bonded', async ({ page }) => {
await openFileAndAddToCanvas('KET/alanine-monomers-bonded.ket', page);
await openFileAndAddToCanvasMacro('KET/alanine-monomers-bonded.ket', page);
const ket = await getKet(page);
await saveToFile('KET/alanine-monomers-bonded-expected.ket', ket);
const fileContents = await readFileContents(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { test, expect } from '@playwright/test';
import {
openFileAndAddToCanvas,
openFileAndAddToCanvasMacro,
readFileContents,
waitForPageInit,
turnOnMacromoleculesEditor,
Expand All @@ -15,7 +15,7 @@ test.describe('getMolfile', () => {
});

test('with two monomers bonded', async ({ page }) => {
await openFileAndAddToCanvas('KET/alanine-monomers-bonded.ket', page);
await openFileAndAddToCanvasMacro('KET/alanine-monomers-bonded.ket', page);
const mol = await getMolfile(page);
await saveToFile(
'Molfiles-V3000/alanine-monomers-bonded-expected.mol',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { test } from '@playwright/test';
import {
clickInTheMiddleOfTheScreen,
openFileAndAddToCanvas,
openFileAndAddToCanvasMacro,
pressButton,
selectSingleBondTool,
takeEditorScreenshot,
Expand Down Expand Up @@ -46,7 +46,7 @@ test.describe('Actions with CHEM', () => {
Test case: Actions with structures
Description: CHEM name fits in its icon when placed on canvas.
*/
await openFileAndAddToCanvas('KET/all-chems.ket', page);
await openFileAndAddToCanvasMacro('KET/all-chems.ket', page);
await selectSingleBondTool(page);
await takeEditorScreenshot(page);
});
Expand All @@ -59,14 +59,7 @@ test.describe('Actions with CHEM', () => {
https://github.com/epam/ketcher/issues/3582
Description: APs are not redrawn incorrectly after opening the modal window.
*/
const xOffsetFromCenter = -200;
const yOffsetFromCenter = 0;
await openFileAndAddToCanvas(
'KET/chems-not-connected.ket',
page,
xOffsetFromCenter,
yOffsetFromCenter,
);
await openFileAndAddToCanvasMacro('KET/chems-not-connected.ket', page);
await selectSingleBondTool(page);
await page.getByText('Test-6-Ch').locator('..').hover();
await page.mouse.down();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { test } from '@playwright/test';
import {
takeEditorScreenshot,
waitForPageInit,
openFileAndAddToCanvas,
openFileAndAddToCanvasMacro,
selectEraseTool,
selectSnakeLayoutModeTool,
clickUndo,
Expand All @@ -23,7 +23,10 @@ test.describe('Enumerations', () => {
Test case: #3222
Description: The system start enumeration from the monomer, which has occupied R2 attachment point
*/
await openFileAndAddToCanvas('KET/peptides-connected-with-bonds.ket', page);
await openFileAndAddToCanvasMacro(
'KET/peptides-connected-with-bonds.ket',
page,
);
await takeEditorScreenshot(page);
});

Expand All @@ -34,7 +37,7 @@ test.describe('Enumerations', () => {
Test case: #3222
Description: The system start enumeration as separate chain when connected through CHEM
*/
await openFileAndAddToCanvas(
await openFileAndAddToCanvasMacro(
'KET/peptides-connected-through-chem.ket',
page,
);
Expand All @@ -48,7 +51,7 @@ test.describe('Enumerations', () => {
Test case: #3222
Description: CHEM are considered separately, and CHEM itself is not enumerated
*/
await openFileAndAddToCanvas(
await openFileAndAddToCanvasMacro(
'KET/three-peptide-chains-connected-through-chems.ket',
page,
);
Expand All @@ -62,7 +65,7 @@ test.describe('Enumerations', () => {
Test case: #3222
Description: each chain (RNA and peptide) is counted separately when they are connected
*/
await openFileAndAddToCanvas('KET/rna-and-peptides.ket', page);
await openFileAndAddToCanvasMacro('KET/rna-and-peptides.ket', page);
await takeEditorScreenshot(page);
});

Expand All @@ -74,7 +77,7 @@ test.describe('Enumerations', () => {
Description: The system walk along sugar-phosphate core from R2 to R1
until it meets the sugar with the base (attached to R3 AP via R3-R1 bond). Such base counted.
*/
await openFileAndAddToCanvas('KET/sugar-phosphate-core.ket', page);
await openFileAndAddToCanvasMacro('KET/sugar-phosphate-core.ket', page);
await takeEditorScreenshot(page);
});

Expand All @@ -83,7 +86,7 @@ test.describe('Enumerations', () => {
Test case: #3222
Description: Chain recalculated after deleting base.
*/
await openFileAndAddToCanvas('KET/sugar-phosphate-baA.ket', page);
await openFileAndAddToCanvasMacro('KET/sugar-phosphate-baA.ket', page);
await selectRectangleSelectionTool(page);
await selectEraseTool(page);
await page.getByText('baA').locator('..').first().click();
Expand All @@ -95,7 +98,7 @@ test.describe('Enumerations', () => {
Test case: #3222
Description: Chain recalculated after undoing base.
*/
await openFileAndAddToCanvas('KET/sugar-phosphate-baA.ket', page);
await openFileAndAddToCanvasMacro('KET/sugar-phosphate-baA.ket', page);
await selectRectangleSelectionTool(page);
await selectEraseTool(page);
await page.getByText('baA').locator('..').first().click();
Expand All @@ -110,7 +113,10 @@ test.describe('Enumerations', () => {
Test case: #3222
Description: Monomers are correctly recalculated and renumbered in linear chain
*/
await openFileAndAddToCanvas('KET/peptides-connected-with-bonds.ket', page);
await openFileAndAddToCanvasMacro(
'KET/peptides-connected-with-bonds.ket',
page,
);
await selectEraseTool(page);
await page.getByText('Tml').locator('..').first().click();
await takeEditorScreenshot(page);
Expand All @@ -124,7 +130,7 @@ test.describe('Enumerations', () => {
Description: Remove a monomer and observe how the remaining monomers are correctly
recalculated and renumbered in both linear and branch chains
*/
await openFileAndAddToCanvas(
await openFileAndAddToCanvasMacro(
'KET/three-peptide-chains-connected-through-chems.ket',
page,
);
Expand All @@ -143,7 +149,7 @@ test.describe('Enumerations', () => {
Description: Remove first a monomer and observe how the remaining monomers are correctly
recalculated and renumbered in both linear and branch chains
*/
await openFileAndAddToCanvas('Molfiles-V3000/modified-rna.mol', page);
await openFileAndAddToCanvasMacro('Molfiles-V3000/modified-rna.mol', page);
await selectSnakeLayoutModeTool(page);
await selectEraseTool(page);
await page.getByText('25R').locator('..').first().click();
Expand All @@ -158,7 +164,7 @@ test.describe('Enumerations', () => {
Description: Remove a monomer and observe how the remaining monomers are correctly
recalculated and renumbered in both linear and branch chains
*/
await openFileAndAddToCanvas('Molfiles-V3000/modified-rna.mol', page);
await openFileAndAddToCanvasMacro('Molfiles-V3000/modified-rna.mol', page);
await selectSnakeLayoutModeTool(page);
await selectEraseTool(page);
await page.getByText('3A6').locator('..').first().click();
Expand All @@ -173,7 +179,7 @@ test.describe('Enumerations', () => {
Description: Remove a monomer from middle and observe how the remaining monomers are correctly
recalculated and renumbered in both linear and branch chains
*/
await openFileAndAddToCanvas(
await openFileAndAddToCanvasMacro(
'Molfiles-V3000/rna-modified-sugars.mol',
page,
);
Expand All @@ -191,7 +197,7 @@ test.describe('Enumerations', () => {
Description: After Undo monomers are correctly
recalculated and renumbered in both linear and branch chains
*/
await openFileAndAddToCanvas(
await openFileAndAddToCanvasMacro(
'KET/three-peptide-chains-connected-through-chems.ket',
page,
);
Expand All @@ -214,7 +220,10 @@ test.describe('Enumerations', () => {
Description: After deleted proper renumbering in both chains and after Undo monomers are correctly
recalculated and renumbered in both linear and branch chains
*/
await openFileAndAddToCanvas('KET/intersected-monomers-chains.ket', page);
await openFileAndAddToCanvasMacro(
'KET/intersected-monomers-chains.ket',
page,
);
await selectEraseTool(page);
await page.getByText('Hcy').locator('..').first().click();
await page.getByText('meC').locator('..').first().click();
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.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { turnOnMacromoleculesEditor } from '@utils/macromolecules';
import { test } from '@playwright/test';
import {
openFileAndAddToCanvas,
openFileAndAddToCanvasMacro,
selectSingleBondTool,
takeEditorScreenshot,
takeLeftToolbarMacromoleculeScreenshot,
Expand All @@ -19,7 +19,7 @@ test.describe('Hotkeys', () => {
Test case: Hotkeys https://github.com/epam/ketcher/issues/3713
Description: Canvas is cleared.
*/
await openFileAndAddToCanvas('Molfiles-V3000/peptide-bzl.mol', page);
await openFileAndAddToCanvasMacro('Molfiles-V3000/peptide-bzl.mol', page);
await page.keyboard.press('Control+Delete');
await takeEditorScreenshot(page);
});
Expand All @@ -29,7 +29,7 @@ test.describe('Hotkeys', () => {
Test case: Hotkeys https://github.com/epam/ketcher/issues/3713
Description: Canvas is cleared.
*/
await openFileAndAddToCanvas('Molfiles-V3000/peptide-bzl.mol', page);
await openFileAndAddToCanvasMacro('Molfiles-V3000/peptide-bzl.mol', page);
await page.keyboard.press('Control+Backspace');
await takeEditorScreenshot(page);
});
Expand All @@ -41,7 +41,7 @@ test.describe('Hotkeys', () => {
Test case: Hotkeys https://github.com/epam/ketcher/issues/3713
Description: Clear canvas action Undo and then Redo.
*/
await openFileAndAddToCanvas('Molfiles-V3000/peptide-bzl.mol', page);
await openFileAndAddToCanvasMacro('Molfiles-V3000/peptide-bzl.mol', page);
await page.keyboard.press('Control+Backspace');
await page.keyboard.press('Control+z');
await takeEditorScreenshot(page);
Expand All @@ -54,7 +54,7 @@ test.describe('Hotkeys', () => {
Test case: Hotkeys https://github.com/epam/ketcher/issues/3713
Description: Clear canvas action Undo and then Redo.
*/
await openFileAndAddToCanvas('Molfiles-V3000/peptide-bzl.mol', page);
await openFileAndAddToCanvasMacro('Molfiles-V3000/peptide-bzl.mol', page);
await page.keyboard.press('Control+Backspace');
await page.keyboard.press('Control+z');
await takeEditorScreenshot(page);
Expand Down Expand Up @@ -84,7 +84,7 @@ test.describe('Hotkeys', () => {
Description: Monomers are Zoomed In on canvas
*/
const numberOfPressZoomIn = 5;
await openFileAndAddToCanvas(
await openFileAndAddToCanvasMacro(
'KET/three-monomers-not-connected-with-bonds.ket',
page,
);
Expand All @@ -100,7 +100,7 @@ test.describe('Hotkeys', () => {
Description: Monomers are Zoomed Out on canvas
*/
const numberOfPressZoomOut = 5;
await openFileAndAddToCanvas(
await openFileAndAddToCanvasMacro(
'KET/three-monomers-not-connected-with-bonds.ket',
page,
);
Expand All @@ -116,7 +116,7 @@ test.describe('Hotkeys', () => {
Description: Monomers Zoome In are reset
*/
const numberOfPressZoomIn = 5;
await openFileAndAddToCanvas(
await openFileAndAddToCanvasMacro(
'KET/three-monomers-not-connected-with-bonds.ket',
page,
);
Expand All @@ -133,7 +133,7 @@ test.describe('Hotkeys', () => {
Test case: Hotkeys https://github.com/epam/ketcher/issues/3713
Description: All Monomers are selected.
*/
await openFileAndAddToCanvas(
await openFileAndAddToCanvasMacro(
'KET/three-monomers-not-connected-with-bonds.ket',
page,
);
Expand Down
Loading

0 comments on commit eac45d8

Please sign in to comment.