Skip to content

Commit

Permalink
Autotests: #3865 - move and selection (#3881)
Browse files Browse the repository at this point in the history
* - added 9 tests;
- added 7 test files;
- added expected snapshots;
- added 1 helper method

* - added 4 tests;
- added expected snapshots;
- added 2 test files

* - added tests;
- added expected snapshots

* - code refactoring, moving files to appropriate folders

* - added reviewer to auto_assign

* - deleted 'test.fail()' from 3 tests

* - added 5 test for s-group;
- added expected snapshots;
- added 6 test files

---------

Co-authored-by: root <root@EPRURYAW0199.epam.com>
  • Loading branch information
Zhirnoff and root authored Jan 25, 2024
1 parent 041219b commit 3b0588d
Show file tree
Hide file tree
Showing 118 changed files with 16,390 additions and 2,615 deletions.
2 changes: 1 addition & 1 deletion .github/auto_assign.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ useReviewGroups: true
addAssignees: author
reviewGroups:
core:
- nitvex
- ilya-asiyuk-epam
- rrodionov91
developers:
- StarlaStarla
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ test.describe('CML files', () => {
const { fileExpected: cmlFileExpected, file: cmlFile } =
await receiveFileComparisonData({
page,
expectedFileName: 'tests/test-data/cml-12492-compare.cml',
expectedFileName: 'tests/test-data/CML/cml-12492-compare.cml',
});
// comparing cml file with golden cml file
expect(cmlFile).toEqual(cmlFileExpected);
Expand Down Expand Up @@ -64,15 +64,15 @@ test.describe('CML files', () => {
* Test case: EPMLSOPKET-1946
* Description: Saved cml file with structure is compering with paste cml 3 structures
*/
await openFileAddToCanvasTakeScreenshot(page, 'cml-1946.cml');
await openFileAddToCanvasTakeScreenshot(page, 'CML/cml-1946.cml');
// check that structure opened from file is displayed correctly

const expectedFile = await getCml(page);
await saveToFile('cml-1946-expected.cml', expectedFile);
await saveToFile('CML/cml-1946-expected.cml', expectedFile);
const { file: cmlFile, fileExpected: cmlFileExpected } =
await receiveFileComparisonData({
page,
expectedFileName: 'tests/test-data/cml-1946-expected.cml',
expectedFileName: 'tests/test-data/CML/cml-1946-expected.cml',
});
// comparing cml file with golden cml file

Expand All @@ -84,15 +84,18 @@ test.describe('CML files', () => {
* Test case: EPMLSOPKET-1947
Description: Saved cml file with structure is compering with paste reaction from rxn file
*/
await openFileAddToCanvasTakeScreenshot(page, 'cml-1947-reaction.rxn');
await openFileAddToCanvasTakeScreenshot(
page,
'Rxn-V2000/cml-1947-reaction.rxn',
);
// check that structure opened from file is displayed correctly

const expectedFile = await getCml(page);
await saveToFile('cml-1947-reaction-expected.cml', expectedFile);
await saveToFile('CML/cml-1947-reaction-expected.cml', expectedFile);
const { file: cmlFile, fileExpected: cmlFileExpected } =
await receiveFileComparisonData({
page,
expectedFileName: 'tests/test-data/cml-1947-reaction-expected.cml',
expectedFileName: 'tests/test-data/CML/cml-1947-reaction-expected.cml',
});
// comparing cml file with golden cml file

Expand All @@ -107,15 +110,18 @@ test.describe('CML files', () => {
* Description: Saved cml file with structure is compering with paste R-group from a mol file
*/

await openFileAddToCanvasTakeScreenshot(page, 'cml-1948-R-group.mol');
await openFileAddToCanvasTakeScreenshot(
page,
'Molfiles-V2000/cml-1948-R-group.mol',
);
// check that structure opened from file is displayed correctly

const expectedFile = await getCml(page);
await saveToFile('cml-1948-r-group-expected.cml', expectedFile);
await saveToFile('CML/cml-1948-r-group-expected.cml', expectedFile);
const { file: cmlFile, fileExpected: cmlFileExpected } =
await receiveFileComparisonData({
page,
expectedFileName: 'tests/test-data/cml-1948-r-group-expected.cml',
expectedFileName: 'tests/test-data/CML/cml-1948-r-group-expected.cml',
});
// comparing cml file with golden cml file

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ test.describe('Open and Save InChI file', () => {
await clickOnFileFormatDropdown(page);
await selectInChiOption(page);
await page.getByRole('button', { name: 'Save', exact: true }).click();
await openFileAndAddToCanvas('inchi/Alias.inchi', page);
await openFileAndAddToCanvas('InChI/alias.inchi', page);
});

test('Open and Save file - Generate structure from InChI String - inserting incorrect name', async ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ test.describe('SMILES files', () => {
Description: SmileString is correctly generated from structure and vise versa
structure is correctly generated from SmileString.
*/
await openFileAndAddToCanvas('cis-trans-cycle.mol', page);
await openFileAndAddToCanvas('Molfiles-V2000/cis-trans-cycle.mol', page);
await getAndCompareSmiles(
page,
'tests/test-data/smiles-cis-trans-cycle-expected.json',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@ test.describe('Aromatize/Dearomatize Tool', () => {
Only six-cycle structures appear in a Kekule form: with interchanged Single and Double bonds.
All other structures are rendered with a circle inside the cycles.
*/
await openFileAndAddToCanvas('cycles-with-aromatic-bonds.mol', page);
await openFileAndAddToCanvas(
'Molfiles-V2000/cycles-with-aromatic-bonds.mol',
page,
);
await waitForSpinnerFinishedWork(page, async () => {
await selectTopPanelButton(TopPanelButton.Aromatize, page);
});
Expand All @@ -122,7 +125,10 @@ test.describe('Aromatize/Dearomatize Tool', () => {
Description: Only six-cycle structures appear in a Kekule form: with interchanged Single and Double bonds.
All other structures are rendered with a circle inside the cycles. The actions are Undone/Redone.
*/
await openFileAndAddToCanvas('cycles-with-aromatic-bonds.mol', page);
await openFileAndAddToCanvas(
'Molfiles-V2000/cycles-with-aromatic-bonds.mol',
page,
);
await waitForSpinnerFinishedWork(page, async () => {
await selectTopPanelButton(TopPanelButton.Aromatize, page);
});
Expand All @@ -143,7 +149,10 @@ test.describe('Aromatize/Dearomatize Tool', () => {
inside the cycle during any manipulations.
*/
// test is working but structures moves. will fixes after fixing bug with canvas movement after copy/paste
await openFileAndAddToCanvas('cycles-with-aromatic-bonds.mol', page);
await openFileAndAddToCanvas(
'Molfiles-V2000/cycles-with-aromatic-bonds.mol',
page,
);
await copyAndPaste(page);
await page.mouse.click(CANVAS_CLICK_X, CANVAS_CLICK_Y);
await waitForSpinnerFinishedWork(page, async () => {
Expand All @@ -159,7 +168,10 @@ test.describe('Aromatize/Dearomatize Tool', () => {
Description: The structures are pasted. The structures are rendered with a circle
inside the cycle during any manipulations.
*/
await openFileAndAddToCanvas('cycles-with-aromatic-bonds.mol', page);
await openFileAndAddToCanvas(
'Molfiles-V2000/cycles-with-aromatic-bonds.mol',
page,
);
await cutAndPaste(page);
await page.mouse.click(CANVAS_CLICK_X, CANVAS_CLICK_Y);
await waitForSpinnerFinishedWork(page, async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,10 @@ test.describe('Indigo Tools - Calculate CIP Tool', () => {
Description: An atom of a stereo bond is deleted after removing by the 'Erase' tool.
'Undo' action leads to the previous structure with stereo labels.
*/
await openFileAndAddToCanvas('chain-with-stereo-bonds.mol', page);
await openFileAndAddToCanvas(
'Molfiles-V2000/chain-with-stereo-bonds.mol',
page,
);
await selectTopPanelButton(TopPanelButton.Calculate, page);
await selectLeftPanelButton(LeftPanelButton.Erase, page);
const point = await getAtomByIndex(page, { label: 'N' }, 0);
Expand Down Expand Up @@ -351,7 +354,10 @@ test.describe('Indigo Tools - Calculate CIP Tool', () => {
Test case: EPMLSOPKET-1925
Description: New stereobond is added to the Chain structure.
*/
await openFileAndAddToCanvas('chain-with-stereo-bonds.mol', page);
await openFileAndAddToCanvas(
'Molfiles-V2000/chain-with-stereo-bonds.mol',
page,
);
await waitForSpinnerFinishedWork(page, async () => {
await selectTopPanelButton(TopPanelButton.Calculate, page);
});
Expand All @@ -365,7 +371,10 @@ test.describe('Indigo Tools - Calculate CIP Tool', () => {
Test case: EPMLSOPKET-11841
Description: The labels are next to the stereo bonds. When you hover over the label, the tooltip does not appear.
*/
await openFileAndAddToCanvas('chain-with-stereo-bonds.mol', page);
await openFileAndAddToCanvas(
'Molfiles-V2000/chain-with-stereo-bonds.mol',
page,
);
await selectTopPanelButton(TopPanelButton.Calculate, page);
await delay(DELAY_IN_SECONDS.TWO);
const point = await getBondByIndex(page, { type: BondType.SINGLE }, 3);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ test.describe('Indigo Tools - Clean Tools', () => {
Test case: EPMLSOPKET-1786
Description: After the Layout and Clean Up actions the structure features appear undistorted.
*/
await openFileAndAddToCanvas('clean-structure.mol', page);
await openFileAndAddToCanvas('Molfiles-V2000/clean-structure.mol', page);

await waitForSpinnerFinishedWork(
page,
Expand All @@ -168,7 +168,7 @@ test.describe('Indigo Tools - Clean Tools', () => {
Test case: EPMLSOPKET-1787
Description: Clean action is correct for the all selected structures.
*/
await openFileAndAddToCanvas('clean-appoints.mol', page);
await openFileAndAddToCanvas('Molfiles-V2000/clean-appoints.mol', page);

await waitForSpinnerFinishedWork(
page,
Expand Down Expand Up @@ -209,7 +209,7 @@ test.describe('Indigo Tools - Clean Tools', () => {
Description: After the Clean Up and Layout actions the structure
with stereochemistry is appear undistorted.
*/
await openFileAndAddToCanvas('clean-stereo.mol', page);
await openFileAndAddToCanvas('Molfiles-V2000/clean-stereo.mol', page);

await waitForSpinnerFinishedWork(
page,
Expand All @@ -233,7 +233,7 @@ test.describe('Indigo Tools - Clean Tools', () => {
R-group definition is correct.
R-group member's properties aren't changed.
*/
await openFileAndAddToCanvas('clean-rgroups.mol', page);
await openFileAndAddToCanvas('Molfiles-V2000/clean-rgroups.mol', page);

await waitForSpinnerFinishedWork(
page,
Expand All @@ -256,7 +256,7 @@ test.describe('Indigo Tools - Clean Tools', () => {
Clean Up and Layout actions.
S-group properties are correct after the Clean Up and Layout actions.
*/
await openFileAndAddToCanvas('clean-sgroups.mol', page);
await openFileAndAddToCanvas('Molfiles-V2000/clean-sgroups.mol', page);

await waitForSpinnerFinishedWork(
page,
Expand Down Expand Up @@ -316,7 +316,7 @@ test.describe('Indigo Tools - Clean Tools', () => {
Test case: EPMLSOPKET-1803
Description: The Layout action is implemented for the whole canvas.
*/
await openFileAndAddToCanvas('cyclic-structures.mol', page);
await openFileAndAddToCanvas('Molfiles-V2000/cyclic-structures.mol', page);

await waitForSpinnerFinishedWork(
page,
Expand Down
Loading

0 comments on commit 3b0588d

Please sign in to comment.