Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/epam/ketcher into 3170-au…
Browse files Browse the repository at this point in the history
…totests-reduce-the-number-of-tests-with-fixme
  • Loading branch information
Nitvex committed Sep 1, 2023
2 parents ac5bf1c + d2ee709 commit 89238a6
Show file tree
Hide file tree
Showing 279 changed files with 2,606 additions and 373 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@ test('Save file - Save *.ket file', async ({ page }) => {
);

const expectedFile = await getKet(page);
await saveToFile('ket-2934-to-compare-expected.ket', expectedFile);
await saveToFile('Ket/ket-2934-to-compare-expected.ket', expectedFile);

const { fileExpected: ketFileExpected, file: ketFile } =
await receiveFileComparisonData({
page,
expectedFileName: 'tests/test-data/ket-2934-to-compare-expected.ket',
expectedFileName: 'tests/test-data/Ket/ket-2934-to-compare-expected.ket',
});

expect(ketFile).toEqual(ketFileExpected);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ test.describe('SMILES files', () => {
Description: Structure is correctly opens from saved files. Keep only first reaction arrow
and keep all structures (all intermediate structures should be products and the arrow is replaced by a plus)
*/
await openFileAndAddToCanvas('two-arrows-and-plus.ket', page);
await openFileAndAddToCanvas('Ket/two-arrows-and-plus.ket', page);
await getAndCompareSmiles(
page,
'tests/test-data/smiles-two-arrows-and-plus-expected.json',
Expand All @@ -298,7 +298,10 @@ test.describe('SMILES files', () => {
Test case: EPMLSOPKET-12965
Description: Structure is not distorted. Reagent NH3 located above reaction arrow.
*/
await openFileAndAddToCanvas('benzene-arrow-benzene-reagent-nh3.ket', page);
await openFileAndAddToCanvas(
'Ket/benzene-arrow-benzene-reagent-nh3.ket',
page,
);
await getAndCompareSmiles(
page,
'tests/test-data/smiles-benzene-arrow-benzene-reagent-nh3-expected.json',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ test.describe('Indigo Tools - Calculate CIP Tool', () => {
Test case: EPMLSOPKET-1886
Description: The structure isn`t changed.
*/
await openFileAndAddToCanvas('chain.ket', page);
await openFileAndAddToCanvas('Ket/chain.ket', page);
await selectTopPanelButton(TopPanelButton.Calculate, page);
});

Expand Down Expand Up @@ -354,13 +354,16 @@ test.describe('Indigo Tools - Calculate CIP Tool', () => {
*/
await openFileAndAddToCanvas('structure-with-stereo-bonds.mol', page);
const expectedFile = await getKet(page);
await saveToFile('structure-with-stereo-bonds-expected.ket', expectedFile);
await saveToFile(
'Ket/structure-with-stereo-bonds-expected.ket',
expectedFile,
);
await selectTopPanelButton(TopPanelButton.Calculate, page);
const { file: ketFile, fileExpected: ketFileExpected } =
await receiveFileComparisonData({
page,
expectedFileName:
'tests/test-data/structure-with-stereo-bonds-expected.ket',
'tests/test-data/Ket/structure-with-stereo-bonds-expected.ket',
});

expect(ketFile).toEqual(ketFileExpected);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ test.describe('Calculated Values Tools', () => {
Description: The 'Calculated Values' modal window is opened,
the 'Chemical Formula' field contains 'C7H16' value.
*/
await openFileAndAddToCanvas('calculated-values-chain.ket', page);
await openFileAndAddToCanvas('Ket/calculated-values-chain.ket', page);
await selectTopPanelButton(TopPanelButton.Calculated, page);
});

Expand Down Expand Up @@ -615,7 +615,7 @@ test.describe('Calculated Values Tools', () => {
*/
const xDelta = 500;
const yDelta = 800;
await openFileAndAddToCanvas('reaction-arrow.ket', page);
await openFileAndAddToCanvas('Ket/reaction-arrow.ket', page);
const { x, y } = await getCoordinatesOfTheMiddleOfTheScreen(page);
await dragMouseTo(x - xDelta, y + yDelta, page);
await selectTopPanelButton(TopPanelButton.Calculated, page);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ test.describe('Indigo Tools - Clean Tools', () => {
The Clean Up action is applied correctly and simultaneously
to the whole structure with stereolabels.
*/
await openFileAndAddToCanvas('stereolabels.ket', page);
await openFileAndAddToCanvas('Ket/stereolabels.ket', page);

await selectTopPanelButton(TopPanelButton.Clean, page);
await delay(DELAY_IN_SECONDS.SEVEN);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,10 @@ test.describe('Enhanced Stereochemistry Tool', () => {
- all stereocenters in an unselected structure have different stereo marks;
- the selected stereocenters have different stereo marks.
*/
await openFileAndAddToCanvas('different-marks-stereostructure.ket', page);
await openFileAndAddToCanvas(
'Ket/different-marks-stereostructure.ket',
page,
);
await selectLeftPanelButton(LeftPanelButton.Stereochemistry, page);
});

Expand Down Expand Up @@ -251,14 +254,15 @@ test.describe('Enhanced Stereochemistry Tool', () => {
All enhanced stereochemistry features are present after opening.
It's possible to edit the stereo marks assignment after opening the saved file.
*/
await openFileAndAddToCanvas('stereo-and-structure.ket', page);
await openFileAndAddToCanvas('Ket/stereo-and-structure.ket', page);
const expectedFile = await getKet(page);
await saveToFile('stereo-and-structure-expected.ket', expectedFile);
await saveToFile('Ket/stereo-and-structure-expected.ket', expectedFile);

const { fileExpected: ketFileExpected, file: ketFile } =
await receiveFileComparisonData({
page,
expectedFileName: 'tests/test-data/stereo-and-structure-expected.ket',
expectedFileName:
'tests/test-data/Ket/stereo-and-structure-expected.ket',
});

expect(ketFile).toEqual(ketFileExpected);
Expand All @@ -277,14 +281,15 @@ test.describe('Enhanced Stereochemistry Tool', () => {
All enhanced stereochemistry features are present after opening.
It's possible to edit the stereo marks assignment after opening the saved file.
*/
await openFileAndAddToCanvas('stereo-or-structure.ket', page);
await openFileAndAddToCanvas('Ket/stereo-or-structure.ket', page);
const expectedFile = await getKet(page);
await saveToFile('stereo-or-structure-expected.ket', expectedFile);
await saveToFile('Ket/stereo-or-structure-expected.ket', expectedFile);

const { fileExpected: ketFileExpected, file: ketFile } =
await receiveFileComparisonData({
page,
expectedFileName: 'tests/test-data/stereo-or-structure-expected.ket',
expectedFileName:
'tests/test-data/Ket/stereo-or-structure-expected.ket',
});

expect(ketFile).toEqual(ketFileExpected);
Expand All @@ -303,14 +308,15 @@ test.describe('Enhanced Stereochemistry Tool', () => {
All enhanced stereochemistry features are present after opening.
It's possible to edit the stereo marks assignment after opening the saved file.
*/
await openFileAndAddToCanvas('stereo-mixed-structure.ket', page);
await openFileAndAddToCanvas('Ket/stereo-mixed-structure.ket', page);
const expectedFile = await getKet(page);
await saveToFile('stereo-mixed-structure-expected.ket', expectedFile);
await saveToFile('Ket/stereo-mixed-structure-expected.ket', expectedFile);

const { fileExpected: ketFileExpected, file: ketFile } =
await receiveFileComparisonData({
page,
expectedFileName: 'tests/test-data/stereo-mixed-structure-expected.ket',
expectedFileName:
'tests/test-data/Ket/stereo-mixed-structure-expected.ket',
});

expect(ketFile).toEqual(ketFileExpected);
Expand All @@ -333,12 +339,13 @@ test.describe('Enhanced Stereochemistry Tool', () => {
*/
await openFileAndAddToCanvas('mixed-and-stereomarks.ket', page);
const expectedFile = await getKet(page);
await saveToFile('mixed-and-stereomarks-expected.ket', expectedFile);
await saveToFile('Ket/mixed-and-stereomarks-expected.ket', expectedFile);

const { fileExpected: ketFileExpected, file: ketFile } =
await receiveFileComparisonData({
page,
expectedFileName: 'tests/test-data/mixed-and-stereomarks-expected.ket',
expectedFileName:
'tests/test-data/Ket/mixed-and-stereomarks-expected.ket',
});

expect(ketFile).toEqual(ketFileExpected);
Expand All @@ -359,14 +366,15 @@ test.describe('Enhanced Stereochemistry Tool', () => {
All enhanced stereochemistry features are present after opening.
It's possible to edit the stereo marks assignment after opening the saved file.
*/
await openFileAndAddToCanvas('mixed-or-stereomarks.ket', page);
await openFileAndAddToCanvas('Ket/mixed-or-stereomarks.ket', page);
const expectedFile = await getKet(page);
await saveToFile('mixed-or-stereomarks-expected.ket', expectedFile);
await saveToFile('Ket/mixed-or-stereomarks-expected.ket', expectedFile);

const { fileExpected: ketFileExpected, file: ketFile } =
await receiveFileComparisonData({
page,
expectedFileName: 'tests/test-data/mixed-or-stereomarks-expected.ket',
expectedFileName:
'tests/test-data/Ket/mixed-or-stereomarks-expected.ket',
});

expect(ketFile).toEqual(ketFileExpected);
Expand All @@ -383,7 +391,10 @@ test.describe('Enhanced Stereochemistry Tool', () => {
Test case: EPMLSOPKET-2267
Description: The '&1' and 'or1' and 'abs' stereo marks appear next to the selected stereocenter.
*/
await openFileAndAddToCanvas('different-marks-stereostructure.ket', page);
await openFileAndAddToCanvas(
'Ket/different-marks-stereostructure.ket',
page,
);
await selectLabelDisplayAtStereogenicCenters(page, 'Classic');
});

Expand All @@ -392,7 +403,10 @@ test.describe('Enhanced Stereochemistry Tool', () => {
Test case: EPMLSOPKET-2268
Description: The '&1' and 'or1' and 'abs' stereo marks appear next to the selected stereocenter.
*/
await openFileAndAddToCanvas('different-marks-stereostructure.ket', page);
await openFileAndAddToCanvas(
'Ket/different-marks-stereostructure.ket',
page,
);
await selectLabelDisplayAtStereogenicCenters(page, 'On');
});

Expand All @@ -401,7 +415,10 @@ test.describe('Enhanced Stereochemistry Tool', () => {
Test case: EPMLSOPKET-2269
Description: Only stereo flag displays near the structure.
*/
await openFileAndAddToCanvas('different-marks-stereostructure.ket', page);
await openFileAndAddToCanvas(
'Ket/different-marks-stereostructure.ket',
page,
);
await selectLabelDisplayAtStereogenicCenters(page, 'Off');
});

Expand All @@ -410,7 +427,10 @@ test.describe('Enhanced Stereochemistry Tool', () => {
Test case: EPMLSOPKET-2270
Description: When 'Off' is selected - Stereobonds and stereo labels are displayed in black.
*/
await openFileAndAddToCanvas('different-marks-stereostructure.ket', page);
await openFileAndAddToCanvas(
'Ket/different-marks-stereostructure.ket',
page,
);
await selectColorOfStereogenicCenters(page, 'Off');
});

Expand All @@ -419,7 +439,10 @@ test.describe('Enhanced Stereochemistry Tool', () => {
Test case: EPMLSOPKET-2270
Description: When 'Labels and Bonds' is selected - Stereobonds and stereo labels are displayed in color.
*/
await openFileAndAddToCanvas('different-marks-stereostructure.ket', page);
await openFileAndAddToCanvas(
'Ket/different-marks-stereostructure.ket',
page,
);
await selectColorOfStereogenicCenters(page, 'Labels and Bonds');
});

Expand All @@ -429,7 +452,10 @@ test.describe('Enhanced Stereochemistry Tool', () => {
Description: When 'Bonds Only' is selected - Stereobonds are displayed in color
and stereo labels are displayed in black.
*/
await openFileAndAddToCanvas('different-marks-stereostructure.ket', page);
await openFileAndAddToCanvas(
'Ket/different-marks-stereostructure.ket',
page,
);
await selectColorOfStereogenicCenters(page, 'Bonds Only');
});

Expand Down Expand Up @@ -533,7 +559,7 @@ test.describe('Enhanced Stereochemistry Tool', () => {
'Add to OR [ ] Group' setting becomes available when at least
one OR group has been created on the canvas.
*/
await openFileAndAddToCanvas('mixed-and-or-structure.ket', page);
await openFileAndAddToCanvas('Ket/mixed-and-or-structure.ket', page);
await selectLeftPanelButton(LeftPanelButton.Stereochemistry, page);
});

Expand All @@ -542,7 +568,10 @@ test.describe('Enhanced Stereochemistry Tool', () => {
Test case: EPMLSOPKET-2862
Description: Labels (&) are colored and color intensity is decreasing with the number.
*/
await openFileAndAddToCanvas('mixed-with-eight-stereocenters.ket', page);
await openFileAndAddToCanvas(
'Ket/mixed-with-eight-stereocenters.ket',
page,
);
await takeEditorScreenshot(page);

await autoFadeCenterLabelsOff(page);
Expand All @@ -563,7 +592,7 @@ test.describe('Enhanced Stereochemistry Tool', () => {
Description: Stereo flag - Mixed2
*/
await editMixedFlagText(page, 'Mixed2');
await openFileAndAddToCanvas('mixed-and-stereomarks.ket', page);
await openFileAndAddToCanvas('Ket/mixed-and-stereomarks.ket', page);
});

test('No overlapping of Stereo flag and structure', async ({ page }) => {
Expand Down
2 changes: 1 addition & 1 deletion ketcher-autotests/tests/Indigo-Tools/Layout/layout.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ test.describe('Indigo Tools - Layout', () => {
page,
}) => {
// Related Github issue: https://github.com/epam/ketcher/issues/3025
const structureWithStereoFlags = 'structure-with-stereo-flags.ket';
const structureWithStereoFlags = 'Ket/structure-with-stereo-flags.ket';
await openFileWithShift(structureWithStereoFlags, page);
await selectTopPanelButton(TopPanelButton.Layout, page);
await selectTopPanelButton(TopPanelButton.Layout, page);
Expand Down
Loading

0 comments on commit 89238a6

Please sign in to comment.