AFFiNE/tests/contact-us.spec.ts

36 lines
1.3 KiB
TypeScript
Raw Normal View History

import { test, expect } from '@playwright/test';
2022-11-28 16:17:34 +03:00
import { loadPage } from './libs/load-page';
loadPage();
test.describe('Open contact us', () => {
test.skip('Click about us', async ({ page }) => {
const currentWorkspace = page.getByTestId('current-workspace');
await currentWorkspace.click();
// await page.waitForTimeout(1000);
await page.getByText('About AFFiNE').click();
2022-11-28 16:17:34 +03:00
const contactUsModal = page.locator(
'[data-testid=contact-us-modal-content]'
);
await expect(contactUsModal).toContainText('AFFiNE Community');
2022-11-28 16:17:34 +03:00
});
test('Click right-bottom corner contact icon', async ({ page }) => {
const faqIcon = page.locator('[data-testid=faq-icon]');
const box = await faqIcon.boundingBox();
expect(box?.x).not.toBeUndefined();
2022-11-28 16:17:34 +03:00
await page.mouse.move((box?.x ?? 0) + 10, (box?.y ?? 0) + 10);
await page.mouse.move((box?.x ?? 0) + 5, (box?.y ?? 0) + 5);
2022-11-28 16:17:34 +03:00
const rightBottomContactUs = page.locator(
'[data-testid=right-bottom-contact-us-icon]'
);
expect(await rightBottomContactUs.isVisible()).toEqual(true);
2022-11-28 16:17:34 +03:00
await rightBottomContactUs.click();
const contactUsModal = page.locator(
'[data-testid=contact-us-modal-content]'
);
await expect(contactUsModal).toContainText('AFFiNE Community');
2022-11-28 16:17:34 +03:00
});
});