Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
OlgaLarina committed Jan 16, 2025
1 parent 1d0de3f commit 312af80
Show file tree
Hide file tree
Showing 25 changed files with 224 additions and 29 deletions.
1 change: 1 addition & 0 deletions visualRegressionTests/tests/designer/complete-survey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ fixture`${title}`.page`${url}`.beforeEach(async (t) => {
});

const json = {
showQuestionNumbers: "on",
"pages": [
{
"name": "page1",
Expand Down
32 changes: 24 additions & 8 deletions visualRegressionTests/tests/designer/drag-drop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ fixture`${title}`.page`${url}`.beforeEach(async (t) => {
test("Ghost Survey Element", async (t) => {
await wrapVisualTest(t, async (t, comparer) => {
await hideAllAdornerActions();
await setJSON({ pages: [{ name: "page1" }] });
await setJSON({
showQuestionNumbers: "on", pages: [{ name: "page1" }]
});
await t.resizeWindow(2560, 1440);
await setJSON({ pages: [{ name: "page1" }] });
await setJSON({
showQuestionNumbers: "on", pages: [{ name: "page1" }]
});

const patchDragDropToShowGhostElementAfterDrop = ClientFunction(() => {
window["creator"].dragDropSurveyElements.removeGhostElementFromSurvey = () => { };
Expand All @@ -33,9 +37,13 @@ test("Ghost Survey Element", async (t) => {
test("Empty page", async (t) => {
await wrapVisualTest(t, async (t, comparer) => {
await hideAllAdornerActions();
await setJSON({ pages: [{ name: "page1" }] });
await setJSON({
showQuestionNumbers: "on", pages: [{ name: "page1" }]
});
await t.resizeWindow(2560, 1440);
await setJSON({ pages: [{ name: "page1" }] });
await setJSON({
showQuestionNumbers: "on", pages: [{ name: "page1" }]
});

const patchDragDropToShowGhostElementAfterDrop = ClientFunction(() => {
window["creator"].dragDropSurveyElements.removeGhostElementFromSurvey = () => { };
Expand All @@ -57,9 +65,13 @@ test("Empty page", async (t) => {
test("Ghost Survey Element after several drops", async (t) => {
await wrapVisualTest(t, async (t, comparer) => {
await hideAllAdornerActions();
await setJSON({ pages: [{ name: "page1" }] });
await setJSON({
showQuestionNumbers: "on", pages: [{ name: "page1" }]
});
await t.resizeWindow(2560, 1440);
await setJSON({ pages: [{ name: "page1" }] });
await setJSON({
showQuestionNumbers: "on", pages: [{ name: "page1" }]
});

const EmptyPage = Selector("[data-sv-drop-target-survey-element='page1']");
const newGhostPagePage = Selector("[data-sv-drop-target-survey-element='newGhostPage']");
Expand Down Expand Up @@ -103,9 +115,13 @@ test("Ghost Survey Element after several drops", async (t) => {
test("Toolbox Item State After Drag", async (t) => {
await wrapVisualTest(t, async (t, comparer) => {
await hideAllAdornerActions();
await setJSON({ pages: [{ name: "page1" }] });
await setJSON({
showQuestionNumbers: "on", pages: [{ name: "page1" }]
});
await t.resizeWindow(2560, 1440);
await setJSON({ pages: [{ name: "page1" }] });
await setJSON({
showQuestionNumbers: "on", pages: [{ name: "page1" }]
});

const EmptyPage = Selector("[data-sv-drop-target-survey-element='page1']");

Expand Down
1 change: 1 addition & 0 deletions visualRegressionTests/tests/designer/dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ fixture`${title}`.page`${urlDropdownCollapseView}`.beforeEach(async (t) => {
});

const json = {
showQuestionNumbers: "on",
questions: [
{
type: "dropdown",
Expand Down
4 changes: 4 additions & 0 deletions visualRegressionTests/tests/designer/image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ fixture`${title}`.page`${url}`.beforeEach(async (t) => {
});

const json = {
showQuestionNumbers: "on",
"logoPosition": "right",
"pages": [
{
Expand Down Expand Up @@ -45,6 +46,7 @@ test("empty imageLink", async (t) => {
await explicitErrorHandler();
await t.resizeWindow(2560, 1440);
await setJSON({
showQuestionNumbers: "on",
"logoPosition": "right",
"pages": [
{
Expand Down Expand Up @@ -75,6 +77,7 @@ test("broken imageLink", async (t) => {
await explicitErrorHandler();
await t.resizeWindow(2560, 1440);
await setJSON({
showQuestionNumbers: "on",
"logoPosition": "right",
"pages": [
{
Expand Down Expand Up @@ -103,6 +106,7 @@ test("Check image loading indicator", async (t) => {
await explicitErrorHandler();
await t.resizeWindow(2560, 1440);
await setJSON({
showQuestionNumbers: "on",
"logoPosition": "right",
"pages": [
{
Expand Down
1 change: 1 addition & 0 deletions visualRegressionTests/tests/designer/imagepicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ fixture`${title}`.page`${url}`.beforeEach(async (t) => {
});

const json = {
showQuestionNumbers: "on",
"logoPosition": "right",
"pages": [
{
Expand Down
2 changes: 2 additions & 0 deletions visualRegressionTests/tests/designer/json-tab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const widgetUrl = url.replace(/\/testcafe$/, "/testcafe-widget");
fixture`${title}`.page`${url}`;

const jsonWithErrors = {
showQuestionNumbers: "on",
"logoPosition": "right",
"pages": [
{
Expand Down Expand Up @@ -85,6 +86,7 @@ test("JSON Ace editor", async (t) => {
await wrapVisualTest(t, async (t, comparer) => {
await t.resizeWindow(1920, 900);
const json = {
showQuestionNumbers: "on",
"logoPosition": "right",
"pages": [
{
Expand Down
8 changes: 8 additions & 0 deletions visualRegressionTests/tests/designer/logic-tab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ test("new rule", async (t) => {
});

const jsonOneRule = {
showQuestionNumbers: "on",
"logoPosition": "right",
"pages": [
{
Expand Down Expand Up @@ -78,6 +79,7 @@ test("long question name", async (t) => {
await wrapVisualTest(t, async (t, comparer) => {
await t.resizeWindow(1920, 900);
await setJSON({
showQuestionNumbers: "on",
"logoPosition": "right",
"pages": [
{
Expand Down Expand Up @@ -145,6 +147,7 @@ test("Check logic error notifier", async (t) => {
await t.resizeWindow(1920, 900);
await patchNotifierLifeTime();
await setJSON({
showQuestionNumbers: "on",
"logoPosition": "right",
"pages": [
{
Expand Down Expand Up @@ -178,6 +181,7 @@ test("Check logic dropdown", async (t) => {
await t.resizeWindow(900, 900);
await patchNotifierLifeTime();
await setJSON({
showQuestionNumbers: "on",
"logoPosition": "right",
"pages": [
{
Expand Down Expand Up @@ -211,6 +215,7 @@ test("Check logic Manual Entry", async (t) => {
await wrapVisualTest(t, async (t, comparer) => {
await t.resizeWindow(1920, 900);
await setJSON({
showQuestionNumbers: "on",
"logoPosition": "right",
"pages": [
{
Expand Down Expand Up @@ -242,6 +247,7 @@ test("Check logic Manual Entry", async (t) => {
});

const jsonMultipleConditionsMultipleActions = {
showQuestionNumbers: "on",
"logoPosition": "right",
"pages": [
{
Expand Down Expand Up @@ -330,6 +336,7 @@ test("unsaved rule", async (t) => {
});
});
const jsonAllActionTypes = {
showQuestionNumbers: "on",
"logoPosition": "right",
"completedHtmlOnCondition": [
{
Expand Down Expand Up @@ -496,6 +503,7 @@ test("Texts overflow the controls when showTitlesInExpressions is enabled #3192"
await wrapVisualTest(t, async (t, comparer) => {
await t.resizeWindow(800, 900);
await setJSON({
showQuestionNumbers: "on",
"logoPosition": "right",
"pages": [
{
Expand Down
1 change: 1 addition & 0 deletions visualRegressionTests/tests/designer/mobile-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const title = "Mobile view / responsiveness";
fixture`${title}`.page`${url}`;

const json = {
showQuestionNumbers: "on",
"logoPosition": "right",
"pages": [
{
Expand Down
1 change: 1 addition & 0 deletions visualRegressionTests/tests/designer/multiple-text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ fixture`${title}`.page`${url}`.beforeEach(async (t) => {
});

const json = {
showQuestionNumbers: "on",
"logoPosition": "right",
"pages": [
{
Expand Down
8 changes: 7 additions & 1 deletion visualRegressionTests/tests/designer/page-navigator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ fixture`${title}`.page`${url}`.beforeEach(async (t) => {
});

const json = {
showQuestionNumbers: "on",
"logoPosition": "right",
"pages": [
{
Expand Down Expand Up @@ -123,7 +124,9 @@ test("Page Navigator works with - scroll-behavior: smooth;", async (t) => {
document.documentElement.style["scroll-behavior"] = "smooth";
})();

await setJSON({ pages: [{ name: "page1", questions: [{ type: "radiogroup", choices: [1, 2, 3] }] }, { name: "page2" }, { name: "page3" }, { name: "page4" }, { name: "page5" }] });
await setJSON({
showQuestionNumbers: "on", pages: [{ name: "page1", questions: [{ type: "radiogroup", choices: [1, 2, 3] }] }, { name: "page2" }, { name: "page3" }, { name: "page4" }, { name: "page5" }]
});

const firstPageNavigatorItem = "svc-page-navigator-item:nth-child(1) > .svc-page-navigator-item--selected, .svc-page-navigator-item:nth-of-type(1) > .svc-page-navigator-item--selected";
const thirdPageNavigatorItem = "svc-page-navigator-item:nth-child(3) > .svc-page-navigator-item--selected, .svc-page-navigator-item:nth-of-type(3) > .svc-page-navigator-item--selected";
Expand Down Expand Up @@ -421,6 +424,7 @@ test("Page navigator has enough space to be shown", async (t) => {
await wrapVisualTest(t, async (t, comparer) => {
await t.resizeWindow(1508, 800);
await setJSON({
showQuestionNumbers: "on",
"title": "NPS Survey Question",
"widthMode": "responsive",
"pages": [
Expand Down Expand Up @@ -490,6 +494,7 @@ test("Page navigator in by-page mode has enough space to be shown", async (t) =>
window["creator"].pageEditMode = "bypage";
})();
await setJSON({
showQuestionNumbers: "on",
"title": "NPS Survey Question",
"widthMode": "responsive",
"pages": [
Expand Down Expand Up @@ -560,6 +565,7 @@ test("Page navigator scrolls to top of long page and centers small page", async
await t.resizeWindow(1500, 800);
await setShowSidebar(false);
await setJSON({
showQuestionNumbers: "on",
"logoPosition": "right",
"pages": [
{
Expand Down
4 changes: 4 additions & 0 deletions visualRegressionTests/tests/designer/pg-choices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ fixture`${title}`.page`${url}`.beforeEach(async (t) => {
});

const json = {
showQuestionNumbers: "on",
"logoPosition": "right",
"pages": [
{
Expand Down Expand Up @@ -59,6 +60,7 @@ test("Check items empty", async (t) => {
await t.resizeWindow(1920, 1080);

const checkBoxEmptyItemsSurvey = {
showQuestionNumbers: "on",
"logoPosition": "right",
"pages": [
{
Expand Down Expand Up @@ -95,6 +97,7 @@ test("Collection editor headers", async (t) => {
});

const surveyJSON = {
showQuestionNumbers: "on",
"pages": [
{
"name": "page1",
Expand Down Expand Up @@ -129,6 +132,7 @@ test("Check choices editor with narrow property grid", async (t) => {
await t.resizeWindow(1920, 1080);

const surveyJSON = {
showQuestionNumbers: "on",
"pages": [
{
"name": "page1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ fixture`${title}`.page`${url}`.beforeEach(async (t) => {
});

const json = {
showQuestionNumbers: "on",
"logoPosition": "right",
"pages": [
{
Expand Down
11 changes: 11 additions & 0 deletions visualRegressionTests/tests/designer/pg-editors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ fixture`${title}`.page`${url}`.beforeEach(async (t) => {
test("Properties on the same line", async (t) => {
await wrapVisualTest(t, async (t, comparer) => {
const json = {
showQuestionNumbers: "on",
"elements": [
{
"type": "text",
Expand Down Expand Up @@ -52,6 +53,7 @@ test("Properties on the same line", async (t) => {
test("Properties on the same line (date)", async (t) => {
await wrapVisualTest(t, async (t, comparer) => {
const json = {
showQuestionNumbers: "on",
"elements": [
{
"type": "text",
Expand Down Expand Up @@ -96,6 +98,7 @@ test("Properties on the same line (date)", async (t) => {
test("Values editors, keep them close", async (t) => {
await wrapVisualTest(t, async (t, comparer) => {
const json = {
showQuestionNumbers: "on",
"elements": [
{
"type": "text",
Expand All @@ -122,6 +125,7 @@ test("Values editors, keep them close", async (t) => {
test("Check default value editor", async (t) => {
await wrapVisualTest(t, async (t, comparer) => {
const json = {
showQuestionNumbers: "on",
"elements": [
{
"type": "text",
Expand Down Expand Up @@ -377,6 +381,7 @@ test("rateValues in property grid", async (t) => {
await wrapVisualTest(t, async (t, comparer) => {
await t.resizeWindow(1240, 870);
await setJSON({
showQuestionNumbers: "on",
"elements": [
{
"type": "rating",
Expand Down Expand Up @@ -429,6 +434,7 @@ test("Check question with error", async (t) => {
await wrapVisualTest(t, async (t, comparer) => {
await t.resizeWindow(1920, 1920);
await setJSON({
showQuestionNumbers: "on",
type: "text",
name: "q1",
});
Expand Down Expand Up @@ -625,6 +631,7 @@ test("Check dropdown editor with titleLocation: 'left'", async (t) => {
test("Check overriding property editor", async (t) => {
await wrapVisualTest(t, async (t, comparer) => {
await setJSON({
showQuestionNumbers: "on",
"pages": [
{
"name": "page1",
Expand Down Expand Up @@ -693,6 +700,7 @@ test("Check text editor with reset button", async (t) => {
test("Check accepted file types hint link", async (t) => {
await wrapVisualTest(t, async (t, comparer) => {
await setJSON({
showQuestionNumbers: "on",
"pages": [
{
"name": "page1",
Expand Down Expand Up @@ -764,6 +772,7 @@ test("Property grid checkbox with description", async (t) => {
(window as any).SurveyCreatorCore.localization.getLocale("en").pehelp["visible"] = "Visible property's description";
})();
await setJSON({
showQuestionNumbers: "on",
"pages": [
{
"name": "page1",
Expand Down Expand Up @@ -810,6 +819,7 @@ test("renderAs works in matrix questions for textwithreset", async (t) => {
// });
})();
const json = {
showQuestionNumbers: "on",
"elements": [
{
"type": "text",
Expand All @@ -836,6 +846,7 @@ test("popup overlay in property grid", async (t) => {
window["Survey"]._setIsTouch(true);
})();
const json = {
showQuestionNumbers: "on",
"elements": [
{
"type": "text",
Expand Down
Loading

0 comments on commit 312af80

Please sign in to comment.