Skip to content

Commit

Permalink
Autotests: #5558 - Add ambiguous monomers to the library and allow th…
Browse files Browse the repository at this point in the history
…eir addition to the canvas - Case 15(1-5)
  • Loading branch information
AlexeyGirin committed Sep 30, 2024
1 parent 08060d3 commit c33bd07
Show file tree
Hide file tree
Showing 17 changed files with 18,640 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -358,10 +358,10 @@ test.describe('Import-Saving .ket Files', () => {
expect(ketFile).toEqual(ketFileExpected);
});

test('Verify saving and load to canvas variant monomers in KET format (macro mode)', async () => {
test('Verify saving and load to canvas ambiguous monomers in KET format (macro mode)', async () => {
/*
Test task: https://github.com/epam/ketcher/issues/5558
Description: 13. Verify saving and load to canvas variant monomers in KET format (macro mode)
Description: 13. Verify saving and load to canvas ambiguous monomers in KET format (macro mode)
Case: 1. Load all ambiguous monomers from KET
2. Make a screenshot to make sure they loaded
3. Save canvas to KET
Expand All @@ -372,8 +372,7 @@ test.describe('Import-Saving .ket Files', () => {
page,
);

await moveMouseToTheMiddleOfTheScreen(page);
await zoomWithMouseWheel(page, -200);
await zoomWithMouseWheel(page, -250);
await takeEditorScreenshot(page);

const expectedFile = await getKet(page);
Expand All @@ -389,7 +388,7 @@ test.describe('Import-Saving .ket Files', () => {
'tests/test-data/KET/Ambiguous-monomers/AllAmbiguousMonomers-expected.ket',
});
expect(ketFile).toEqual(ketFileExpected);
await zoomWithMouseWheel(page, 200);
await zoomWithMouseWheel(page, 250);
});
});

Expand Down
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,3 +1,4 @@
/* eslint-disable no-magic-numbers */
import { test, expect } from '@playwright/test';
import {
TopPanelButton,
Expand All @@ -15,8 +16,14 @@ import {
readFileContents,
getSequence,
moveMouseAway,
moveMouseToTheMiddleOfTheScreen,
openFileAndAddToCanvasAsNewProjectMacro,
} from '@utils';
import { turnOnMacromoleculesEditor } from '@utils/macromolecules';
import { closeErrorMessage } from '@utils/common/helpers';
import {
turnOnMacromoleculesEditor,
zoomWithMouseWheel,
} from '@utils/macromolecules';

test.describe('Import-Saving .seq Files', () => {
test.beforeEach(async ({ page }) => {
Expand Down Expand Up @@ -254,4 +261,176 @@ test.describe('Import-Saving .seq Files', () => {
await takeEditorScreenshot(page);
},
);

test(
'Saving ambiguous peptides (with mapping) in Sequence format',
{ tag: ['@IncorrectResultBecauseOfBug'] },
async ({ page }) => {
/*
Test task: https://github.com/epam/ketcher/issues/5558
Description: 15.1 Verify saving ambiguous peptides (with mapping) in Sequence format (macro mode)
Case: 1. Load ambiguous peptides (that have mapping to library) from KET
2. Take screenshot to make sure monomers on the canvas
3. Open Save dialog and choose Sequence option
4. Take screenshot to make sure export is correct
*/
await openFileAndAddToCanvasAsNewProjectMacro(
'KET/Ambiguous-monomers/Peptides (that have mapping to library).ket',
page,
);

await zoomWithMouseWheel(page, -600);
await takeEditorScreenshot(page);

await selectTopPanelButton(TopPanelButton.Save, page);
await chooseFileFormat(page, 'Sequence');
await takeEditorScreenshot(page);

test.fixme(
true,
`That test fails because of https://github.com/epam/Indigo/issues/2435 issue.`,
);

await pressButton(page, 'Cancel');
await zoomWithMouseWheel(page, 600);
},
);

test(
'Saving ambiguous peptides (without mapping) in Sequence format',
{ tag: ['@IncorrectResultBecauseOfBug'] },
async ({ page }) => {
/*
Test task: https://github.com/epam/ketcher/issues/5558
Description: 15.2 Verify saving ambiguous peptides (without mapping) in Sequence format (macro mode)
Case: 1. Load ambiguous peptides (that have mapping to library) from KET
2. Take screenshot to make sure monomers on the canvas
3. Open Save dialog and choose Sequence option
(Error should occure)
4. Take screenshot to make sure export is correct
*/
await openFileAndAddToCanvasAsNewProjectMacro(
'KET/Ambiguous-monomers/Peptides (that have no mapping to library).ket',
page,
);

await zoomWithMouseWheel(page, -200);
await takeEditorScreenshot(page);

await selectTopPanelButton(TopPanelButton.Save, page);
await chooseFileFormat(page, 'Sequence');
await takeEditorScreenshot(page);

await closeErrorMessage(page);

await pressButton(page, 'Cancel');
await zoomWithMouseWheel(page, 200);
test.fixme(
true,
`That test fails because of https://github.com/epam/Indigo/issues/2435, https://github.com/epam/Indigo/issues/2436 issue.`,
);
},
);

test(
'Saving ambiguous DNA bases (with mapping) in Sequence format',
{ tag: ['@IncorrectResultBecauseOfBug'] },
async ({ page }) => {
/*
Test task: https://github.com/epam/ketcher/issues/5558
Description: 15.3 Verify saving ambiguous DNA bases (with mapping) in Sequence format (macro mode)
Case: 1. Load ambiguous bases (that have mapping to library) from KET
2. Take screenshot to make sure monomers on the canvas
3. Open Save dialog and choose Sequence option
4. Take screenshot to make sure export is correct
*/
await openFileAndAddToCanvasAsNewProjectMacro(
'KET/Ambiguous-monomers/Ambiguous DNA Bases (alternatives and mixed).ket',
page,
);

await zoomWithMouseWheel(page, -100);
await takeEditorScreenshot(page);

await selectTopPanelButton(TopPanelButton.Save, page);
await chooseFileFormat(page, 'Sequence');
await takeEditorScreenshot(page);

test.fixme(
true,
`That test fails because of https://github.com/epam/Indigo/issues/2435 issue.`,
);

await pressButton(page, 'Cancel');
await zoomWithMouseWheel(page, 100);
},
);

test(
'Saving ambiguous RNA bases (with mapping) in Sequence format',
{ tag: ['@IncorrectResultBecauseOfBug'] },
async ({ page }) => {
/*
Test task: https://github.com/epam/ketcher/issues/5558
Description: 15.4 Verify saving ambiguous RNA bases (with mapping) in Sequence format (macro mode)
Case: 1. Load ambiguous bases (that have mapping to library) from KET
2. Take screenshot to make sure monomers on the canvas
3. Open Save dialog and choose Sequence option
4. Take screenshot to make sure export is correct
*/
await openFileAndAddToCanvasAsNewProjectMacro(
'KET/Ambiguous-monomers/Ambiguous RNA Bases (alternatives and mixed).ket',
page,
);

await zoomWithMouseWheel(page, -100);
await takeEditorScreenshot(page);

await selectTopPanelButton(TopPanelButton.Save, page);
await chooseFileFormat(page, 'Sequence');
await takeEditorScreenshot(page);

test.fixme(
true,
`That test fails because of https://github.com/epam/Indigo/issues/2435 issue.`,
);

await pressButton(page, 'Cancel');
await zoomWithMouseWheel(page, 100);
},
);

test(
'Saving ambiguous (common) bases (with mapping) in Sequence format',
{ tag: ['@IncorrectResultBecauseOfBug'] },
async ({ page }) => {
/*
Test task: https://github.com/epam/ketcher/issues/5558
Description: 15.5 Verify saving ambiguous (common) bases (with mapping) in Sequence format (macro mode)
Case: 1. Load ambiguous bases (that have mapping to library) from KET
2. Take screenshot to make sure monomers on the canvas
3. Open Save dialog and choose Sequence option
4. Take screenshot to make sure export is correct
*/
await openFileAndAddToCanvasAsNewProjectMacro(
'KET/Ambiguous-monomers/Ambiguous (common) Bases (alternatives and mixed).ket',
page,
);

await zoomWithMouseWheel(page, -400);
await takeEditorScreenshot(page);

await selectTopPanelButton(TopPanelButton.Save, page);
await chooseFileFormat(page, 'Sequence');
await takeEditorScreenshot(page);

test.fixme(
true,
`That test fails because of https://github.com/epam/Indigo/issues/2435 issue.`,
);

await pressButton(page, 'Cancel');
await zoomWithMouseWheel(page, 400);
},
);
});
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.
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
Expand Up @@ -448,7 +448,7 @@ test.describe('Undo-Redo tests', () => {
}) => {
/*
Test task: https://github.com/epam/ketcher/issues/5558
Description: 12.1 Verify the undo/redo functionality with ambiguous monomers on the canvas
Description: 12.1 Verify the undo/redo functionality with ambiguous peptide (X) on the canvas
Case: 1. Put on the center of canvas ambiguous monomer from the library (peptide X)
2. Take screenshot to make sure it is on canvas
3. Select it
Expand Down Expand Up @@ -487,7 +487,7 @@ test.describe('Undo-Redo tests', () => {
}) => {
/*
Test task: https://github.com/epam/ketcher/issues/5558
Description: 12.1 Verify the undo/redo functionality with ambiguous monomers on the canvas
Description: 12.2 Verify the undo/redo functionality with ambiguous Base (RNA_N) on the canvas
Case: 1. Put on the center of canvas ambiguous monomer from the library (peptide X)
2. Take screenshot to make sure it is on canvas
3. Select it
Expand Down
Loading

0 comments on commit c33bd07

Please sign in to comment.