|
1 | | -import { test, expect } from "@playwright/test"; |
| 1 | +import { expect, test } from "@playwright/test"; |
2 | 2 |
|
3 | 3 | test.afterEach("Cleanup session", async ({ page }) => { |
4 | 4 | // Because the test isolation that will open a new session for every test executed, and that exceeds Mendix's license limit of 5 sessions, so we need to force logout after each test. |
@@ -28,13 +28,20 @@ test.describe("RichText", () => { |
28 | 28 | await expect(page.locator(".mx-name-richText4")).toHaveScreenshot(`toolbarBasicMode.png`, { threshold: 0.4 }); |
29 | 29 | }); |
30 | 30 |
|
31 | | - test("compares with a screenshot baseline and checks if inline advanced mode are rendered as expected", async ({ |
| 31 | + test("compares with a screenshot baseline and checks if bottom toolbar advanced mode are rendered as expected", async ({ |
32 | 32 | page |
33 | 33 | }) => { |
34 | 34 | await page.goto("/p/advanced"); |
35 | 35 | await page.waitForLoadState("networkidle"); |
36 | 36 | await expect(page.locator(".mx-name-richText1")).toBeVisible(); |
37 | | - await expect(page.locator(".mx-name-richText1")).toHaveScreenshot(`inlineAdvancedMode.png`, { threshold: 0.4 }); |
| 37 | + await expect(page.locator(".mx-name-richText1")).toHaveScreenshot(`bottomToolbarAdvancedMode.png`, { |
| 38 | + threshold: 0.4 |
| 39 | + }); |
| 40 | + |
| 41 | + await page.click(".mx-name-richText1 .ql-toolbar button.ql-image"); |
| 42 | + await expect(page.locator(".widget-rich-text .widget-rich-text-modal-body").first()).toHaveScreenshot( |
| 43 | + `insertImageDialog.png` |
| 44 | + ); |
38 | 45 | }); |
39 | 46 |
|
40 | 47 | test("compares with a screenshot baseline and checks if toolbar advanced mode are rendered as expected", async ({ |
@@ -90,4 +97,34 @@ test.describe("RichText", () => { |
90 | 97 | threshold: 0.4 |
91 | 98 | }); |
92 | 99 | }); |
| 100 | + |
| 101 | + test("compares with a screenshot baseline and checks for readonly mode basic styling", async ({ page }) => { |
| 102 | + await page.goto("/p/read-only"); |
| 103 | + await page.waitForLoadState("networkidle"); |
| 104 | + await page.locator(".mx-name-richText3").scrollIntoViewIfNeeded(); |
| 105 | + await expect(page.locator(".mx-name-richText3")).toBeVisible(); |
| 106 | + await expect(page.locator(".mx-name-richText3")).toHaveScreenshot(`readOnlyModeBasic.png`, { |
| 107 | + threshold: 0.4 |
| 108 | + }); |
| 109 | + }); |
| 110 | + |
| 111 | + test("compares with a screenshot baseline and checks for readonly mode bordered styling", async ({ page }) => { |
| 112 | + await page.goto("/p/read-only"); |
| 113 | + await page.waitForLoadState("networkidle"); |
| 114 | + await page.locator(".mx-name-richText2").scrollIntoViewIfNeeded(); |
| 115 | + await expect(page.locator(".mx-name-richText2")).toBeVisible(); |
| 116 | + await expect(page.locator(".mx-name-richText2")).toHaveScreenshot(`readOnlyModeBordered.png`, { |
| 117 | + threshold: 0.4 |
| 118 | + }); |
| 119 | + }); |
| 120 | + |
| 121 | + test("compares with a screenshot baseline and checks for readonly mode read panel styling", async ({ page }) => { |
| 122 | + await page.goto("/p/read-only"); |
| 123 | + await page.waitForLoadState("networkidle"); |
| 124 | + await page.locator(".mx-name-richText6").scrollIntoViewIfNeeded(); |
| 125 | + await expect(page.locator(".mx-name-richText6")).toBeVisible(); |
| 126 | + await expect(page.locator(".mx-name-richText6")).toHaveScreenshot(`readOnlyModeReadPanel.png`, { |
| 127 | + threshold: 0.4 |
| 128 | + }); |
| 129 | + }); |
93 | 130 | }); |
0 commit comments