Skip to content

Commit

Permalink
Added tests, ket files and reference screenshots for issue #3959
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexeyGirin committed Mar 7, 2024
1 parent 671fbb7 commit 25aa283
Show file tree
Hide file tree
Showing 130 changed files with 26,686 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import {
drawBenzeneRing,
selectRing,
RingButton,
openFileAndAddToCanvasAsNewProject,
moveMouseAway,
} from '@utils';

test.describe('Toggle-Explicit-Hydrogens Tool', () => {
Expand Down Expand Up @@ -66,3 +68,189 @@ test.describe('Toggle-Explicit-Hydrogens Tool', () => {
await takeEditorScreenshot(page);
});
});

test.describe('1. Molecules connected ', () => {
/*
Test case: https://github.com/epam/ketcher/issues/3959 - Case [1-21]
Description: User can expand hydrogens for molecules connected by ordinary type of bonds
1. Clear canvas
2. Open from file: ${fileName}
3. Press Add/Remove explicit hydrogens button
4. Validate canvas
5. Press Add/Remove explicit hydrogens button
6. Validate canvas
IMPORTANT: Test results are not correct because of https://github.com/epam/Indigo/issues/1611 issue.
Screenshots have to be corrected after fix.
*/

test.beforeEach(async ({ page }) => {
await waitForPageInit(page);
});

const fileNames = [
'All types of bond - Chain topology - Center reaction center.ket',
'All types of bond - Chain topology - Made broken and changes reaction center.ket',
'All types of bond - Chain topology - Made broken reaction center.ket',
'All types of bond - Chain topology - No change reaction center.ket',
'All types of bond - Chain topology - Not center reaction center.ket',
'All types of bond - Chain topology - Order changes reaction center.ket',
'All types of bond - Chain topology.ket',
'All types of bond - Either topology - Center reaction center.ket',
'All types of bond - Either topology - Mad-broken reaction center.ket',
'All types of bond - Either topology - Made-Broken and changes reaction center.ket',
'All types of bond - Either topology - No change reaction center.ket',
'All types of bond - Either topology - Not center reaction center.ket',
'All types of bond - Either topology - Order changes reaction center.ket',
'All types of bond - Ring topology - Center reaction center.ket',
'All types of bond - Ring topology - Made-Broken and changes reaction center.ket',
'All types of bond - Ring topology - Made-broken reaction center.ket',
'All types of bond - Ring topology - No change reaction center.ket',
'All types of bond - Ring topology - Not center reaction center.ket',
'All types of bond - Ring topology - Order changes reaction center.ket',
'All types of bond - Ring topology.ket',
'All types of bond.ket',
];

for (const fileName of fileNames) {
test(`by ${fileName}`, async ({ page }) => {
await openFileAndAddToCanvasAsNewProject(
`KET/Toggle-Explicit-Hydrogens/All types of bond/Ordinary Bonds/${fileName}`,
page,
);
await page.mouse.click(200, 200);
await waitForSpinnerFinishedWork(page, async () => {
await selectTopPanelButton(
TopPanelButton.toggleExplicitHydrogens,
page,
);
});
await takeEditorScreenshot(page);

await waitForSpinnerFinishedWork(page, async () => {
await selectTopPanelButton(
TopPanelButton.toggleExplicitHydrogens,
page,
);
});
await takeEditorScreenshot(page);
});
}
});

test.describe('2. Molecules connected ', () => {
/*
Test case: https://github.com/epam/ketcher/issues/3959 - Case 23
Description: User can expand hydrogens for molecules connected by custom query bonds
1. Clear canvas
2. Open from file: All Custom Query Bonds.ket
3. Press Add/Remove explicit hydrogens button
4. Validate canvas
5. Press Add/Remove explicit hydrogens button
6. Validate canvas
IMPORTANT: Test results are not correct because of https://github.com/epam/Indigo/issues/1622 issue.
IMPORTANT: Test results are not correct because of https://github.com/epam/Indigo/issues/1623 issue.
Screenshots have to be corrected after fix.
*/

test.beforeEach(async ({ page }) => {
await waitForPageInit(page);
});

const fileNames = ['All Custom Query Bonds.ket'];

for (const fileName of fileNames) {
test(`by ${fileName}`, async ({ page }) => {
await openFileAndAddToCanvasAsNewProject(
`KET/Toggle-Explicit-Hydrogens/All types of bond/Custom Query Bonds/${fileName}`,
page,
);
await page.mouse.click(200, 200);
await waitForSpinnerFinishedWork(page, async () => {
await selectTopPanelButton(
TopPanelButton.toggleExplicitHydrogens,
page,
);
});
await takeEditorScreenshot(page);

await waitForSpinnerFinishedWork(page, async () => {
await selectTopPanelButton(
TopPanelButton.toggleExplicitHydrogens,
page,
);
});
await takeEditorScreenshot(page);
});
}
});

test.describe('3. Molecules connected ', () => {
/*
Test case: https://github.com/epam/ketcher/issues/3959 - Case [22-43]
Description: User can expand hydrogens for molecules connected by custom query bonds
1. Clear canvas
2. Open from file: All Custom Query Bonds.ket
3. Press Add/Remove explicit hydrogens button
4. Validate canvas
5. Press Add/Remove explicit hydrogens button
6. Validate canvas
IMPORTANT: Test results are not correct because of https://github.com/epam/Indigo/issues/1611 issue.
Screenshots have to be corrected after fix.
*/

test.beforeEach(async ({ page }) => {
await waitForPageInit(page);
});

const fileNames = [
'All types of bond with Query feature atom on the canvas - Chain topology - Center reaction center.ket',
'All types of bond with Query feature atom on the canvas - Chain topology - Made broken and changes reaction center.ket',
'All types of bond with Query feature atom on the canvas - Chain topology - Made broken reaction center.ket',
'All types of bond with Query feature atom on the canvas - Chain topology - No change reaction center.ket',
'All types of bond with Query feature atom on the canvas - Chain topology - Not center reaction center.ket',
'All types of bond with Query feature atom on the canvas - Chain topology - Order changes reaction center.ket',
'All types of bond with Query feature atom on the canvas - Chain topology.ket',
'All types of bond with Query feature atom on the canvas - Either topology - Center reaction center.ket',
'All types of bond with Query feature atom on the canvas - Either topology - Made-Broken and changes reaction center.ket',
'All types of bond with Query feature atom on the canvas - Either topology - Made-broken reaction center.ket',
'All types of bond with Query feature atom on the canvas - Either topology - No change reaction center.ket',
'All types of bond with Query feature atom on the canvas - Either topology - Not center reaction center.ket',
'All types of bond with Query feature atom on the canvas - Either topology - Order changes reaction center.ket',
'All types of bond with Query feature atom on the canvas - Ring topology - Center reaction center.ket',
'All types of bond with Query feature atom on the canvas - Ring topology - Made-Broken and changes reaction center.ket',
'All types of bond with Query feature atom on the canvas - Ring topology - Made-broken reaction center.ket',
'All types of bond with Query feature atom on the canvas - Ring topology - No change reaction center.ket',
'All types of bond with Query feature atom on the canvas - Ring topology - Not center reaction center.ket',
'All types of bond with Query feature atom on the canvas - Ring topology - Order changes reaction center.ket',
'All types of bond with Query feature atom on the canvas - Ring topology.ket',
'All types of bond with Query feature atom on the canvas.ket',
];

for (const fileName of fileNames) {
test(`by ${fileName}`, async ({ page }) => {
await openFileAndAddToCanvasAsNewProject(
`KET/Toggle-Explicit-Hydrogens/All types of bond/Ordinary Bonds/All types of bond with Query feature atom on the canvas/${fileName}`,
page,
);
await page.mouse.click(200, 200);
await waitForSpinnerFinishedWork(page, async () => {
await selectTopPanelButton(
TopPanelButton.toggleExplicitHydrogens,
page,
);
});
await takeEditorScreenshot(page);

await waitForSpinnerFinishedWork(page, async () => {
await selectTopPanelButton(
TopPanelButton.toggleExplicitHydrogens,
page,
);
});
await takeEditorScreenshot(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
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.
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.
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

0 comments on commit 25aa283

Please sign in to comment.