mirror of
https://github.com/penpot/penpotqa.git
synced 2024-07-06 04:51:46 +00:00
Add PENPOT-251 test. CO-36 Copy and Paste Board
This commit is contained in:
parent
c06647cfea
commit
249ca50bed
|
@ -95,12 +95,8 @@ exports.BasePage = class BasePage {
|
||||||
this.duplicateOption = page.locator(
|
this.duplicateOption = page.locator(
|
||||||
'ul[class*="workspace_context_menu"] span:has-text("Duplicate")',
|
'ul[class*="workspace_context_menu"] span:has-text("Duplicate")',
|
||||||
);
|
);
|
||||||
this.copyOption = page.locator(
|
this.copyOption = page.getByRole('listitem').filter({ hasText: 'Copy'});
|
||||||
'ul[class*="workspace_context_menu"] span:has-text("Copy")',
|
this.pasteOption = page.getByRole('listitem').filter({ hasText: 'Paste'});
|
||||||
);
|
|
||||||
this.pasteOption = page.locator(
|
|
||||||
'ul[class*="workspace_context_menu"] span:has-text("Paste")',
|
|
||||||
);
|
|
||||||
this.groupOption = page.locator(
|
this.groupOption = page.locator(
|
||||||
'ul[class*="workspace_context_menu"] span:has-text("Group")',
|
'ul[class*="workspace_context_menu"] span:has-text("Group")',
|
||||||
);
|
);
|
||||||
|
|
|
@ -10,6 +10,9 @@ exports.LayersPanelPage = class LayersPanelPage extends BasePage {
|
||||||
|
|
||||||
this.layersTab = page.locator('div[data-id="layers"]');
|
this.layersTab = page.locator('div[data-id="layers"]');
|
||||||
this.layersSidebar = page.locator('#layers');
|
this.layersSidebar = page.locator('#layers');
|
||||||
|
this.sidebarLayerItem = page.locator(
|
||||||
|
'div[class*="workspace_sidebar_layer_item__layer-row"]',
|
||||||
|
);
|
||||||
this.createdLayerOnLayersPanelNameInput = page.locator(
|
this.createdLayerOnLayersPanelNameInput = page.locator(
|
||||||
'div[class*="element-list-body"] input[class*="element-name"]',
|
'div[class*="element-list-body"] input[class*="element-name"]',
|
||||||
);
|
);
|
||||||
|
@ -261,4 +264,15 @@ exports.LayersPanelPage = class LayersPanelPage extends BasePage {
|
||||||
await this.copyComponentLayer.click({ button: 'right', force: true });
|
await this.copyComponentLayer.click({ button: 'right', force: true });
|
||||||
await this.detachInstanceOption.click();
|
await this.detachInstanceOption.click();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async copyLayerViaRightClick(layerName) {
|
||||||
|
const layerSel = this.page.locator('#layers').getByText(layerName);
|
||||||
|
await layerSel.last().click({
|
||||||
|
button: 'right',
|
||||||
|
force: true,
|
||||||
|
});
|
||||||
|
await this.copyOption.click();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -72,6 +72,10 @@ const config = {
|
||||||
launchOptions: {
|
launchOptions: {
|
||||||
ignoreDefaultArgs: ['--hide-scrollbars'],
|
ignoreDefaultArgs: ['--hide-scrollbars'],
|
||||||
},
|
},
|
||||||
|
contextOptions: {
|
||||||
|
// chromium-specific permissions
|
||||||
|
permissions: ['clipboard-read', 'clipboard-write'],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -88,6 +92,16 @@ const config = {
|
||||||
width: 1920,
|
width: 1920,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
launchOptions: {
|
||||||
|
firefoxUserPrefs: {
|
||||||
|
'dom.events.asyncClipboard.readText': true,
|
||||||
|
'dom.events.testing.asyncClipboard': true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
contextOptions: {
|
||||||
|
// chromium-specific permissions
|
||||||
|
permissions: ['clipboard-read', 'clipboard-write'],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'webkit',
|
name: 'webkit',
|
||||||
|
|
|
@ -450,6 +450,22 @@ test.describe(() => {
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
mainTest(
|
||||||
|
qase(251,'CO-36 Copy and Paste Board'),
|
||||||
|
async ({ page }) => {
|
||||||
|
const mainPage = new MainPage(page);
|
||||||
|
const layersPanelPage = new LayersPanelPage(page);
|
||||||
|
const board1 = 'Board #1';
|
||||||
|
await mainPage.copyLayerViaRightClick();
|
||||||
|
await mainPage.pasteLayerViaRightClick();
|
||||||
|
await layersPanelPage.copyLayerViaRightClick(board1);
|
||||||
|
await mainPage.pasteLayerViaRightClick();
|
||||||
|
await mainPage.pressCopyShortcut();
|
||||||
|
await mainPage.pressPasteShortcut();
|
||||||
|
await expect(layersPanelPage.sidebarLayerItem).toHaveCount(5);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
mainTest(
|
mainTest(
|
||||||
qase(268,"CO-53 Click 'Focus on' board from right click"),
|
qase(268,"CO-53 Click 'Focus on' board from right click"),
|
||||||
async ({ page }) => {
|
async ({ page }) => {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user