Merge pull request #31 from penpot/PENPOT-1159

Add PENPOT-1159. DA-73 Delete font - Cancel button check
This commit is contained in:
chalapkoStanislav 2024-06-04 15:39:18 +03:00 committed by GitHub
commit afdcece5df
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 16 additions and 0 deletions

View File

@ -120,6 +120,7 @@ exports.DashboardPage = class DashboardPage extends BasePage {
this.editFontMenuItem = page.locator('#font-edit');
this.deleteFontMenuItem = page.locator('#font-delete');
this.deleteFontButton = page.locator('input[value="Delete"]');
this.cancelDeleteFontButton = page.getByRole('button', { name: 'Cancel' });
this.fontsTablePlaceholder = page.locator(
'div[class*="fonts-placeholder"] div[class*="label"]',
);
@ -466,6 +467,12 @@ exports.DashboardPage = class DashboardPage extends BasePage {
await this.deleteFontButton.click();
}
async cancelDeleteFont() {
await this.fontOptionsMenuButton.click();
await this.deleteFontMenuItem.click();
await this.cancelDeleteFontButton.click();
}
async isFontsTablePlaceholderDisplayed(text) {
await expect(this.fontsTablePlaceholder).toHaveText(text);
}

View File

@ -62,3 +62,12 @@ mainTest(qase(1158,'DA-72 Delete font'), async ({ page }) => {
'Custom fonts you upload will appear here.',
);
});
mainTest(qase(1159,'DA-73 Delete font - Cancel button check'), async ({ page }) => {
const dashboardPage = new DashboardPage(page);
await dashboardPage.openSidebarItem('Fonts');
await dashboardPage.uploadFont('fonts/Pacifico.ttf');
await dashboardPage.isFontExists('Pacifico', 'Regular');
await dashboardPage.cancelDeleteFont();
await dashboardPage.isFontExists('Pacifico', 'Regular');
});