Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/epam/ketcher into 5558-au…
Browse files Browse the repository at this point in the history
…totests-add-ambiguous-monomers-to-the-library-and-allow-their-addition-to-the-canvas
  • Loading branch information
AlexeyGirin committed Oct 10, 2024
2 parents ab3b8ea + cb22a2f commit 707b210
Show file tree
Hide file tree
Showing 19 changed files with 493 additions and 512 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,39 +199,34 @@ test('Open and Save file - Open/Save V3000 *.mol file contains abbreviation 1/2
await takeEditorScreenshot(page);
});

test.fail(
'Open and Save file - Open/Save V3000 *.mol file contains abbreviation 2/2 - save',
async ({ page }) => {
/*
* IMPORTANT: Test fails because we have bug https://github.com/epam/Indigo/issues/2490
* Test case: EPMLSOPKET-1859(2)
* Description: v3000 mol file with abbreviation is opened and saved correctly
*/
await waitForPageInit(page);
test('Open and Save file - Open/Save V3000 *.mol file contains abbreviation 2/2 - save', async ({
page,
}) => {
/*
* Test case: EPMLSOPKET-1859(2)
* Description: v3000 mol file with abbreviation is opened and saved correctly
*/
await waitForPageInit(page);

await openFileAndAddToCanvas(
'Molfiles-V3000/sec-butyl-abr-V3000.mol',
page,
);
const expectedFile = await getMolfile(page, 'v3000');
await saveToFile(
'Molfiles-V3000/sec_butyl_abr_V3000-expected.mol',
expectedFile,
);
const METADATA_STRING_INDEX = [1];
await openFileAndAddToCanvas('Molfiles-V3000/sec-butyl-abr-V3000.mol', page);
const expectedFile = await getMolfile(page, 'v3000');
await saveToFile(
'Molfiles-V3000/sec_butyl_abr_V3000-expected.mol',
expectedFile,
);
const METADATA_STRING_INDEX = [1];

const { fileExpected: molFileExpected, file: molFile } =
await receiveFileComparisonData({
page,
expectedFileName:
'tests/test-data/Molfiles-V3000/sec_butyl_abr_V3000-expected.mol',
fileFormat: 'v3000',
metaDataIndexes: METADATA_STRING_INDEX,
});
const { fileExpected: molFileExpected, file: molFile } =
await receiveFileComparisonData({
page,
expectedFileName:
'tests/test-data/Molfiles-V3000/sec_butyl_abr_V3000-expected.mol',
fileFormat: 'v3000',
metaDataIndexes: METADATA_STRING_INDEX,
});

expect(molFile).toEqual(molFileExpected);
},
);
expect(molFile).toEqual(molFileExpected);
});

test('Open and Save file - Open/Save file with R-Groups 1/2 - open', async ({
page,
Expand Down Expand Up @@ -332,39 +327,34 @@ test('Open and Save file - Open/Save V3000 mol file contains attached data 1/2 -
await takeEditorScreenshot(page);
});

test.fail(
'Open and Save file - Open/Save V3000 mol file contains attached data 2/2 - save',
async ({ page }) => {
/*
* IMPORTANT: Test fails because we have bug https://github.com/epam/Indigo/issues/2490
* Test case: EPMLSOPKET-1882(2)
* Description: Structure with attached data is saved to mol file correctly
*/
await waitForPageInit(page);
test('Open and Save file - Open/Save V3000 mol file contains attached data 2/2 - save', async ({
page,
}) => {
/*
* Test case: EPMLSOPKET-1882(2)
* Description: Structure with attached data is saved to mol file correctly
*/
await waitForPageInit(page);

await openFileAndAddToCanvas(
'Molfiles-V3000/attached-data-V3000.mol',
page,
);
const expectedFile = await getMolfile(page, 'v3000');
await saveToFile(
'Molfiles-V3000/attached-data-V3000-expected.mol',
expectedFile,
);
const METADATA_STRING_INDEX = [1];
await openFileAndAddToCanvas('Molfiles-V3000/attached-data-V3000.mol', page);
const expectedFile = await getMolfile(page, 'v3000');
await saveToFile(
'Molfiles-V3000/attached-data-V3000-expected.mol',
expectedFile,
);
const METADATA_STRING_INDEX = [1];

const { fileExpected: molFileExpected, file: molFile } =
await receiveFileComparisonData({
page,
expectedFileName:
'tests/test-data/Molfiles-V3000/attached-data-V3000-expected.mol',
fileFormat: 'v3000',
metaDataIndexes: METADATA_STRING_INDEX,
});
const { fileExpected: molFileExpected, file: molFile } =
await receiveFileComparisonData({
page,
expectedFileName:
'tests/test-data/Molfiles-V3000/attached-data-V3000-expected.mol',
fileFormat: 'v3000',
metaDataIndexes: METADATA_STRING_INDEX,
});

expect(molFile).toEqual(molFileExpected);
},
);
expect(molFile).toEqual(molFileExpected);
});

test('Open and Save file - V3000 *.mol file contains Heteroatoms 1/2 - open', async ({
page,
Expand All @@ -380,36 +370,34 @@ test('Open and Save file - V3000 *.mol file contains Heteroatoms 1/2 - open', as
await takeEditorScreenshot(page);
});

test.fail(
'Open and Save file - V3000 *.mol file contains Heteroatoms 2/2 - save',
async ({ page }) => {
/**
* IMPORTANT: Test fails because we have bug https://github.com/epam/Indigo/issues/2490
* Test case: EPMLSOPKET-1879(2)
* Description: Structure with heteroatoms is saved correctly to mol file
*/
await waitForPageInit(page);
test('Open and Save file - V3000 *.mol file contains Heteroatoms 2/2 - save', async ({
page,
}) => {
/**
* Test case: EPMLSOPKET-1879(2)
* Description: Structure with heteroatoms is saved correctly to mol file
*/
await waitForPageInit(page);

await openFileAndAddToCanvas('Molfiles-V3000/heteroatoms-V3000.mol', page);
const expectedFile = await getMolfile(page, 'v3000');
await saveToFile(
'Molfiles-V3000/heteroatoms-V3000-expected.mol',
expectedFile,
);
const METADATA_STRING_INDEX = [1];
await openFileAndAddToCanvas('Molfiles-V3000/heteroatoms-V3000.mol', page);
const expectedFile = await getMolfile(page, 'v3000');
await saveToFile(
'Molfiles-V3000/heteroatoms-V3000-expected.mol',
expectedFile,
);
const METADATA_STRING_INDEX = [1];

const { fileExpected: molFileExpected, file: molFile } =
await receiveFileComparisonData({
page,
expectedFileName:
'tests/test-data/Molfiles-V3000/heteroatoms-V3000-expected.mol',
fileFormat: 'v3000',
metaDataIndexes: METADATA_STRING_INDEX,
});
const { fileExpected: molFileExpected, file: molFile } =
await receiveFileComparisonData({
page,
expectedFileName:
'tests/test-data/Molfiles-V3000/heteroatoms-V3000-expected.mol',
fileFormat: 'v3000',
metaDataIndexes: METADATA_STRING_INDEX,
});

expect(molFile).toEqual(molFileExpected);
},
);
expect(molFile).toEqual(molFileExpected);
});

test('Open and Save file - Open/Save file with Attached data 1/2 - open', async ({
page,
Expand Down Expand Up @@ -504,61 +492,56 @@ test('Open and Save file - Open/Save V3000 mol file contains abs stereochemistry
await takeEditorScreenshot(page);
});

test.fail(
'Open and Save file - Open/Save V3000 mol file contains abs stereochemistry 2/2 - save',
async ({ page }) => {
/*
* IMPORTANT: Test fails because we have bug https://github.com/epam/Indigo/issues/2490
* Test case: EPMLSOPKET-1884(2)
* Description: Structure with abs stereochemistry is saved correctly to mol file
*/
await waitForPageInit(page);
test('Open and Save file - Open/Save V3000 mol file contains abs stereochemistry 2/2 - save', async ({
page,
}) => {
/*
* Test case: EPMLSOPKET-1884(2)
* Description: Structure with abs stereochemistry is saved correctly to mol file
*/
await waitForPageInit(page);

await openFileAndAddToCanvas('Molfiles-V3000/V3000-abs.mol', page);
const expectedFile = await getMolfile(page, 'v3000');
await saveToFile('Molfiles-V3000/V3000-abs-expected.mol', expectedFile);
const METADATA_STRING_INDEX = [1];
await openFileAndAddToCanvas('Molfiles-V3000/V3000-abs.mol', page);
const expectedFile = await getMolfile(page, 'v3000');
await saveToFile('Molfiles-V3000/V3000-abs-expected.mol', expectedFile);
const METADATA_STRING_INDEX = [1];

const { fileExpected: molFileExpected, file: molFile } =
await receiveFileComparisonData({
page,
expectedFileName:
'tests/test-data/Molfiles-V3000/V3000-abs-expected.mol',
fileFormat: 'v3000',
metaDataIndexes: METADATA_STRING_INDEX,
});
const { fileExpected: molFileExpected, file: molFile } =
await receiveFileComparisonData({
page,
expectedFileName: 'tests/test-data/Molfiles-V3000/V3000-abs-expected.mol',
fileFormat: 'v3000',
metaDataIndexes: METADATA_STRING_INDEX,
});

expect(molFile).toEqual(molFileExpected);
},
);
expect(molFile).toEqual(molFileExpected);
});

test.fail(
'Open and Save file - Save V2000 molfile as V3000 molfile',
async ({ page }) => {
/*
* IMPORTANT: Test fails because we have bug https://github.com/epam/Indigo/issues/2490
* Test case: EPMLSOPKET-1985
* Description: Structure opened from V2000 molfile can be saved to V3000 molfile
*/
await waitForPageInit(page);
test('Open and Save file - Save V2000 molfile as V3000 molfile', async ({
page,
}) => {
/*
* Test case: EPMLSOPKET-1985
* Description: Structure opened from V2000 molfile can be saved to V3000 molfile
*/
await waitForPageInit(page);

await openFileAndAddToCanvas('Molfiles-V2000/spiro2.mol', page);
const expectedFile = await getMolfile(page, 'v3000');
await saveToFile('Molfiles-V3000/spiro-expected.mol', expectedFile);
await openFileAndAddToCanvas('Molfiles-V2000/spiro2.mol', page);
const expectedFile = await getMolfile(page, 'v3000');
await saveToFile('Molfiles-V3000/spiro-expected.mol', expectedFile);

const METADATA_STRINGS_INDEXES = [1, 3];
const METADATA_STRINGS_INDEXES = [1, 3];

const { fileExpected: molFileExpected, file: molFile } =
await receiveFileComparisonData({
page,
expectedFileName: 'tests/test-data/Molfiles-V3000/spiro-expected.mol',
metaDataIndexes: METADATA_STRINGS_INDEXES,
fileFormat: 'v3000',
});
const { fileExpected: molFileExpected, file: molFile } =
await receiveFileComparisonData({
page,
expectedFileName: 'tests/test-data/Molfiles-V3000/spiro-expected.mol',
metaDataIndexes: METADATA_STRINGS_INDEXES,
fileFormat: 'v3000',
});

expect(molFile).toEqual(molFileExpected);
},
);
expect(molFile).toEqual(molFileExpected);
});

test('Open and Save file - Save V3000 molfile as V2000 molfile', async ({
page,
Expand Down Expand Up @@ -730,8 +713,6 @@ test.describe('Open and Save file', () => {

for (const file of files) {
test(`${file.testName}`, async ({ page }) => {
// IMPORTANT: Test fails because we have bug https://github.com/epam/Indigo/issues/2490
if (file.format === 'v3000') test.fail();
await openFileAndAddToCanvas(file.pathToOpen, page);

const expectedFile = await getMolfile(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,36 +356,31 @@ test.describe('Tests for Open and Save RXN file operations', () => {
await takeEditorScreenshot(page);
});

test.fail(
'Open and Save file - V3000 rxn file contains Rgroup 2/2 - save',
async ({ page }) => {
/**
* * IMPORTANT: Test fails because we have bug https://github.com/epam/Indigo/issues/2476
* Test case: EPMLSOPKET-1902(2)
* Description: Reaction can be saved correctly to rxn V3000 file
*/
await openFileAndAddToCanvas('Rxn-V3000/r-group-V3000.rxn', page);
const expectedFile = await getRxn(page, 'v3000');
await saveToFile(
'Rxn-V3000/r-group-V3000-expectedV3000.rxn',
expectedFile,
);
test('Open and Save file - V3000 rxn file contains Rgroup 2/2 - save', async ({
page,
}) => {
/**
* Test case: EPMLSOPKET-1902(2)
* Description: Reaction can be saved correctly to rxn V3000 file
*/
await openFileAndAddToCanvas('Rxn-V3000/r-group-V3000.rxn', page);
const expectedFile = await getRxn(page, 'v3000');
await saveToFile('Rxn-V3000/r-group-V3000-expectedV3000.rxn', expectedFile);

// eslint-disable-next-line no-magic-numbers
const METADATA_STRINGS_INDEXES = [2];
// eslint-disable-next-line no-magic-numbers
const METADATA_STRINGS_INDEXES = [2];

const { fileExpected: rxnFileExpected, file: rxnFile } =
await receiveFileComparisonData({
page,
expectedFileName:
'tests/test-data/Rxn-V3000/r-group-V3000-expectedV3000.rxn',
metaDataIndexes: METADATA_STRINGS_INDEXES,
fileFormat: 'v3000',
});
const { fileExpected: rxnFileExpected, file: rxnFile } =
await receiveFileComparisonData({
page,
expectedFileName:
'tests/test-data/Rxn-V3000/r-group-V3000-expectedV3000.rxn',
metaDataIndexes: METADATA_STRINGS_INDEXES,
fileFormat: 'v3000',
});

expect(rxnFile).toEqual(rxnFileExpected);
},
);
expect(rxnFile).toEqual(rxnFileExpected);
});

test('Validate that unsplit nucleotides connected with phosphates could be saved to rxn2000 file and loaded back', async ({
page,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@ test.describe('CDF files', () => {
await takeEditorScreenshot(page);
});

test.fail('Open SDF v3000 file and save it', async ({ page }) => {
/*
* IMPORTANT: Test fails because we have bug https://github.com/epam/Indigo/issues/2477
*/
test('Open SDF v3000 file and save it', async ({ page }) => {
await openFileAndAddToCanvas('SDF/sdf-v3000-to-open.sdf', page);
try {
const expectedFile = await getSdf(page, 'v3000');
Expand Down
Loading

0 comments on commit 707b210

Please sign in to comment.