Skip to content

Commit

Permalink
Changing method (#6163)
Browse files Browse the repository at this point in the history
* Changing method

* revert

---------

Co-authored-by: Konstantin_Nadonenko <[email protected]>
  • Loading branch information
knadonenko and knadonenkoepam authored Dec 25, 2024
1 parent ba77ab9 commit 4f48328
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
setReactionMarginSizeOptionUnit,
setReactionMarginSizeValue,
selectAllStructuresOnCanvas,
selectClearCanvasTool,
} from '@utils';
import {
FileType,
Expand Down Expand Up @@ -120,7 +121,7 @@ test.describe('Tests for API setMolecule/getMolecule', () => {
await takeEditorScreenshot(page);

await pressUndoButton(page);
await page.keyboard.press('Control+Delete');
await selectClearCanvasTool(page);
await takeEditorScreenshot(page);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ test.describe('Image files', () => {
await takeEditorScreenshot(page);
await pressUndoButton(page);
await takeEditorScreenshot(page);
await page.keyboard.press('Control+Delete');
await selectClearCanvasTool(page);
await takeEditorScreenshot(page);
});

Expand All @@ -698,7 +698,7 @@ test.describe('Image files', () => {
await takeEditorScreenshot(page);
await pressUndoButton(page);
await takeEditorScreenshot(page);
await page.keyboard.press('Control+Delete');
await selectClearCanvasTool(page);
await takeEditorScreenshot(page);
});

Expand All @@ -716,7 +716,7 @@ test.describe('Image files', () => {
await takeEditorScreenshot(page);
await pressUndoButton(page);
await takeEditorScreenshot(page);
await page.keyboard.press('Control+Delete');
await selectClearCanvasTool(page);
await takeEditorScreenshot(page);
});

Expand All @@ -732,7 +732,7 @@ test.describe('Image files', () => {
await takeEditorScreenshot(page);
await pressUndoButton(page);
await takeEditorScreenshot(page);
await page.keyboard.press('Control+Delete');
await selectClearCanvasTool(page);
await takeEditorScreenshot(page);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ test.describe('Clear Canvas Tool', () => {
page,
);
await takeEditorScreenshot(page);
await page.getByTestId('clear-canvas').click();
await selectClearCanvasTool(page);
await takeEditorScreenshot(page);
});

Expand All @@ -149,7 +149,7 @@ test.describe('Clear Canvas Tool', () => {
);
}
});
await page.getByTestId('clear-canvas').click();
await selectClearCanvasTool(page);
});

test('Check that after creating a monomer structure and click Clear Canvas button and then Undo structure back for same place', async ({
Expand All @@ -160,7 +160,7 @@ test.describe('Clear Canvas Tool', () => {
Description: After click Undo structure back for same place.
*/
await openFileAndAddToCanvasAsNewProject(`KET/chems-connected.ket`, page);
await page.getByTestId('clear-canvas').click();
await selectClearCanvasTool(page);
await takeEditorScreenshot(page);
await page.getByTestId('undo').click();
await takeEditorScreenshot(page);
Expand All @@ -174,7 +174,7 @@ test.describe('Clear Canvas Tool', () => {
Description: Undo/Redo functionality works properly.
*/
await openFileAndAddToCanvasAsNewProject(`KET/chems-connected.ket`, page);
await page.getByTestId('clear-canvas').click();
await selectClearCanvasTool(page);
await takeEditorScreenshot(page);
await page.getByTestId('undo').click();
await takeEditorScreenshot(page);
Expand All @@ -195,7 +195,7 @@ test.describe('Clear Canvas Tool', () => {
);
await selectPartOfMolecules(page);
await takeEditorScreenshot(page);
await page.getByTestId('clear-canvas').click();
await selectClearCanvasTool(page);
await takeEditorScreenshot(page);
});

Expand All @@ -212,7 +212,7 @@ test.describe('Clear Canvas Tool', () => {
);
await takeEditorScreenshot(page);
await turnOnMicromoleculesEditor(page);
await page.getByTestId('clear-canvas').click();
await selectClearCanvasTool(page);
await takeEditorScreenshot(page);
await turnOnMacromoleculesEditor(page);
await takeEditorScreenshot(page);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@ test.describe('RNA Library', () => {
Description: Canvas is cleared
*/
await drawThreeMonomersConnectedWithBonds(page);
await page.getByTestId('clear-canvas').click();
await selectClearCanvasTool(page);
await takeEditorScreenshot(page);
});

Expand All @@ -990,7 +990,7 @@ test.describe('RNA Library', () => {
'KET/monomers-connected-with-bonds.ket',
page,
);
await page.getByTestId('clear-canvas').click();
await selectClearCanvasTool(page);
await takeEditorScreenshot(page);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ test.describe('Multi-Tailed Arrow Tool', () => {
await takeEditorScreenshot(page);
await pressUndoButton(page);
await takeEditorScreenshot(page);
await page.keyboard.press('Control+Delete');
await selectClearCanvasTool(page);
await takeEditorScreenshot(page);
});

Expand All @@ -640,7 +640,7 @@ test.describe('Multi-Tailed Arrow Tool', () => {
await takeEditorScreenshot(page);
await pressUndoButton(page);
await takeEditorScreenshot(page);
await page.keyboard.press('Control+Delete');
await selectClearCanvasTool(page);
await takeEditorScreenshot(page);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
resetCurrentTool,
selectAllStructuresOnCanvas,
clickOnCanvas,
selectClearCanvasTool,
} from '@utils';
import { getExtendedSmiles, getMolfile } from '@utils/formats';
import { pressUndoButton } from '@utils/macromolecules/topToolBar';
Expand Down Expand Up @@ -265,7 +266,7 @@ test.describe('Open Ketcher', () => {
});

await selectAllStructuresOnCanvas(page);
await page.keyboard.press('Control+Delete');
await selectClearCanvasTool(page);
await takeEditorScreenshot(page);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
selectTopPanelButton,
waitForPageInit,
waitForRender,
selectClearCanvasTool,
} from '@utils';
import { addTextBoxToCanvas } from '@utils/addTextBoxToCanvas';
import {
Expand Down Expand Up @@ -99,13 +100,11 @@ test.describe('Clear canvas', () => {
await clickInTheMiddleOfTheScreen(page);
await selectTopPanelButton(TopPanelButton.Clear, page);
await pressUndoButton(page);
await page.keyboard.press('Control+Delete');
await waitForRender(page, async () => {
await pressUndoButton(page);
await pressUndoButton(page);
await pressRedoButton(page);
await pressRedoButton(page);
});
await selectClearCanvasTool(page);
await pressUndoButton(page);
await pressUndoButton(page);
await pressRedoButton(page);
await pressRedoButton(page);
await takeEditorScreenshot(page);
});
});

0 comments on commit 4f48328

Please sign in to comment.