-
Notifications
You must be signed in to change notification settings - Fork 809
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* When the focusOnFirstError option is enabled, a survey focuses the first input on a page instead of the first invalid question fix #6587 * Remove unneeded wait in functional test #6587 * Fix functional tests #6587 * Update etalons for visual tests with focusing #6587 * Improve notofier window visual tests #6587
- Loading branch information
1 parent
f369f60
commit 289d1a2
Showing
11 changed files
with
174 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
import { frameworks, url, initSurvey, getSurveyResult } from "../helper"; | ||
import { Selector, ClientFunction, fixture, test } from "testcafe"; | ||
const title = "focus input with Error"; | ||
const json1 = { | ||
"pages": [ | ||
{ | ||
"name": "page1", | ||
"elements": [ | ||
{ | ||
"type": "text", | ||
"name": "question1" | ||
}, | ||
{ | ||
"type": "boolean", | ||
"name": "question2" | ||
}, | ||
|
||
{ | ||
"type": "text", | ||
"name": "q1", | ||
"validators": [{ "type": "numeric", "text": "Enter only numbers" }] | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "page2", | ||
"elements": [ | ||
{ | ||
"type": "text", | ||
"name": "question3" | ||
} | ||
] | ||
} | ||
], | ||
"checkErrorsMode": "onComplete" | ||
}; | ||
const json2 = { | ||
"pages": [ | ||
{ | ||
"name": "page1", | ||
"elements": [ | ||
{ | ||
"type": "text", | ||
"name": "question1" | ||
}, | ||
{ | ||
"type": "boolean", | ||
"name": "question2" | ||
}, | ||
|
||
{ | ||
"type": "matrixdynamic", | ||
"name": "matrix", | ||
"rowCount": 1, | ||
"columns": [ | ||
{ "cellType": "text", "name": "col1", | ||
"validators": [{ "type": "numeric", "text": "Enter only numbers" }] } | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "page2", | ||
"elements": [ | ||
{ | ||
"type": "text", | ||
"name": "question3" | ||
} | ||
] | ||
} | ||
], | ||
"checkErrorsMode": "onComplete" | ||
}; | ||
|
||
frameworks.forEach(framework => { | ||
fixture`${framework} ${title}`.page`${url}${framework}`.beforeEach( | ||
async t => { | ||
await initSurvey(framework, json1); | ||
} | ||
); | ||
|
||
test("validate on error", async t => { | ||
let surveyResult; | ||
|
||
await t | ||
.pressKey("tab") | ||
.pressKey("tab") | ||
.pressKey("a") | ||
.click("input[value=\"Next\"]") | ||
.click("input[value=\"Complete\"]") | ||
.pressKey("backspace") | ||
.pressKey("1") | ||
.click("input[value=\"Next\"]") | ||
.click("input[value=\"Complete\"]"); | ||
|
||
surveyResult = await getSurveyResult(); | ||
await t.expect(surveyResult).eql({ q1: "1" }); | ||
}); | ||
}); | ||
|
||
frameworks.forEach(framework => { | ||
fixture`${framework} ${title}`.page`${url}${framework}`.beforeEach( | ||
async t => { | ||
await initSurvey(framework, json2); | ||
} | ||
); | ||
|
||
test("validate on error in matrix", async t => { | ||
let surveyResult; | ||
|
||
await t | ||
.pressKey("tab") | ||
.pressKey("tab") | ||
.pressKey("a") | ||
.click("input[value=\"Next\"]") | ||
.click("input[value=\"Complete\"]") | ||
.pressKey("backspace") | ||
.pressKey("1") | ||
.click("input[value=\"Next\"]") | ||
.click("input[value=\"Complete\"]"); | ||
|
||
surveyResult = await getSurveyResult(); | ||
await t.expect(surveyResult).eql({ matrix: [{ col1: "1" }] }); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+593 Bytes
(100%)
visualRegressionTests/tests/defaultV2/etalons/survey-responsive-timer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+570 Bytes
(100%)
visualRegressionTests/tests/defaultV2/etalons/survey-timer-without-progress.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+596 Bytes
(100%)
visualRegressionTests/tests/defaultV2/etalons/survey-timer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters