Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
173 commits
Select commit Hold shift + click to select a range
636bd71
cleanup remove TODO
Alber-Writer Oct 19, 2024
6b163f3
adjust h1,h2,h3 and normal-text min-width value
Alber-Writer Oct 19, 2024
efa5f70
Merge pull request #475 from Lemoncode/feature/#472-h1_h2_h3_normal-t…
brauliodiez Oct 19, 2024
0cbc587
Merge pull request #474 from Lemoncode/cleanup-remove-todo
brauliodiez Oct 19, 2024
5c53bf4
subida inicial de archivos para timepickerinline
manugallegob Oct 19, 2024
dde3c83
timepickerinput file components
manugallegob Oct 19, 2024
30a4cb1
sorted
brauliodiez Oct 19, 2024
0c72730
resolved conflict src/pods/canvas/model/inline-editable.model.ts
manugallegob Oct 20, 2024
1083364
refactor timepicker svg and new component behavior
manugallegob Oct 20, 2024
0179246
test passing unit
brauliodiez Oct 20, 2024
792de3d
Merge branch 'dev' into feature/#413-Time-Picker-does-not-accept-inli…
manugallegob Oct 20, 2024
abe6c71
progress thumbnail
brauliodiez Oct 20, 2024
8ff2f0c
#447 Fix Broken e2e Test in sort galley
Alber-Writer Oct 22, 2024
236a24f
add toolbar undo-redo e2e tests
Alber-Writer Oct 21, 2024
6d9ae15
QA add e2e copy-paste tests
Alber-Writer Oct 23, 2024
913a988
add tests for multi-line text editing and cancellation in textarea co…
Franlop7 Oct 23, 2024
9d623e9
add inline editing to the window container title
Franlop7 Oct 23, 2024
ece5b0f
fixes
brauliodiez Oct 24, 2024
4e4e140
Merge pull request #476 from Lemoncode/feature/gallery-sort
brauliodiez Oct 24, 2024
96894f8
Merge branch 'dev' into feature/#121-create-multiple-pages-given-docu…
brauliodiez Oct 24, 2024
111ac37
Merge branch 'dev' into feature/#437--QA]-multiline-inline-edit
brauliodiez Oct 24, 2024
df4ddac
Merge pull request #483 from Lemoncode/feature/#437--QA]-multiline-in…
brauliodiez Oct 24, 2024
92f2f4f
Merge branch 'dev' into feature/#480-QA-Add-e2e-Tests-to-cover-copy_p…
brauliodiez Oct 24, 2024
c31b6de
Merge pull request #482 from Lemoncode/feature/#480-QA-Add-e2e-Tests-…
brauliodiez Oct 24, 2024
338b564
Add 20 new icons of the set of icons
Oct 24, 2024
5c03dea
Merge branch 'dev' into feature/#227-add-icons
Oct 24, 2024
247ae8e
#485 load svg path and modify it
oleojake Oct 24, 2024
0142764
Merge pull request #484 from Lemoncode/feature/#227-add-icons
brauliodiez Oct 24, 2024
88f3065
Merge branch 'dev' into feature/#485-change-icon-color
brauliodiez Oct 24, 2024
23496a3
Merge pull request #486 from Lemoncode/feature/#485-change-icon-color
brauliodiez Oct 25, 2024
714c9ca
Merge branch 'dev' into feature/#439-QA-Undo_Redo-using-toolbar-icons
Alber-Writer Oct 25, 2024
169c7a1
Merge branch 'dev' into feature/#426-add-inline-editing-to-the-window…
Franlop7 Oct 25, 2024
2ffde89
Add new icons of the set
Oct 25, 2024
7c75baf
Fix width and height from the textalignleft svg file
Oct 25, 2024
715ba86
Merge branch 'dev' into feature/#227-add-icons
Oct 25, 2024
b4dea09
Add 20 new icons to the set of icons
Oct 25, 2024
cef2874
#121 added id for konva stage
oleojake Oct 25, 2024
25ef0a4
Merge pull request #479 from Lemoncode/feature/#439-QA-Undo_Redo-usin…
brauliodiez Oct 25, 2024
d5ae42e
fixed merge conflicts
brauliodiez Oct 25, 2024
ebb0bce
Merge pull request #489 from Lemoncode/feature/#121-create-multiple-p…
brauliodiez Oct 25, 2024
926ec0b
Merge branch dev into feature/#413-Time-Picker-does-not-accept-inline…
manugallegob Oct 26, 2024
16e450d
Merge branch 'dev' into feature/#426-add-inline-editing-to-the-window…
brauliodiez Oct 26, 2024
243f4d2
Merge pull request #487 from Lemoncode/feature/#426-add-inline-editin…
brauliodiez Oct 26, 2024
12acea4
Merge branch 'dev' into feature/#227-add-icons
brauliodiez Oct 26, 2024
2d7871e
Merge pull request #488 from Lemoncode/feature/#227-add-icons
brauliodiez Oct 26, 2024
3378698
timepicker component modification: svg, const in english and style
manugallegob Oct 27, 2024
3543619
updating from dev branch to branch 413
manugallegob Oct 27, 2024
9b7c2a2
Add more icons to set of icons
Oct 28, 2024
e3d6722
Merge branch 'dev' into feature/#227-add-icons
Oct 28, 2024
8384d13
Merge pull request #506 from Lemoncode/feature/#227-add-icons
brauliodiez Oct 28, 2024
ace6107
Merge branch 'dev' into feature/#413-Time-Picker-does-not-accept-inli…
brauliodiez Oct 29, 2024
3a0c999
feature/#473-Create-a-gray-semitransparent-Rectangle-Component
El-Mito-de-Giralda Oct 29, 2024
2eb0a72
Closes #491
jsanzdev Oct 29, 2024
2e4a47c
Merge pull request #508 from Lemoncode/feat/#491-Pages-Layout
brauliodiez Oct 30, 2024
eb22e38
Merge branch 'dev' into feature/#413-Time-Picker-does-not-accept-inli…
brauliodiez Oct 30, 2024
7c450d6
#495 first approximation, context menu showing up on thumbnail
oleojake Oct 30, 2024
7944d9f
#495 duplicate page working
oleojake Oct 30, 2024
b78aec4
Add 20 new icons to set of icons
Oct 30, 2024
c8c50f4
Merge branch 'dev' into feature/#227-add-icons
Oct 30, 2024
669701d
calculate bounds and add some extra spacing
Pableras90 Oct 30, 2024
ce8e9fc
Merge pull request #478 from Lemoncode/feature/#413-Time-Picker-does-…
brauliodiez Oct 30, 2024
ba9ad4b
Merge branch 'dev' into feature/#227-add-icons
brauliodiez Oct 30, 2024
4e8981b
#495 limit shape context menu to main canvas
oleojake Oct 30, 2024
473e4de
#495 delete thumb pages working
oleojake Oct 30, 2024
ebb5e62
#495 fix font size
oleojake Oct 30, 2024
0f3451d
Merge pull request #509 from Lemoncode/feature/#227-add-icons
brauliodiez Oct 31, 2024
aff357c
Merge branch 'dev' into feature/#495-allow-the-user-duplicate-page
brauliodiez Oct 31, 2024
1b2222b
Merge branch 'dev' into feature/#473-Create-a-gray-semitransparent-Re…
El-Mito-de-Giralda Oct 31, 2024
13b6f44
feature/#473-Create-a-gray-semitransparent-Rectangle-Component
El-Mito-de-Giralda Oct 31, 2024
c842073
Merge pull request #510 from Lemoncode/feature/#495-allow-the-user-du…
brauliodiez Oct 31, 2024
17c32ec
add option to stroke style none
Franlop7 Oct 31, 2024
e12b3bb
Merge pull request #513 from Lemoncode/feature/#492-add-option-to-str…
brauliodiez Nov 1, 2024
575e073
#496 allow page title edit
oleojake Nov 2, 2024
4013eeb
Merge pull request #514 from Lemoncode/feature/#496-allow-user-edit-p…
brauliodiez Nov 3, 2024
9a364fa
#503 - BugFix
jsanzdev Nov 3, 2024
ee02af5
Updated shapes-to-document tests to handle v0.2 and test v0.1 imports.
jsanzdev Nov 3, 2024
7089754
Merge branch 'dev' into Bug/#502-Loading-0.1-Documents
jsanzdev Nov 3, 2024
2f32321
Merge pull request #515 from Lemoncode/Bug/#502-Loading-0.1-Documents
brauliodiez Nov 3, 2024
3ee5a32
add style thumbnail rectangle and highlight selected
Franlop7 Nov 4, 2024
57c0f72
deleted x and y
Pableras90 Nov 4, 2024
b929c83
update text color to white for active page and change width Stage
Franlop7 Nov 4, 2024
24699c2
Merge pull request #516 from Lemoncode/feature/#493--multipage-docs]-…
brauliodiez Nov 4, 2024
4a6628c
Work in progress
josemitoribio Nov 5, 2024
1e9ee03
Add 20 new icons to set of icons
Nov 5, 2024
dcc2930
Merge branch 'feature/#227-add-icons' of github.com:Lemoncode/quickmo…
Nov 5, 2024
46d0243
Merge branch 'dev' into feature/#227-add-icons
Nov 5, 2024
08b3ada
Create Link Component
josemitoribio Nov 5, 2024
0c4d463
Merge with dev
josemitoribio Nov 5, 2024
4fb7bb4
Merge pull request #518 from Lemoncode/feature/#227-add-icons
brauliodiez Nov 5, 2024
43431fc
Merge branch 'dev' into feature/#473-Create-a-gray-semitransparent-Re…
brauliodiez Nov 5, 2024
15a1abd
updated issue bounds
brauliodiez Nov 5, 2024
6052d75
#495 fix css
oleojake Nov 5, 2024
54d1e14
#495 add caret down icon
oleojake Nov 5, 2024
dc02757
fis css
oleojake Nov 5, 2024
de2fbb8
Merge pull request #517 from Lemoncode/feature/#473-Create-a-gray-sem…
brauliodiez Nov 6, 2024
b8e42d3
test thumb page business
Pableras90 Nov 6, 2024
bf06208
Merge remote-tracking branch 'origin/dev' into feature/#498-calculate…
Pableras90 Nov 6, 2024
c4736aa
#495 add handleclick to caretdown icon
oleojake Nov 6, 2024
bee8561
Merge branch 'dev' into fix/#495-thumbnail-context-menu
brauliodiez Nov 6, 2024
686aa9f
Merge pull request #520 from Lemoncode/fix/#495-thumbnail-context-menu
brauliodiez Nov 6, 2024
0f7eac6
Merge branch 'dev' into feature/#498-calculate-bounds-add-some-extra-…
brauliodiez Nov 6, 2024
fb7a6e7
Changed min width and svg
josemitoribio Nov 6, 2024
e37db67
Merge pull request #521 from Lemoncode/feature/#498-calculate-bounds-…
brauliodiez Nov 6, 2024
a9fc289
Merge pull request #519 from josemitoribio/feature/#431-Create-a-link…
brauliodiez Nov 6, 2024
31944f2
feature/#505 Add Font Size property to all shapes Text
El-Mito-de-Giralda Nov 6, 2024
4b30674
fix
brauliodiez Nov 7, 2024
4fca9ce
Merge pull request #523 from Lemoncode/feature/fix-thumbnail
brauliodiez Nov 7, 2024
0ad91d1
Merge branch 'dev' into feature/#505-Add-Font-Size-property-to-all-sh…
El-Mito-de-Giralda Nov 7, 2024
9187c8a
feature/#505 Add Font Size property to all Text Shapes
El-Mito-de-Giralda Nov 7, 2024
7cc1e1f
work in progress
antonio06 Nov 7, 2024
c7083ef
#505 Add Font Size property to all Text Shapes
El-Mito-de-Giralda Nov 7, 2024
635b0ee
Merge pull request #525 from Lemoncode/feature/#524-Create-a-default-…
brauliodiez Nov 7, 2024
65a25d3
fix tabsbar transformer width - defaultHeight workaround
Alber-Writer Nov 6, 2024
04e9e57
add tabsbar logic business
Alber-Writer Oct 29, 2024
061d7bf
adjust tabsbar text-width methods
Alber-Writer Nov 7, 2024
dfa0812
Create getActivePage and use activePageIndex on addNewPage and duplic…
josemitoribio Nov 8, 2024
bff750b
Merge branch 'dev' into feature/#522-Thumbnail--Set-selected-on-sever…
josemitoribio Nov 8, 2024
8b03fe8
Merge pull request #528 from Lemoncode/feature/#522-Thumbnail--Set-se…
brauliodiez Nov 8, 2024
aef2025
#501 first approximation
oleojake Nov 10, 2024
008a73c
Update README.md
brauliodiez Nov 10, 2024
25e37eb
Style add new page button and responsive thumbnail
deletidev Nov 8, 2024
347b930
Merge remote-tracking branch 'origin/dev' into feature/#494-Style-Add…
deletidev Nov 11, 2024
84b5f5e
#505 Add Font Size property to all Text Shapes
El-Mito-de-Giralda Nov 11, 2024
2cb8737
Merge pull request #530 from Lemoncode/feature/#494-Style-Add-new-pag…
brauliodiez Nov 11, 2024
8353031
#532 Add new members to about section
El-Mito-de-Giralda Nov 11, 2024
c38c30b
fix redraw initial
brauliodiez Nov 12, 2024
d58268f
Merge pull request #535 from Lemoncode/feature/redraw-thumb
brauliodiez Nov 12, 2024
4baab33
switch method to canvas context approach
Alber-Writer Nov 12, 2024
8a2e4e4
refactor tabsbar with hook
Alber-Writer Nov 12, 2024
ecdc7d8
Merge branch 'dev' into feature/#532-Add-new-members-to-about-section
El-Mito-de-Giralda Nov 12, 2024
5de0f83
fixed vertical text in to button component
antonio06 Nov 12, 2024
d2d2d61
fix tabsbar transformer width - defaultHeight workaround
Alber-Writer Nov 6, 2024
5c2e032
add tabsbar logic business
Alber-Writer Oct 29, 2024
bf367dc
adjust tabsbar text-width methods
Alber-Writer Nov 7, 2024
97becd4
switch method to canvas context approach
Alber-Writer Nov 12, 2024
c02f40e
refactor tabsbar with hook
Alber-Writer Nov 12, 2024
f3f7bef
Merge branch 'feature/#446-Tabs-bar-headings-should-enlarge-width-2' …
Alber-Writer Nov 12, 2024
b88a23b
improve calc-text-width method reusing the Konva canvas
Alber-Writer Nov 14, 2024
c9ab7c2
merge
brauliodiez Nov 16, 2024
cc752db
Merge pull request #531 from Lemoncode/feature/#505-Add-Font-Size-pro…
brauliodiez Nov 16, 2024
791e4d3
fix infinite loop
brauliodiez Nov 16, 2024
69f17ee
final fix
brauliodiez Nov 16, 2024
6e40eee
refactor
brauliodiez Nov 16, 2024
bed1935
thumbpage
brauliodiez Nov 16, 2024
a13061d
fix
brauliodiez Nov 16, 2024
3dac014
Merge pull request #539 from Lemoncode/feature/fix-thumb-infinite-loop
brauliodiez Nov 16, 2024
5d52d99
Merge branch 'dev' into feature/#532-Add-new-members-to-about-section
brauliodiez Nov 16, 2024
605b9e5
no click
brauliodiez Nov 16, 2024
d89bf38
noclick remove css
brauliodiez Nov 17, 2024
e3ea74d
Merge branch 'dev' into feature/#446-Tabs-bar-headings-should-enlarge…
brauliodiez Nov 17, 2024
deb1613
Merge pull request #526 from Lemoncode/feature/#446-Tabs-bar-headings…
brauliodiez Nov 17, 2024
87fc1f6
Merge branch 'dev' into feature/#527-Center-text-in-button-component
brauliodiez Nov 17, 2024
01cab8e
fix context menú not showing
brauliodiez Nov 17, 2024
999a0e1
fixed caret
brauliodiez Nov 17, 2024
1aa807b
Merge pull request #537 from Lemoncode/feature/#527-Center-text-in-bu…
brauliodiez Nov 17, 2024
b0e9692
Merge branch 'dev' into feature/thumb-no-click
brauliodiez Nov 17, 2024
db3c570
Merge branch 'dev' into feature/#532-Add-new-members-to-about-section
brauliodiez Nov 17, 2024
3670024
Merge branch 'dev' into feature/#501-allow-rearrange-pages-d&d
brauliodiez Nov 17, 2024
dd52481
Merge pull request #540 from Lemoncode/feature/thumb-no-click
brauliodiez Nov 17, 2024
6be1741
Merge branch 'dev' into feature/#532-Add-new-members-to-about-section
brauliodiez Nov 17, 2024
e06bc46
Merge branch 'dev' into feature/#501-allow-rearrange-pages-d&d
brauliodiez Nov 17, 2024
2583dff
fix drag
brauliodiez Nov 17, 2024
38fef45
basics working
brauliodiez Nov 17, 2024
fa8a431
encapsulate hook dar drop thumb
brauliodiez Nov 17, 2024
da1a741
update
brauliodiez Nov 17, 2024
a408fa9
Merge pull request #536 from Lemoncode/feature/#532-Add-new-members-t…
brauliodiez Nov 17, 2024
f3ed72d
fix drag drop thumb
brauliodiez Nov 17, 2024
06a3163
Merge branch 'dev' into feature/#501-allow-rearrange-pages-d&d
brauliodiez Nov 17, 2024
bb6cbb0
Merge pull request #542 from Lemoncode/feature/#501-allow-rearrange-p…
brauliodiez Nov 17, 2024
76036a5
fix in progress
brauliodiez Nov 18, 2024
2b5128a
fix fontSize to the other text components
antonio06 Nov 18, 2024
caa8732
remove console log
antonio06 Nov 18, 2024
6642cd5
Merge pull request #555 from Lemoncode/Bug/#554-heading-size-old-vers…
brauliodiez Nov 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,17 @@ Team members participating in this project
<a href="https://github.com/Pableras90">
<kbd><img src="https://github.com/Pableras90.png" alt="Pablo Reinaldo" width="50" height="50" style="border-radius: 50%;"></kbd>
</a>

<a href="https://github.com/Alber-Writer">
<kbd><img src="https://github.com/Alber-Writer.png" alt="Alberto Escribano" width="50" height="50" style="border-radius: 50%;"></kbd>
</a>
<a href="https://github.com/El-Mito-de-Giralda">
<kbd><img src="https://github.com/El-Mito-de-Giralda.png" alt="Jorge Miranda de la quintana" width="50" height="50" style="border-radius: 50%;"></kbd>
</a>
<a href="https://github.com/josemitoribio">
<kbd><img src="https://github.com/josemitoribio.png" alt="Josemi Toribio" width="50" height="50" style="border-radius: 50%;"></kbd>
</a>

<a href="https://github.com/IonutGabi">
<kbd><img src="https://github.com/IonutGabi.png" alt="Gabi Birsan" width="50" height="50" style="border-radius: 50%;"></kbd>
</a>
Expand Down
17 changes: 16 additions & 1 deletion e2e/helpers/konva-testing.helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Layer } from 'konva/lib/Layer';
import { Shape } from 'konva/lib/Shape';
import { Group } from 'konva/lib/Group';
import { E2E_CanvasItemKeyAttrs } from './types/e2e-types';
import { getCanvasBoundingBox } from './position.helpers';

const getLayer = async (page: Page): Promise<Layer> =>
await page.evaluate(() => {
Expand Down Expand Up @@ -77,7 +78,8 @@ export const clickOnCanvasItem = async (
item: E2E_CanvasItemKeyAttrs
) => {
const { x, y } = item;
const canvasWindowPos = await page.locator('canvas').boundingBox();
const stageCanvas = await page.locator('#konva-stage canvas').first();
const canvasWindowPos = await stageCanvas.boundingBox();
if (!canvasWindowPos) throw new Error('Canvas is not loaded on ui');
await page.mouse.move(
canvasWindowPos?.x + x + 20,
Expand All @@ -90,6 +92,19 @@ export const clickOnCanvasItem = async (
return item;
};

export const dbClickOnCanvasItem = async (
page: Page,
item: E2E_CanvasItemKeyAttrs
) => {
const { x, y } = item;
const canvasWindowPos = await getCanvasBoundingBox(page);
await page.mouse.dblclick(
canvasWindowPos?.x + x + 20,
canvasWindowPos?.y + y + 20
);
return item;
};

export const ctrlClickOverCanvasItems = async (
page: Page,
itemList: E2E_CanvasItemKeyAttrs[]
Expand Down
15 changes: 14 additions & 1 deletion e2e/helpers/position.helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ interface Position {
export const getLocatorPosition = async (
locator: Locator
): Promise<Position> => {
await locator.scrollIntoViewIfNeeded();
const box = (await locator.boundingBox()) || {
x: 0,
y: 0,
Expand All @@ -18,6 +19,17 @@ export const getLocatorPosition = async (
return { x: box.x + box.width / 2, y: box.y + box.height / 2 };
};

export const getCanvasBoundingBox = async (page: Page) => {
const canvasWindowPos = await page
.locator('#konva-stage canvas')
.boundingBox();
if (canvasWindowPos) {
return canvasWindowPos;
} else {
throw new Error('Canvas is not loaded on ui');
}
};

export const dragAndDrop = async (
page: Page,
aPosition: Position,
Expand All @@ -33,7 +45,8 @@ export const addComponentsToCanvas = async (
page: Page,
components: string[]
) => {
const canvasPosition = await page.locator('canvas').boundingBox();
const stageCanvas = await page.locator('#konva-stage canvas').first();
const canvasPosition = await stageCanvas.boundingBox();
if (!canvasPosition) throw new Error('No canvas found');

for await (const [index, c] of components.entries()) {
Expand Down
13 changes: 13 additions & 0 deletions e2e/helpers/ui-buttons.helpers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Page } from '@playwright/test';

export const clickUndoUiButton = async (page: Page) =>
await page.getByRole('button', { name: 'Undo' }).click();

export const clickRedoUiButton = async (page: Page) =>
await page.getByRole('button', { name: 'Redo' }).click();

export const clickCopyUiButton = async (page: Page) =>
await page.getByRole('button', { name: 'Copy' }).click();

export const clickPasteUiButton = async (page: Page) =>
await page.getByRole('button', { name: 'Paste' }).click();
121 changes: 121 additions & 0 deletions e2e/inline-edit/multiple-line-inline-edit.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
import { test, expect } from '@playwright/test';
import { Group } from 'konva/lib/Group';
import { dragAndDrop, getByShapeType, getLocatorPosition } from '../helpers';

test('can add textarea to canvas, edit content, and verify shape text', async ({
page,
}) => {
await page.goto('');
const component = page.getByAltText('Textarea');
await component.scrollIntoViewIfNeeded();

const position = await getLocatorPosition(component);
const targetPosition = {
x: position.x + 500,
y: position.y - 240,
};
await dragAndDrop(page, position, targetPosition);
await page.mouse.dblclick(targetPosition.x, targetPosition.y + 40);
const textarea = page.getByRole('textbox').first();
const textareaContent = await textarea.inputValue();
expect(textareaContent).toEqual('Your text here...');

const textContent = 'Hello';
await textarea.fill(textContent);
await page.mouse.click(800, 130);
const textareaShape = (await getByShapeType(page, 'textarea')) as Group;

expect(textareaShape).toBeDefined();
const textShape = textareaShape.children.find(
child => child.attrs.text === textContent
);
expect(textShape).toBeDefined();
});

test('cancels textarea edit on Escape and verifies original shape text', async ({
page,
}) => {
await page.goto('');
const component = page.getByAltText('Textarea');
await component.scrollIntoViewIfNeeded();

const position = await getLocatorPosition(component);
const targetPosition = {
x: position.x + 500,
y: position.y - 240,
};
await dragAndDrop(page, position, targetPosition);
await page.mouse.dblclick(targetPosition.x, targetPosition.y + 40);
const textarea = page.getByRole('textbox').first();

const textContent = 'Hello';
await textarea.fill(textContent);
await page.keyboard.press('Escape');
const originalTextContent = 'Your text here...';
const textareaShape = (await getByShapeType(page, 'textarea')) as Group;

expect(textareaShape).toBeDefined();
const textShape = textareaShape.children.find(
child => child.attrs.text === originalTextContent
);
expect(textShape).toBeDefined();
});

test('can add and edit input, and delete last letter', async ({ page }) => {
await page.goto('');
const component = page.getByAltText('Textarea');
await component.scrollIntoViewIfNeeded();

const position = await getLocatorPosition(component);
const targetPosition = {
x: position.x + 500,
y: position.y - 240,
};
await dragAndDrop(page, position, targetPosition);
await page.mouse.dblclick(targetPosition.x, targetPosition.y + 40);
const textarea = page.getByRole('textbox').first();

const textContent = 'World';
await textarea.fill(textContent);
await page.keyboard.press('Backspace');
const updatedTextareaContent = await textarea.inputValue();
expect(updatedTextareaContent).toEqual('Worl');

await page.mouse.click(800, 130);

const textareaShape = (await getByShapeType(page, 'textarea')) as Group;
expect(textareaShape).toBeDefined();
const textShape = textareaShape.children.find(
child => child.attrs.text === 'Worl'
);
expect(textShape).toBeDefined();
});

test('adds multi-line text to textarea on canvas and verifies shape text', async ({
page,
}) => {
await page.goto('');
const component = page.getByAltText('Textarea');
await component.scrollIntoViewIfNeeded();

const position = await getLocatorPosition(component);
const targetPosition = {
x: position.x + 500,
y: position.y - 240,
};
await dragAndDrop(page, position, targetPosition);
await page.mouse.dblclick(targetPosition.x, targetPosition.y + 40);
const textarea = page.getByRole('textbox').first();

const textContent = 'Line 1\nLine 2';
await textarea.fill(textContent);

await page.mouse.click(800, 130);

const textareaShape = (await getByShapeType(page, 'textarea')) as Group;
expect(textareaShape).toBeDefined();
const textShape = textareaShape.children.find(
child => child.attrs.text === textContent
);
expect(textShape).toBeDefined();
});
3 changes: 2 additions & 1 deletion e2e/selection/shape-selection.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ test('drop shape in canvas, click on canvas, drop diselected', async ({
const inputShape = (await getByShapeType(page, 'input')) as Group;
expect(inputShape).toBeDefined();

await page.click('canvas');
//Click Away
await page.mouse.click(800, 130);

const transformer = await getTransformer(page);
expect(transformer).toBeDefined();
Expand Down
158 changes: 158 additions & 0 deletions e2e/ui-functionality/copy-paste.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
import { test, expect } from '@playwright/test';
import {
addComponentsToCanvas,
dragAndDrop,
getWithinCanvasItemList,
} from '../helpers';
import { E2E_CanvasItemKeyAttrs } from '../helpers/types/e2e-types';
import {
clickCopyUiButton,
clickPasteUiButton,
} from '../helpers/ui-buttons.helpers';

test.describe('Copy/Paste functionality tests', () => {
test.beforeEach(async ({ page }) => {
await page.goto('');
});

test('Should copy and paste a single shape using the ToolBar UI buttons', async ({
page,
}) => {
//Arrange one Input component
const addInputIntoCanvas = ['Input'];
await addComponentsToCanvas(page, addInputIntoCanvas);

//Copy and assert there are only one component within the canvas
await clickCopyUiButton(page);
const insideCanvasItemList = (await getWithinCanvasItemList(
page
)) as E2E_CanvasItemKeyAttrs[];
expect(insideCanvasItemList.length).toEqual(1);

//Paste and assert there are 2 Input Components and that they have different IDs
await clickPasteUiButton(page);
const updatedInsideCanvasItemList = (await getWithinCanvasItemList(
page
)) as E2E_CanvasItemKeyAttrs[];
const [originalComponent, copiedComponent] = updatedInsideCanvasItemList;

expect(updatedInsideCanvasItemList.length).toEqual(2);
expect(originalComponent.shapeType).toEqual(copiedComponent.shapeType);
expect(originalComponent['data-id']).not.toEqual(
copiedComponent['data-id']
);
});

test('Should copy and paste a single shape using keyboard commands', async ({
page,
}) => {
// NOTE: This test has the same steps as the previous one, except for the keyboard commands.
//Arrange one Input component
const addInputIntoCanvas = ['Input'];
await addComponentsToCanvas(page, addInputIntoCanvas);

//Copy and assert there are only one component within the canvas
await page.keyboard.press('ControlOrMeta+c');
const insideCanvasItemList = (await getWithinCanvasItemList(
page
)) as E2E_CanvasItemKeyAttrs[];
expect(insideCanvasItemList.length).toEqual(1);

//Paste and assert there are 2 Input Components and that they have different IDs
await page.keyboard.press('ControlOrMeta+v');
const updatedInsideCanvasItemList = (await getWithinCanvasItemList(
page
)) as E2E_CanvasItemKeyAttrs[];
const [originalComponent, copiedComponent] = updatedInsideCanvasItemList;

expect(updatedInsideCanvasItemList.length).toEqual(2);
expect(originalComponent.shapeType).toEqual(copiedComponent.shapeType);
expect(originalComponent['data-id']).not.toEqual(
copiedComponent['data-id']
);
});

/*
test('Should copy and paste a multiple shapes using the ToolBar UI buttons', async ({
page,
}) => {
//Add several components into the canvas
const addInputIntoCanvas = ['Input', 'Combobox', 'Icon'];
await addComponentsToCanvas(page, addInputIntoCanvas);

//Select items by drag and drop
await dragAndDrop(page, { x: 260, y: 130 }, { x: 1000, y: 550 });

//Copy and assert there are 3 components within the canvas
await clickCopyUiButton(page);
const insideCanvasItemList = (await getWithinCanvasItemList(
page
)) as E2E_CanvasItemKeyAttrs[];
const [originalComp_1, originalComp_2, originalComp_3] =
insideCanvasItemList;
expect(insideCanvasItemList.length).toEqual(3);

//Paste
await clickPasteUiButton(page);
const updatedInsideCanvasItemList = (await getWithinCanvasItemList(
page
)) as E2E_CanvasItemKeyAttrs[];
const [, , , copiedComp_1, copiedComp_2, copiedComp_3] =
updatedInsideCanvasItemList;

//Assert there are 6 Components,
expect(updatedInsideCanvasItemList.length).toEqual(6);

//Assert they match the same shapes respectively
expect(originalComp_1.shapeType).toEqual(copiedComp_1.shapeType);
expect(originalComp_2.shapeType).toEqual(copiedComp_2.shapeType);
expect(originalComp_3.shapeType).toEqual(copiedComp_3.shapeType);

//Assert they have different IDs
expect(originalComp_1['data-id']).not.toEqual(copiedComp_1['data-id']);
expect(originalComp_2['data-id']).not.toEqual(copiedComp_2['data-id']);
expect(originalComp_3['data-id']).not.toEqual(copiedComp_3['data-id']);
});
*/
test('Should copy and paste a multiple shapes using keyboard commands', async ({
page,
}) => {
// NOTE: This test has the same steps as the previous one, except for the keyboard commands.
//Add several components into the canvas
const addInputIntoCanvas = ['Input', 'Combobox', 'Icon'];
await addComponentsToCanvas(page, addInputIntoCanvas);

//Select items by drag and drop
await dragAndDrop(page, { x: 260, y: 130 }, { x: 1000, y: 550 });

//Copy and assert there are 3 components within the canvas
await page.keyboard.press('ControlOrMeta+c');
const insideCanvasItemList = (await getWithinCanvasItemList(
page
)) as E2E_CanvasItemKeyAttrs[];
const [originalComp_1, originalComp_2, originalComp_3] =
insideCanvasItemList;
expect(insideCanvasItemList.length).toEqual(3);

//Paste
await page.keyboard.press('ControlOrMeta+v');
const updatedInsideCanvasItemList = (await getWithinCanvasItemList(
page
)) as E2E_CanvasItemKeyAttrs[];
const [, , , copiedComp_1, copiedComp_2, copiedComp_3] =
updatedInsideCanvasItemList;

//Assert there are 6 Components,
expect(updatedInsideCanvasItemList.length).toEqual(6);

//Assert they match the same shapes respectively
expect(originalComp_1.shapeType).toEqual(copiedComp_1.shapeType);
expect(originalComp_2.shapeType).toEqual(copiedComp_2.shapeType);
expect(originalComp_3.shapeType).toEqual(copiedComp_3.shapeType);

//Assert they have different IDs
expect(originalComp_1['data-id']).not.toEqual(copiedComp_1['data-id']);
expect(originalComp_2['data-id']).not.toEqual(copiedComp_2['data-id']);
expect(originalComp_3['data-id']).not.toEqual(copiedComp_3['data-id']);
});
});
Loading