Skip to content

Commit

Permalink
First draft (#4873)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexeyGirin authored Jun 21, 2024
1 parent 7ab4107 commit 859bdc7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import {
cutToClipboardByKeyboard,
copyToClipboardByKeyboard,
pasteFromClipboardByKeyboard,
delay,
} from '@utils';
import { getAtomByIndex } from '@utils/canvas/atoms';
import {
Expand Down Expand Up @@ -78,6 +79,9 @@ const buttonIdToTitle: {
test.describe(`Bond tool:`, () => {
let page: Page;

// Experimental number of retries to make test more stable
test.describe.configure({ retries: 5 });

test.beforeAll(async ({ browser }) => {
page = await browser.newPage();
await page.goto('', { waitUntil: 'domcontentloaded' });
Expand Down Expand Up @@ -298,6 +302,8 @@ test.describe(`Bond tool:`, () => {
await page.mouse.click(point.x, point.y);

await copyToClipboardByKeyboard(page);
// Experimental delay - must be removed after waitForSpinnerFinishedWork refactor
delay(2);
await pasteFromClipboardByKeyboard(page);

await waitForRender(page, async () => {
Expand All @@ -309,6 +315,8 @@ test.describe(`Bond tool:`, () => {

await clickInTheMiddleOfTheScreen(page);
await cutToClipboardByKeyboard(page);
// Experimental delay - must be removed after waitForSpinnerFinishedWork refactor
delay(2);
await pasteFromClipboardByKeyboard(page);
await page.mouse.click(point.x + DELTA_X, point.y);
await waitForRender(page, async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ import {
openDropdown,
selectDropdownTool,
getCoordinatesOfTheMiddleOfTheScreen,
waitForSpinnerFinishedWork,
cutToClipboardByKeyboard,
pasteFromClipboardByKeyboard,
copyToClipboardByKeyboard,
Expand Down Expand Up @@ -184,9 +183,7 @@ test.describe('Template Manupulations', () => {
await takeEditorScreenshot(page);
await page.keyboard.press('Control+a');
await page.keyboard.press('Control+a');
await waitForSpinnerFinishedWork(page, async () =>
page.keyboard.press('Control+x'),
);
await cutToClipboardByKeyboard(page);
await page.keyboard.press('Control+z');
},
);
Expand Down

0 comments on commit 859bdc7

Please sign in to comment.