Skip to content

Commit ae428d2

Browse files
committed
Added e2e tests
1 parent af8dad2 commit ae428d2

7 files changed

Lines changed: 37 additions & 0 deletions

tests/src/end-to-end/colors/colors.test.ts

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
COLORS_BUTTON_SELECTOR,
77
DRAG_HANDLE_MENU_SELECTOR,
88
DRAG_HANDLE_SELECTOR,
9+
H_ONE_BLOCK_SELECTOR,
910
H_TWO_BLOCK_SELECTOR,
1011
TABLE_SELECTOR,
1112
TEXT_COLOR_SELECTOR,
@@ -19,6 +20,42 @@ test.beforeEach(async ({ page }) => {
1920
});
2021

2122
test.describe("Check Background & Text Color Functionality", () => {
23+
test("Should be able to open the color picker from the formatting toolbar", async ({
24+
page,
25+
}) => {
26+
await focusOnEditor(page);
27+
28+
await insertHeading(page, 1);
29+
await page.keyboard.press("Shift+ArrowLeft");
30+
31+
await page.locator(COLORS_BUTTON_SELECTOR).click();
32+
33+
// Waits for the color picker dropdown to open & its animation to finish.
34+
await page.waitForSelector(TEXT_COLOR_SELECTOR("red"));
35+
await page.waitForTimeout(500);
36+
37+
expect(await page.screenshot()).toMatchSnapshot(
38+
"colorPickerFormattingToolbar.png",
39+
);
40+
});
41+
test("Should be able to open the color picker from the side menu", async ({
42+
page,
43+
}) => {
44+
await focusOnEditor(page);
45+
46+
await insertHeading(page, 1);
47+
48+
await page.hover(H_ONE_BLOCK_SELECTOR);
49+
await page.click(DRAG_HANDLE_SELECTOR);
50+
await page.waitForSelector(DRAG_HANDLE_MENU_SELECTOR);
51+
await page.hover("text=Colors");
52+
53+
// Waits for the color picker submenu to open & its animation to finish.
54+
await page.waitForSelector(TEXT_COLOR_SELECTOR("red"));
55+
await page.waitForTimeout(500);
56+
57+
expect(await page.screenshot()).toMatchSnapshot("colorPickerSideMenu.png");
58+
});
2259
test("Should be able to apply a text color mark", async ({ page }) => {
2360
await focusOnEditor(page);
2461

32.7 KB
Loading
55.8 KB
Loading
94 KB
Loading
37.1 KB
Loading
56.5 KB
Loading
96.7 KB
Loading

0 commit comments

Comments
 (0)