feat(e2e): playwright - add global login setup and teardown, show certificate tests (#51368)

This commit is contained in:
Fahd Kassim
2023-09-07 10:32:15 +05:00
committed by GitHub
parent 4e44acab71
commit 5cf0b93dfb
6 changed files with 175 additions and 3 deletions
+33
View File
@@ -0,0 +1,33 @@
import { test, expect, type Page } from '@playwright/test';
test.use({ storageState: 'LoginAuth.json' });
test.describe('Show certification own', () => {
let page: Page;
test.beforeAll(async ({ browser }) => {
page = await browser.newPage();
await page.goto('/certification/certifieduser/responsive-web-design');
});
test.afterAll(async () => {
await page.close();
});
test('should display certificate details', async () => {
expect(await page.isVisible('text=successfully completed')).toBeTruthy();
expect(await page.isVisible('text=Responsive Web Design')).toBeTruthy();
await expect(page.locator('[data-cy=issue-date]')).toContainText(
'Developer Certification on August 3, 2018'
);
});
test('should render LinkedIn and Twitter buttons', async () => {
expect(
await page.isVisible('text=Add this certification to my LinkedIn profile')
).toBeTruthy();
expect(
await page.isVisible('text=Share this certification on Twitter')
).toBeTruthy();
});
});