Browse Source

test: meta block, one copy multiple paste

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
pull/5847/head
Raju Udava 1 year ago
parent
commit
b7d50799fc
  1. 51
      tests/playwright/tests/db/keyboardShortcuts.spec.ts

51
tests/playwright/tests/db/keyboardShortcuts.spec.ts

@ -309,7 +309,7 @@ test.describe('Clipboard support', () => {
});
test('multiple cells - vertical', async ({ page }) => {
const cellText: string[] = ['aaa', 'bbb', 'ccc', 'ddd', 'eee'];
let cellText: string[] = ['aaa', 'bbb', 'ccc', 'ddd', 'eee'];
for (let i = 1; i <= 5; i++) {
await grid.addNewRow({ index: i, columnHeader: 'SingleLineText', value: cellText[i - 1] });
}
@ -353,23 +353,36 @@ test.describe('Clipboard support', () => {
/////////////////////////////////////////////////////////////////////////
// To be enabled after meta handling fix
// // Meta for block selection
// await grid.cell.click({ index: 1, columnHeader: 'SingleLineText' });
// await page.keyboard.press('Shift+Meta+ArrowDown');
// await page.keyboard.press((await grid.isMacOs()) ? 'Meta+c' : 'Control+c');
// await grid.cell.click({ index: 1, columnHeader: 'Email' });
// await page.keyboard.press((await grid.isMacOs()) ? 'Meta+v' : 'Control+v');
//
// // reload page
// await dashboard.rootPage.reload();
//
// // verify copied data
// // modified cell text after previous block operation
// cellText = ['aaa', 'bbb', 'ccc', 'aaa', 'bbb'];
// for (let i = 1; i <= 5; i++) {
// await grid.cell.verify({ index: i, columnHeader: 'Email', value: cellText[i - 1] });
// }
// Meta for block selection
await grid.cell.click({ index: 1, columnHeader: 'SingleLineText' });
await page.keyboard.press(`Shift+${(await grid.isMacOs()) ? 'Meta' : 'Control'}+ArrowDown`);
await page.keyboard.press((await grid.isMacOs()) ? 'Meta+c' : 'Control+c');
await grid.cell.click({ index: 1, columnHeader: 'Email' });
await page.keyboard.press((await grid.isMacOs()) ? 'Meta+v' : 'Control+v');
// reload page
await dashboard.rootPage.reload();
// verify copied data
// modified cell text after previous block operation
cellText = ['aaa', 'bbb', 'ccc', 'aaa', 'bbb'];
for (let i = 1; i <= 5; i++) {
await grid.cell.verify({ index: i, columnHeader: 'Email', value: cellText[i - 1] });
}
// One copy, multiple paste
await grid.cell.click({ index: 0, columnHeader: 'SingleLineText' });
await page.keyboard.press((await grid.isMacOs()) ? 'Meta+c' : 'Control+c');
await grid.cell.click({ index: 1, columnHeader: 'SingleLineText' });
await page.keyboard.press(`Shift+${(await grid.isMacOs()) ? 'Meta' : 'Control'}+ArrowDown`);
await page.keyboard.press((await grid.isMacOs()) ? 'Meta+v' : 'Control+v');
// reload page
await dashboard.rootPage.reload();
// verify copied data
for (let i = 1; i <= 5; i++) {
await grid.cell.verify({ index: i, columnHeader: 'SingleLineText', value: 'SingleLineText' });
}
});
});

Loading…
Cancel
Save