Skip to content

Commit

Permalink
Merge branch 'master' into 2939-merge-preview-of-abbreviated-structures
Browse files Browse the repository at this point in the history
  • Loading branch information
KonstantinEpam23 committed Aug 9, 2023
2 parents 77f1678 + b77f8f0 commit aa7d150
Show file tree
Hide file tree
Showing 303 changed files with 2,317 additions and 1,827 deletions.
10 changes: 9 additions & 1 deletion .github/auto_assign.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ addAssignees: author
reviewGroups:
core:
- nitvex
- yuleicul
- KonstantinEpam23
- rrodionov91
developers:
- StarlaStarla
Expand All @@ -14,3 +14,11 @@ reviewGroups:
- vitaepam
- SashaGraves
- nanoblit
- chgayane
- AKZhuk
QA:
- Zhirnoff
- AleksandraSmolianinova
- MartaWilliams
- krakmielepam
- y-holik
2 changes: 1 addition & 1 deletion .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ env:
CI_ENVIRONMENT: true
jobs:
playwright_tests:
timeout-minutes: 60
timeout-minutes: 120
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
Expand Down
10 changes: 7 additions & 3 deletions ketcher-autotests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,14 @@ selectNestedTool - select specific tool that has sub / nested levels.

### Run tests:

- **OPTIONAL: Test Polymer Editor **:
If you want to run tests from Polymer Editor, add `ENABLE_POLYMER_EDITOR=true` in scripts:
**OPTIONAL: Test Polymer Editor **:
If you want to run tests from Polymer Editor, add `ENABLE_POLYMER_EDITOR=true` in scripts:

- Root package.json: "build": "ENABLE_POLYMER_EDITOR=true npm run build -w example";
- Root package.json: "build": "ENABLE_POLYMER_EDITOR=true npm run build -w example";

Also make sure, that test is not skipped! Check if test starts with
`test.skip('We test something', async ({ page }) => {`
Remove "skip" before running.

- **Run app in browser: from root directory "ketcher"**:

Expand Down
22 changes: 11 additions & 11 deletions ketcher-autotests/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ dotenv.config();
*/

const ignoredTests = [
'API/**',
'File-Management/Smile-Files/smile-files.spec.ts',
'Examples/**',
// 'API/**',
// 'File-Management/Smile-Files/smile-files.spec.ts',
// 'Examples/**',
// 'Indigo-Tools/**',
// 'R-group-tool/**',
'Reagents/**',
'Structure-Creating-&-Editing/**',
'Templates/Functional-Groups/functional-groups.spec.ts',
'Templates/Functional-Groups/Functional-Group-Tools/functional-group-tools.spec.ts',
'Templates/Salts-and-Solvents/**',
'Templates/User-Templates/**',
// 'Reagents/**',
// 'Structure-Creating-&-Editing/**',
// 'Templates/Functional-Groups/functional-groups.spec.ts',
// 'Templates/Functional-Groups/Functional-Group-Tools/functional-group-tools.spec.ts',
// 'Templates/Salts-and-Solvents/**',
// 'Templates/User-Templates/**',
'utils/**',
];

Expand All @@ -41,7 +41,7 @@ function baseURL(): string {
}

const MAX_NUMBER_OF_RETRIES = 2;
const MAX_NUMBER_OF_FAILURES = 3;
// const MAX_NUMBER_OF_FAILURES = 3;
const isCI = process.env.CI_ENVIRONMENT === 'true';

const config: PlaywrightTestConfig = {
Expand All @@ -61,7 +61,7 @@ const config: PlaywrightTestConfig = {
// },
timeout: 10_000,
},
maxFailures: isCI ? MAX_NUMBER_OF_FAILURES : 0,
// maxFailures: isCI ? MAX_NUMBER_OF_FAILURES : 0,
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
Expand Down
160 changes: 84 additions & 76 deletions ketcher-autotests/tests/API/api-set-get-molecule.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,68 +118,74 @@ test.describe('Tests for API setMolecule/getMolecule', () => {
await setMolecule(page, 'Brc1ccc(COC(Cn2ccnc2)c2ccc(Cl)cc2Cl)c(Cl)c1');
});

test('Set and Get Molecule using V3000 Molfile format', async ({ page }) => {
/*
test.fixme(
'Set and Get Molecule using V3000 Molfile format',
async ({ page }) => {
/*
Test case: EPMLSOPKET- 10095
Description: Molecule set and get using V3000 format
*/
const ignoredLineIndigo = 1;
const orEnantiomer = await readFileContents(
'tests/test-data/or-enantiomer.mol',
);
await setMolecule(page, orEnantiomer);

const { fileExpected: molFileExpected, file: molFile } =
await receiveFileComparisonData({
page,
expectedFileName: 'tests/test-data/test-data-for-enatiomer.mol',
metaDataIndexes: [ignoredLineIndigo],
fileFormat: 'v3000',
});
expect(molFile).toEqual(molFileExpected);
});

test('Set and Get Molecule containing chiral centers', async ({ page }) => {
/*
const ignoredLineIndigo = 1;
const orEnantiomer = await readFileContents(
'tests/test-data/or-enantiomer.mol',
);
await setMolecule(page, orEnantiomer);

const { fileExpected: molFileExpected, file: molFile } =
await receiveFileComparisonData({
page,
expectedFileName: 'tests/test-data/test-data-for-enatiomer.mol',
metaDataIndexes: [ignoredLineIndigo],
fileFormat: 'v3000',
});
expect(molFile).toEqual(molFileExpected);
},
);

test.fixme(
'Set and Get Molecule containing chiral centers',
async ({ page }) => {
/*
Test case: EPMLSOPKET- 10097
Description: Molecule set and get with chiral centers
*/
const indexOfLineWithIndigo = 2;
const indexOfLineWithKetcher = 2;

await setMolecule(page, 'CC(=O)O[C@@H](C)[C@H](O)Cn1cnc2c1ncnc2N');
await delay(DELAY_IN_SECONDS.THREE);

const molV2000FileExpected = await readFileContents(
'tests/test-data/test-data-for-chiral-centersv2000.json',
);
const molV2000File = await getMolfile(page, 'v2000');
const filteredmolV2000FileExpected = filteredFile(
molV2000FileExpected,
indexOfLineWithKetcher,
);
const filteredmolV2000File = filteredFile(
molV2000File,
indexOfLineWithKetcher,
);

expect(filteredmolV2000File).toEqual(filteredmolV2000FileExpected);

const molV3000FileExpected = await readFileContents(
'tests/test-data/test-data-for-chiral-centersv3000.json',
);
const molV3000File = await getMolfile(page, 'v3000');
const filteredmolV3000FileExpected = filteredFile(
molV3000FileExpected,
indexOfLineWithIndigo,
);
const filteredmolV3000File = filteredFile(
molV3000File,
indexOfLineWithIndigo,
);

expect(filteredmolV3000File).toEqual(filteredmolV3000FileExpected);
});
const indexOfLineWithIndigo = 2;
const indexOfLineWithKetcher = 2;

await setMolecule(page, 'CC(=O)O[C@@H](C)[C@H](O)Cn1cnc2c1ncnc2N');
await delay(DELAY_IN_SECONDS.THREE);

const molV2000FileExpected = await readFileContents(
'tests/test-data/test-data-for-chiral-centersv2000.json',
);
const molV2000File = await getMolfile(page, 'v2000');
const filteredmolV2000FileExpected = filteredFile(
molV2000FileExpected,
indexOfLineWithKetcher,
);
const filteredmolV2000File = filteredFile(
molV2000File,
indexOfLineWithKetcher,
);

expect(filteredmolV2000File).toEqual(filteredmolV2000FileExpected);

const molV3000FileExpected = await readFileContents(
'tests/test-data/test-data-for-chiral-centersv3000.json',
);
const molV3000File = await getMolfile(page, 'v3000');
const filteredmolV3000FileExpected = filteredFile(
molV3000FileExpected,
indexOfLineWithIndigo,
);
const filteredmolV3000File = filteredFile(
molV3000File,
indexOfLineWithIndigo,
);

expect(filteredmolV3000File).toEqual(filteredmolV3000FileExpected);
},
);

test('Check DisableQueryElements parameter', async ({ page }) => {
/*
Expand Down Expand Up @@ -338,37 +344,39 @@ test.describe('Tests for API setMolecule/getMolecule', () => {
await page.getByText('Contract Abbreviation').click();
});

test('Add one contracted Functional Group through API ketcher.setMolecule (V3000)', async ({
page,
}) => {
/*
test.fixme(
'Add one contracted Functional Group through API ketcher.setMolecule (V3000)',
async ({ page }) => {
/*
Test case: EPMLSOPKET-13021
Description: one contracted Functional Group added through API ketcher.setMolecule.
Functional Group is able to expand.
*/
await setMolecule(page, FILE_TEST_DATA.oneFunctionalGroupContractedV3000);
await takeEditorScreenshot(page);
await setMolecule(page, FILE_TEST_DATA.oneFunctionalGroupContractedV3000);
await takeEditorScreenshot(page);

await page.getByText('Boc').click({ button: 'right' });
await page.getByText('Expand Abbreviation').click();
});
await page.getByText('Boc').click({ button: 'right' });
await page.getByText('Expand Abbreviation').click();
},
);

test('Add one expanded Functional Group through API ketcher.setMolecule (V3000)', async ({
page,
}) => {
/*
test.fixme(
'Add one expanded Functional Group through API ketcher.setMolecule (V3000)',
async ({ page }) => {
/*
Test case: EPMLSOPKET-13022
Description: one expanded Functional Group added through API ketcher.setMolecule.
Functional Group is able to contract.
*/
await setMolecule(page, FILE_TEST_DATA.oneFunctionalGroupExpandedV3000);
await takeEditorScreenshot(page);
await setMolecule(page, FILE_TEST_DATA.oneFunctionalGroupExpandedV3000);
await takeEditorScreenshot(page);

// eslint-disable-next-line no-magic-numbers
const point = await getAtomByIndex(page, { label: 'C' }, 3);
await page.mouse.click(point.x, point.y, { button: 'right' });
await page.getByText('Contract Abbreviation').click();
});
// eslint-disable-next-line no-magic-numbers
const point = await getAtomByIndex(page, { label: 'C' }, 3);
await page.mouse.click(point.x, point.y, { button: 'right' });
await page.getByText('Contract Abbreviation').click();
},
);

test('Add Functional Groups expanded/contracted through API ketcher.setMolecule (.ket)', async ({
page,
Expand Down
2 changes: 1 addition & 1 deletion ketcher-autotests/tests/Examples/ketcher-canvas.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ test.describe('Drawing atom, Benzene ring, Single and Double Bond', () => {
await clickOnAtom(page, 'C', 2);
});

test('single bond tool', async ({ page }) => {
test.fixme('single bond tool', async ({ page }) => {
/*
* Test case: EPMLSOPKET-1371
*/
Expand Down
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
Expand Up @@ -98,26 +98,27 @@ test.describe('CML files', () => {
expect(cmlFile).toEqual(cmlFileExpected);
});

test('Open and Save file - CML - CML for R-group and other features', async ({
page,
}) => {
/**
* Test case: EPMLSOPKET-1948
* Description: Saved cml file with structure is compering with paste R-group from a mol file
*/

await openFileAddToCanvasTakeScreenshot(page, '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);
const { file: cmlFile, fileExpected: cmlFileExpected } =
await receiveFileComparisonData({
page,
expectedFileName: 'tests/test-data/cml-1948-r-group-expected.cml',
});
// comparing cml file with golden cml file

expect(cmlFile).toEqual(cmlFileExpected);
});
test.fixme(
'Open and Save file - CML - CML for R-group and other features',
async ({ page }) => {
/**
* Test case: EPMLSOPKET-1948
* Description: Saved cml file with structure is compering with paste R-group from a mol file
*/

await openFileAddToCanvasTakeScreenshot(page, '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);
const { file: cmlFile, fileExpected: cmlFileExpected } =
await receiveFileComparisonData({
page,
expectedFileName: 'tests/test-data/cml-1948-r-group-expected.cml',
});
// comparing cml file with golden cml file

expect(cmlFile).toEqual(cmlFileExpected);
},
);
});
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 @@ -247,19 +247,20 @@ test('Open and Save file - Open/Save file with R-Groups 2/2 - save', async ({
expect(molFile).toEqual(molFileExpected);
});

test('Open and Save file - Open/Save file contains Heteroatoms 1/2 - open', async ({
page,
}) => {
/**
* Test case: EPMLSOPKET-1878(1)
* Description: Structure with heteroatoms is opened from mol file correctly
*/
await page.goto('');
test.fixme(
'Open and Save file - Open/Save file contains Heteroatoms 1/2 - open',
async ({ page }) => {
/**
* Test case: EPMLSOPKET-1878(1)
* Description: Structure with heteroatoms is opened from mol file correctly
*/
await page.goto('');

await openFileAndAddToCanvas('Heteroatoms.mol', page);
// check that structure opened from file is displayed correctly
await takeEditorScreenshot(page);
});
await openFileAndAddToCanvas('Heteroatoms.mol', page);
// check that structure opened from file is displayed correctly
await takeEditorScreenshot(page);
},
);

test('Open and Save file - Open/Save file contains Heteroatoms 2/2 - save', async ({
page,
Expand Down
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 aa7d150

Please sign in to comment.