Skip to content

Commit

Permalink
#3961 - s-test
Browse files Browse the repository at this point in the history
  • Loading branch information
novikov82 committed Feb 10, 2022
1 parent 5acf20e commit c8fb09b
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 1 deletion.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 26 additions & 1 deletion visualRegressionTests/tests/defaultV2/file.ts
Expand Up @@ -23,7 +23,7 @@ const json = {
}]
};

frameworks.forEach(framework => {
/*frameworks*/["knockout"].forEach(framework => {
fixture`${framework} ${title} ${theme}`
.page`${url_test}${theme}/${framework}.html`.beforeEach(async t => {
await applyTheme(theme);
Expand Down Expand Up @@ -54,4 +54,29 @@ frameworks.forEach(framework => {
.expect(compareResults.isValid())
.ok(compareResults.errorMessages());
});
test("Check file question mobile mode", async (t) => {
await t.resizeWindow(1920, 1080);
await ClientFunction(()=>{
const question = (window as any).survey.setIsMobile(true);
})();
await t.setFilesToUpload(Selector(".sd-file input"), ["files/SingleImage.jpg"]);
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
const questionRoot = Selector(".sd-question");
await ClientFunction(()=>{
const question = (window as any).survey.getQuestionByName("file_question");
question.allowMultiple = true;
question.clear();
})();
await t.setFilesToUpload(Selector(".sd-file input"), ["files/Badger.png", "files/Bird.png", "files/Read Me.txt", "files/Flamingo.png"]);
await takeScreenshot("file-question-multiple-mobile.png", questionRoot, screenshotComparerOptions);
await t
.expect(compareResults.isValid())
.ok(compareResults.errorMessages());

await t.click(Selector(".sd-file #nextPage"));
await takeScreenshot("file-question-multiple-mobile-next.png", questionRoot, screenshotComparerOptions);
await t.click(Selector(".sd-file #prevPage"));
await t.click(Selector(".sd-file #prevPage"));
await takeScreenshot("file-question-multiple-mobile-prev.png", questionRoot, screenshotComparerOptions);
});
});

0 comments on commit c8fb09b

Please sign in to comment.