Skip to content

Commit

Permalink
#4212 - Limit size of structures in preview (#5441)
Browse files Browse the repository at this point in the history
- fixed calculation of structure size for previews
- updated screenshots
  • Loading branch information
rrodionov91 authored Sep 13, 2024
1 parent c3a1c3b commit c2e25c5
Show file tree
Hide file tree
Showing 3,944 changed files with 3,543 additions and 3,240 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
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 @@ -78,7 +78,9 @@ test.describe('Check attachment point rotation', () => {
// Get rid of flakiness because of preview
await page.waitForSelector('[data-testid="polymer-library-preview"]');

await takeEditorScreenshot(page);
await takeEditorScreenshot(page, {
masks: [page.getByTestId('polymer-library-preview')],
});

// Hover 2nd peptide
await moveMouseAway(page);
Expand All @@ -87,7 +89,9 @@ test.describe('Check attachment point rotation', () => {
// Get rid of flakiness because of preview
await page.waitForSelector('[data-testid="polymer-library-preview"]');

await takeEditorScreenshot(page);
await takeEditorScreenshot(page, {
masks: [page.getByTestId('polymer-library-preview')],
});
});

test('Move monomer bonded with another monomers and check attachment points', async ({
Expand Down Expand Up @@ -129,7 +133,9 @@ test.describe('Check attachment point rotation', () => {
await moveMouseAway(page);
await peptide1.hover();

await takeEditorScreenshot(page);
await takeEditorScreenshot(page, {
masks: [page.getByTestId('polymer-library-preview')],
});

// Move selected monomer
await selectRectangleSelectionTool(page);
Expand All @@ -141,6 +147,8 @@ test.describe('Check attachment point rotation', () => {
// Hover 1th peptide
await peptide1.hover();
await page.getByTestId('polymer-library-preview');
await takeEditorScreenshot(page);
await takeEditorScreenshot(page, {
masks: [page.getByTestId('polymer-library-preview')],
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -221,27 +221,37 @@ test.describe('Common connection rules: ', () => {
// Peptide
await dragBondFromMonomerCenterAwayTo(page, 'SMPEG2', 500, 400);
await page.keyboard.press('Escape');
await takeEditorScreenshot(page);
await takeEditorScreenshot(page, {
masks: [page.getByTestId('polymer-library-preview')],
});
await page.mouse.up();
// CHEM
await dragBondFromMonomerCenterAwayTo(page, 'LysiPr', 500, 400);
await page.keyboard.press('Escape');
await takeEditorScreenshot(page);
await takeEditorScreenshot(page, {
masks: [page.getByTestId('polymer-library-preview')],
});
await page.mouse.up();
// Sugar
await dragBondFromMonomerCenterAwayTo(page, '12ddR', 500, 400);
await page.keyboard.press('Escape');
await takeEditorScreenshot(page);
await takeEditorScreenshot(page, {
masks: [page.getByTestId('polymer-library-preview')],
});
await page.mouse.up();
// Phosphate
await dragBondFromMonomerCenterAwayTo(page, 'P', 500, 400);
await page.keyboard.press('Escape');
await takeEditorScreenshot(page);
await takeEditorScreenshot(page, {
masks: [page.getByTestId('polymer-library-preview')],
});
await page.mouse.up();
// Base
await dragBondFromMonomerCenterAwayTo(page, 'c7io7n', 500, 400);
await page.keyboard.press('Escape');
await takeEditorScreenshot(page);
await takeEditorScreenshot(page, {
masks: [page.getByTestId('polymer-library-preview')],
});
await page.mouse.up();
});

Expand All @@ -261,27 +271,37 @@ test.describe('Common connection rules: ', () => {
// Peptide
await dragBondFromMonomerCenterTo(page, 'SMPEG2', 'sDBL');
await page.keyboard.press('Escape');
await takeEditorScreenshot(page);
await takeEditorScreenshot(page, {
masks: [page.getByTestId('polymer-library-preview')],
});
await page.mouse.up();
// CHEM
await dragBondFromMonomerCenterTo(page, 'LysiPr', 'Hcy');
await page.keyboard.press('Escape');
await takeEditorScreenshot(page);
await takeEditorScreenshot(page, {
masks: [page.getByTestId('polymer-library-preview')],
});
await page.mouse.up();
// Sugar
await dragBondFromMonomerCenterTo(page, '12ddR', 'nC62r');
await page.keyboard.press('Escape');
await takeEditorScreenshot(page);
await takeEditorScreenshot(page, {
masks: [page.getByTestId('polymer-library-preview')],
});
await page.mouse.up();
// Phosphate
await dragBondFromMonomerCenterTo(page, 'P', 'mn');
await page.keyboard.press('Escape');
await takeEditorScreenshot(page);
await takeEditorScreenshot(page, {
masks: [page.getByTestId('polymer-library-preview')],
});
await page.mouse.up();
// Base
await dragBondFromMonomerCenterTo(page, 'c7io7n', 'nC6n5U');
await page.keyboard.press('Escape');
await takeEditorScreenshot(page);
await takeEditorScreenshot(page, {
masks: [page.getByTestId('polymer-library-preview')],
});
await page.mouse.up();
});

Expand All @@ -302,19 +322,29 @@ test.describe('Common connection rules: ', () => {

// Peptide
await hoverMouseOverMonomerNTymes(page, 'sDBL', 10);
await takeEditorScreenshot(page);
await takeEditorScreenshot(page, {
masks: [page.getByTestId('polymer-library-preview')],
});
// CHEM
await hoverMouseOverMonomerNTymes(page, 'Hcy', 10);
await takeEditorScreenshot(page);
await takeEditorScreenshot(page, {
masks: [page.getByTestId('polymer-library-preview')],
});
// Sugar
await hoverMouseOverMonomerNTymes(page, 'nC62r', 10);
await takeEditorScreenshot(page);
await takeEditorScreenshot(page, {
masks: [page.getByTestId('polymer-library-preview')],
});
// Phosphate
await hoverMouseOverMonomerNTymes(page, 'mn', 10);
await takeEditorScreenshot(page);
await takeEditorScreenshot(page, {
masks: [page.getByTestId('polymer-library-preview')],
});
// Base
await hoverMouseOverMonomerNTymes(page, 'nC6n5U', 10);
await takeEditorScreenshot(page);
await takeEditorScreenshot(page, {
masks: [page.getByTestId('polymer-library-preview')],
});

await selectFlexLayoutModeTool(page);
});
Expand All @@ -338,17 +368,25 @@ test.describe('Common connection rules: ', () => {
// Check that 4 connected by Bond A6OH monomers can moving after using Rectangle Selection
await selectRectangleArea(page, 100, 100, 800, 800);
await grabSelectionAndMoveTo(page, 'A6OH', 200, 200);
await takeEditorScreenshot(page);
await takeEditorScreenshot(page, {
masks: [page.getByTestId('polymer-library-preview')],
});

// Check that 4 connected by Bond A6OH monomers are possible to Zoom In/ Zoom Out
await page.keyboard.press('Control+=');
await takeEditorScreenshot(page);
await takeEditorScreenshot(page, {
masks: [page.getByTestId('polymer-library-preview')],
});
await page.keyboard.press('Control+-');
await takeEditorScreenshot(page);
await takeEditorScreenshot(page, {
masks: [page.getByTestId('polymer-library-preview')],
});

// Check that 4 connected by Bond A6OH monomers are possible to Erase
await eraseMonomer(page, 'A6OH');
await takeEditorScreenshot(page);
await takeEditorScreenshot(page, {
masks: [page.getByTestId('polymer-library-preview')],
});

// Check that 4 connected by Bond A6OH monomers are possible to Save Structure
await saveToKet(page, '4 connected by Bond A6OH-expected.ket');
Expand Down Expand Up @@ -403,10 +441,14 @@ test.describe('Common connection rules: ', () => {
);
// Case 8-9
await page.getByTitle('expand window').click();
await takeEditorScreenshot(page);
await takeEditorScreenshot(page, {
masks: [page.getByTestId('polymer-library-preview')],
});
// Case 10
await page.getByTitle('expand window').click();
await takeEditorScreenshot(page);
await takeEditorScreenshot(page, {
masks: [page.getByTestId('polymer-library-preview')],
});

await pressCancelAtSelectConnectionPointDialog(page);
});
Expand Down Expand Up @@ -439,11 +481,15 @@ test.describe('Common connection rules: ', () => {
//
// await hoverMouseOverMonomer(page, 'Test-6-Ch');
// await delay(1);
// await takeEditorScreenshot(page);
// await takeEditorScreenshot(page, {
// masks: [page.getByTestId('polymer-library-preview')],
// });
//
// await hoverMouseOverMonomer(page, 'F1');
// await delay(1);
// await takeEditorScreenshot(page);
// await takeEditorScreenshot(page, {
// masks: [page.getByTestId('polymer-library-preview')],
// });
// });

test(`Check preview for monomer after loading Mol V3000. Leaving groups are displayed correctly`, async () => {
Expand All @@ -461,7 +507,9 @@ test.describe('Common connection rules: ', () => {

await hoverMouseOverMonomer(page, 'C');
await delay(1);
await takeEditorScreenshot(page);
await takeEditorScreenshot(page, {
masks: [page.getByTestId('polymer-library-preview')],
});
});

test(`Check that Leaving groups (connection/attchment points) are displayed correctly in preview when switching to Micro mode`, async () => {
Expand All @@ -479,7 +527,9 @@ test.describe('Common connection rules: ', () => {
await turnOnMicromoleculesEditor(page);
await page.getByText('C', { exact: true }).locator('..').first().hover();
await delay(1);
await takeEditorScreenshot(page);
await takeEditorScreenshot(page, {
masks: [page.getByTestId('polymer-library-preview')],
});

await turnOnMacromoleculesEditor(page);
});
Expand Down Expand Up @@ -509,13 +559,17 @@ test.describe('Common connection rules: ', () => {
page,
connectionPoint,
);
// await takeEditorScreenshot(page);
// await takeEditorScreenshot(page, {
// masks: [page.getByTestId('polymer-library-preview')],
// });

await selectRightConnectionPointAtSelectConnectionPointDialog(
page,
connectionPoint,
);
// await takeEditorScreenshot(page);
// await takeEditorScreenshot(page, {
// masks: [page.getByTestId('polymer-library-preview')],
// });
}

await pressCancelAtSelectConnectionPointDialog(page);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,9 @@ test.describe('Connection rules for Base monomers: ', () => {

await hoverOverConnectionLine(page);

await takeEditorScreenshot(page);
await takeEditorScreenshot(page, {
masks: [page.getByTestId('polymer-library-preview')],
});
});
},
);
Expand Down Expand Up @@ -557,7 +559,9 @@ test.describe('Connection rules for Base monomers: ', () => {
await zoomWithMouseWheel(page, -600);
await hoverOverConnectionLine(page);

await takeEditorScreenshot(page);
await takeEditorScreenshot(page, {
masks: [page.getByTestId('polymer-library-preview')],
});
});
},
);
Expand Down Expand Up @@ -748,7 +752,9 @@ test.describe('Connection rules for Base monomers: ', () => {
await zoomWithMouseWheel(page, -600);
await hoverOverConnectionLine(page);

await takeEditorScreenshot(page);
await takeEditorScreenshot(page, {
masks: [page.getByTestId('polymer-library-preview')],
});
});
},
);
Expand Down Expand Up @@ -779,7 +785,9 @@ test.describe('Connection rules for Base monomers: ', () => {
await zoomWithMouseWheel(page, -600);
await hoverOverConnectionLine(page);

await takeEditorScreenshot(page);
await takeEditorScreenshot(page, {
masks: [page.getByTestId('polymer-library-preview')],
});
});
});
});
Expand All @@ -806,7 +814,9 @@ test.describe('Connection rules for Base monomers: ', () => {
await zoomWithMouseWheel(page, -600);
await hoverOverConnectionLine(page);

await takeEditorScreenshot(page);
await takeEditorScreenshot(page, {
masks: [page.getByTestId('polymer-library-preview')],
});
});
});
});
Expand Down Expand Up @@ -999,7 +1009,9 @@ test.describe('Connection rules for Base monomers: ', () => {
await zoomWithMouseWheel(page, -600);
await hoverOverConnectionLine(page);

await takeEditorScreenshot(page);
await takeEditorScreenshot(page, {
masks: [page.getByTestId('polymer-library-preview')],
});
});
},
);
Expand Down Expand Up @@ -1035,7 +1047,9 @@ test.describe('Connection rules for Base monomers: ', () => {

await hoverOverConnectionLine(page);

await takeEditorScreenshot(page);
await takeEditorScreenshot(page, {
masks: [page.getByTestId('polymer-library-preview')],
});
});
});
});
Expand Down
Loading

0 comments on commit c2e25c5

Please sign in to comment.