Skip to content

Commit

Permalink
Autotests: #3632 - autotests macromicro switcher (#3638)
Browse files Browse the repository at this point in the history
* - added 10 tests;
- added 3 test files;
- added expected snapshots

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

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

* - added 6 tests;
- added 1 test file;
- added expected snapshots

* updated snapshots

* deleted unused imports

* - code refactoring

* code refactoring

* - added 2 tests for query properties;
- added 1 test file;
- added expected snapshots

* - added 7 tests;
- added 1 test file;
- added expected snapshots

* - code refactor

---------

Co-authored-by: root <root@EPRURYAW0199.epam.com>
  • Loading branch information
Zhirnoff and root authored Dec 8, 2023
1 parent 9b88efa commit 8ab50e3
Show file tree
Hide file tree
Showing 62 changed files with 6,361 additions and 0 deletions.

Large diffs are not rendered by default.

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.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ import {
setRingSize,
setSubstitutionCount,
setUnsaturated,
openFileAndAddToCanvas,
copyAndPaste,
cutAndPaste,
} from '@utils';

async function drawStructure(page: Page) {
Expand Down Expand Up @@ -171,3 +174,43 @@ test.describe('Checking query specific attributes in SMARTS format', () => {
);
});
});

test.describe('Checking query specific attributes in SMARTS format', () => {
test.beforeEach(async ({ page }) => {
await waitForPageInit(page);
});

test('Create Benzene ring with atom properties and query properties then copy/paste ', async ({
page,
}) => {
/*
Test case: Query specific properties
Description: Structure with query specific copy/paste without errors.
Now test working incorrect because we have bug https://github.com/epam/ketcher/issues/3636
*/
const x = 300;
const y = 300;
await openFileAndAddToCanvas('KET/two-benzene-with-query.ket', page);
await copyAndPaste(page);
await page.mouse.click(x, y);
await page.getByText('...').first().hover();
await takeEditorScreenshot(page);
});

test('Create Benzene ring with atom properties and query properties then cut/paste ', async ({
page,
}) => {
/*
Test case: Query specific properties
Description: Structure with query specific cut/paste without errors.
Now test working incorrect because we have bug https://github.com/epam/ketcher/issues/3636
*/
const x = 300;
const y = 300;
await openFileAndAddToCanvas('KET/two-benzene-with-query.ket', page);
await cutAndPaste(page);
await page.mouse.click(x, y);
await page.getByText('...').first().hover();
await takeEditorScreenshot(page);
});
});
274 changes: 274 additions & 0 deletions ketcher-autotests/tests/test-data/KET/benzene-rings-with-text.ket
Original file line number Diff line number Diff line change
@@ -0,0 +1,274 @@
{
"root": {
"nodes": [
{
"$ref": "mol0"
},
{
"$ref": "mol1"
},
{
"type": "text",
"data": {
"content": "{\"blocks\":[{\"key\":\"5n1rk\",\"text\":\"Some Text\",\"type\":\"unstyled\",\"depth\":0,\"inlineStyleRanges\":[],\"entityRanges\":[],\"data\":{}}],\"entityMap\":{}}",
"position": {
"x": 9.825000000000001,
"y": -7.050000000000001,
"z": 0
},
"pos": [
{
"x": 9.825000000000001,
"y": -7.050000000000001,
"z": 0
},
{
"x": 9.825000000000001,
"y": -7.4100000143051155,
"z": 0
},
{
"x": 11.36417236328125,
"y": -7.4100000143051155,
"z": 0
},
{
"x": 11.36417236328125,
"y": -7.050000000000001,
"z": 0
}
]
}
},
{
"type": "text",
"data": {
"content": "{\"blocks\":[{\"key\":\"mnuf\",\"text\":\"!@#$%^&QAagsetwfky\",\"type\":\"unstyled\",\"depth\":0,\"inlineStyleRanges\":[],\"entityRanges\":[],\"data\":{}}],\"entityMap\":{}}",
"position": {
"x": 14.600000000000001,
"y": -9.675,
"z": 0
},
"pos": [
{
"x": 14.600000000000001,
"y": -9.675,
"z": 0
},
{
"x": 14.600000000000001,
"y": -10.035000014305115,
"z": 0
},
{
"x": 17.972077560424808,
"y": -10.035000014305115,
"z": 0
},
{
"x": 17.972077560424808,
"y": -9.675,
"z": 0
}
]
}
}
],
"connections": [],
"templates": []
},
"mol0": {
"type": "molecule",
"atoms": [
{
"label": "C",
"location": [
9.63484915212857,
-7.900074417174611,
0
]
},
{
"label": "C",
"location": [
11.365150847871439,
-7.899589229177208,
0
]
},
{
"label": "C",
"location": [
10.501637509491244,
-7.399966888850191,
0
]
},
{
"label": "C",
"location": [
11.365150847871439,
-8.900532067822152,
0
]
},
{
"label": "C",
"location": [
9.63484915212857,
-8.905020056798142,
0
]
},
{
"label": "C",
"location": [
10.503820855479564,
-9.400033111149817,
0
]
}
],
"bonds": [
{
"type": 2,
"atoms": [
2,
0
]
},
{
"type": 1,
"atoms": [
0,
4
]
},
{
"type": 2,
"atoms": [
4,
5
]
},
{
"type": 1,
"atoms": [
5,
3
]
},
{
"type": 2,
"atoms": [
3,
1
]
},
{
"type": 1,
"atoms": [
1,
2
]
}
]
},
"mol1": {
"type": "molecule",
"atoms": [
{
"label": "C",
"location": [
13.734849152128573,
-7.850074417174611,
0
]
},
{
"label": "C",
"location": [
15.465150847871442,
-7.849589229177207,
0
]
},
{
"label": "C",
"location": [
14.601637509491248,
-7.34996688885019,
0
]
},
{
"label": "C",
"location": [
15.465150847871442,
-8.85053206782215,
0
]
},
{
"label": "C",
"location": [
13.734849152128573,
-8.855020056798141,
0
]
},
{
"label": "C",
"location": [
14.603820855479567,
-9.350033111149816,
0
]
}
],
"bonds": [
{
"type": 2,
"atoms": [
2,
0
]
},
{
"type": 1,
"atoms": [
0,
4
]
},
{
"type": 2,
"atoms": [
4,
5
]
},
{
"type": 1,
"atoms": [
5,
3
]
},
{
"type": 2,
"atoms": [
3,
1
]
},
{
"type": 1,
"atoms": [
1,
2
]
}
]
}
}
Loading

0 comments on commit 8ab50e3

Please sign in to comment.