Skip to content

Commit

Permalink
Autotests: #5162 - save load insert select move and scale images on c…
Browse files Browse the repository at this point in the history
…anvas (#5165)

* - added tests for Images test cases;
- added helper functions;
- added test files;
- added expected snapshots

* - tests refactored

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

* - updated tests

* - updated tests

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

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

* - added tests;
- added expected snapshots

* - added tests;
- added expected snapshots

* - added tests;
- added test files;
- added helper method;
- added expected snapshots

* - updated snapshots for fixed tests

* - added tests;
- added expected snapshots

* - added tests;
- added test files;
- added helper method;
- added expected snapshots

* refactored all tests for images

* - updated snapshots

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

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

* added tests

* added tests
  • Loading branch information
Zhirnoff authored and Guch1g0v committed Oct 17, 2024
1 parent 04a0ee6 commit 8687434
Show file tree
Hide file tree
Showing 251 changed files with 37,358 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 @@ -2114,6 +2114,21 @@ test.describe('Macro-Micro-Switcher', () => {
await takeEditorScreenshot(page);
});

test('Verify that added to Canvas images together (PNG, SVG) are not presented on the Canvas after switching to Macro mode and presented after returning to Micro', async () => {
/**
* Test case: #4911
* Description: Added to Canvas images together (PNG, SVG) are not presented on the
* Canvas after switching to Macro mode and presented after returning to Micro
*/

await openFileAndAddToCanvas('KET/images-png-svg.ket', page);
await takeEditorScreenshot(page);
await turnOnMacromoleculesEditor(page);
await takeEditorScreenshot(page);
await turnOnMicromoleculesEditor(page);
await takeEditorScreenshot(page);
});

test.fail(
'Validate that it is possible to save micro-macro connection to ket file',
async () => {
Expand Down
27 changes: 27 additions & 0 deletions ketcher-autotests/tests/test-data/Images/clean-svg.svg
Binary file not shown.
Binary file not shown.
Binary file not shown.
63 changes: 63 additions & 0 deletions ketcher-autotests/tests/test-data/Images/image-svg-demo.svg
4 changes: 4 additions & 0 deletions ketcher-autotests/tests/test-data/Images/image-svg.svg
Binary file not shown.
Binary file not shown.
24 changes: 24 additions & 0 deletions ketcher-autotests/tests/test-data/KET/clean-svg-expected.ket
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"root": {
"nodes": [
{
"type": "rasterImage",
"center": {
"x": 14.700000000000001,
"y": -8,
"z": 0
},
"data": {
"bitmap": "data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjMDAwMDAwIiBoZWlnaHQ9IjgwMHB4IiB3aWR0aD0iODAwcHgiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmlld0JveD0iMCAwIDUxMi4wMDEgNTEyLjAwMSIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8Zz4NCiAgICA8Zz4NCiAgICAgICAgPHBhdGggZD0iTTI2Ni4xNzQsMjQ2LjY0NmMtMTUuMTk0LTIyLjg0OS0zNi43LTM5LjkzOC02Mi4xOTItNDkuNDIxYy00Ljc0LTEuNzY1LTEwLjAxOCwwLjY1LTExLjc4Miw1LjM5M2MtMS43NjUsNC43NDQsMC42NDksMTAuMDE5LDUuMzkzLDExLjc4M2MyMS44NDQsOC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