-
Notifications
You must be signed in to change notification settings - Fork 839
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add functional tests #5977 * Fix functional test #5977 * Fix angular tests * Fix vue visual test #5977 --------- Co-authored-by: Dmitry Kuzin <dk981234@gmail.com>
- Loading branch information
1 parent
100cc55
commit 3a555a1
Showing
12 changed files
with
90 additions
and
49 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
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,56 @@ | ||
import { frameworks, url, initSurvey, getListItemByText, completeButton, getSurveyResult } from "../helper"; | ||
import { Selector, ClientFunction } from "testcafe"; | ||
const title = "component_single_question"; | ||
const questionDropdownSelect = Selector(".sv_q_dropdown_control"); | ||
const json_question = { | ||
elements: [ | ||
{ | ||
type: "newquestion", | ||
name: "q1" | ||
}, | ||
], | ||
}; | ||
const json_matrix = { | ||
elements: [ | ||
{ | ||
type: "matrixdynamic", | ||
name: "matrix", | ||
columns: [{ name: "col1", cellType: "newquestion" }], | ||
rowCount: 1, | ||
}, | ||
], | ||
}; | ||
const createComponent = ClientFunction(() => { | ||
window["Survey"].ComponentCollection.Instance.add({ | ||
name: "newquestion", | ||
questionJSON: { | ||
type: "dropdown", | ||
choices: ["a", "b", "c"], | ||
}, | ||
}); | ||
}); | ||
|
||
frameworks.forEach((framework) => { | ||
fixture`${framework} ${title}`.page`${url}${framework}.html`; | ||
|
||
test("Component as a single question", async (t) => { | ||
await createComponent(); | ||
await initSurvey(framework, json_question); | ||
await t | ||
.click(questionDropdownSelect) | ||
.click(getListItemByText("b")) | ||
.click(completeButton); | ||
const surveyResult = await getSurveyResult(); | ||
await t.expect(surveyResult.q1).eql("b"); | ||
}); | ||
test("Component as a cell question", async (t) => { | ||
await createComponent(); | ||
await initSurvey(framework, json_matrix); | ||
await t | ||
.click(questionDropdownSelect) | ||
.click(getListItemByText("b")) | ||
.click(completeButton); | ||
const surveyResult = await getSurveyResult(); | ||
await t.expect(surveyResult.matrix[0].col1).eql("b"); | ||
}); | ||
}); |