Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#3174 - RNA Bases are filtered wrong #3272

Merged
merged 12 commits into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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';

/*
Expand All @@ -20,9 +24,5 @@ test('Select chem and drag it to canvas', async ({ page }) => {
// Click on <svg> #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);
});
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,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
Expand All @@ -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);
});
});
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 @@ -4,16 +4,18 @@ import {
selectEraseTool,
selectSingleBondTool,
takeEditorScreenshot,
waitForPageInit,
} from '@utils';
import { turnOnMacromoleculesEditor } from '@utils/macromolecules';
import { bondTwoMonomers } from '@utils/macromolecules/polymerBond';
/* eslint-disable no-magic-numbers */

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
Expand Down
Original file line number Diff line number Diff line change
@@ -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);
});
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,22 @@
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
*/

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 <div> "A ★"
await page.click(ALANINE);

// Click on <svg> #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);
});
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 @@ -4,14 +4,16 @@ import {
dragMouseTo,
selectRectangleSelectionTool,
selectSingleBondTool,
takePageScreenshot,
waitForPageInit,
} from '@utils';
import { turnOnMacromoleculesEditor } from '@utils/macromolecules';
import { bondTwoMonomers } from '@utils/macromolecules/polymerBond';
/* eslint-disable no-magic-numbers */

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 }) => {
Expand Down Expand Up @@ -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 ({
Expand Down Expand Up @@ -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);
Expand All @@ -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);
});
});
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,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();

Expand All @@ -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();
Expand All @@ -58,19 +57,14 @@ 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 }) => {
/*
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();
Expand All @@ -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);
});
});
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
Loading