Skip to content

Commit 6a056d8

Browse files
OlgaLarinaOlgaLarina
andauthored
time-zone test (#10651)
* time-zone test * time-zone test * time-zone test * time-zone test * time-zone test --------- Co-authored-by: OlgaLarina <[email protected]>
1 parent 5e06445 commit 6a056d8

File tree

3 files changed

+104
-137
lines changed

3 files changed

+104
-137
lines changed

e2e/questions/time-zone.spec.ts

Lines changed: 5 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,50 +2,17 @@ import { frameworks, url, initSurvey, getSurveyResult, test, expect, getTimeZone
22

33
const title = "Text question in western timezone";
44

5+
test.use({
6+
locale: "en-US",
7+
timezoneId: "America/Los_Angeles"
8+
});
9+
510
frameworks.forEach((framework) => {
611
test.describe(`${framework} ${title}`, () => {
7-
test.use({
8-
locale: "en-US",
9-
timezoneId: "America/Los_Angeles"
10-
});
11-
1212
test.beforeEach(async ({ page }) => {
1313
await page.goto(`${url}${framework}`);
1414
});
1515

16-
test.skip("Test input type (month) in western timezone", async ({ page }) => {
17-
await initSurvey(page, framework, {
18-
autoFocusFirstQuestion: true,
19-
elements: [
20-
{
21-
"type": "text",
22-
"name": "monthInput",
23-
"title": "Month Input",
24-
"inputType": "month"
25-
}]
26-
});
27-
28-
expect(await getTimeZone(page)).toBe("America/Los_Angeles");
29-
await expect(page.locator(".sd-text").first()).toBeFocused();
30-
await page.keyboard.press("m");
31-
await page.keyboard.press("a");
32-
await page.keyboard.press("r");
33-
await page.keyboard.press("Tab");
34-
await page.keyboard.press("2");
35-
await page.keyboard.press("0");
36-
await page.keyboard.press("2");
37-
await page.keyboard.press("4");
38-
await page.keyboard.press("Tab");
39-
await page.keyboard.press("Tab");
40-
expect(await page.locator("input").nth(0).inputValue()).toBe("2024-03");
41-
await page.locator("input[value=Complete]").click();
42-
43-
const surveyResult = await getSurveyResult(page);
44-
expect(surveyResult).toEqual({
45-
monthInput: "2024-03"
46-
});
47-
});
48-
4916
test("Test mask in western timezone", async ({ page }) => {
5017
if (framework === "vue") return;
5118
await initSurvey(page, framework, {
Lines changed: 67 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,73 @@
1-
import { fixture, test } from "testcafe";
2-
import { frameworks, url_test, initSurvey, checkSurveyWithEmptyQuestion, explicitErrorHandler } from "../helper";
3-
const title = "sortablejs";
1+
// import { fixture, test } from "testcafe";
2+
// import { frameworks, url_test, initSurvey, checkSurveyWithEmptyQuestion, explicitErrorHandler } from "../helper";
3+
// const title = "sortablejs";
44

5-
const json = {
6-
elements: [
7-
{
8-
type: "sortablelist",
9-
name: "lifepriopity",
10-
title: "Life Priorities ",
11-
isRequired: true,
12-
colCount: 0,
13-
choices: ["family", "work", "pets", "travels", "games"],
14-
},
15-
],
16-
};
5+
// const json = {
6+
// elements: [
7+
// {
8+
// type: "sortablelist",
9+
// name: "lifepriopity",
10+
// title: "Life Priorities ",
11+
// isRequired: true,
12+
// colCount: 0,
13+
// choices: ["family", "work", "pets", "travels", "games"],
14+
// },
15+
// ],
16+
// };
1717

18-
frameworks.forEach((framework) => {
19-
fixture`${framework} ${title}`
20-
.page`${url_test}customWidget/${framework}`.beforeEach(
21-
async (ctx) => {
22-
await explicitErrorHandler();
23-
await initSurvey(framework, json);
24-
}
25-
);
18+
// frameworks.forEach((framework) => {
19+
// fixture`${framework} ${title}`
20+
// .page`${url_test}customWidget/${framework}`.beforeEach(
21+
// async (ctx) => {
22+
// await explicitErrorHandler();
23+
// await initSurvey(framework, json);
24+
// }
25+
// );
2626

27-
test("check integrity", async (t) => {
28-
await t
29-
.hover("div[data-value]:nth-child(1)")
30-
.hover("div[data-value]:nth-child(2)")
31-
.hover("div[data-value]:nth-child(3)")
32-
.hover("div[data-value]:nth-child(4)")
33-
.hover("div[data-value]:nth-child(5)");
34-
});
27+
// test("check integrity", async (t) => {
28+
// await t
29+
// .hover("div[data-value]:nth-child(1)")
30+
// .hover("div[data-value]:nth-child(2)")
31+
// .hover("div[data-value]:nth-child(3)")
32+
// .hover("div[data-value]:nth-child(4)")
33+
// .hover("div[data-value]:nth-child(5)");
34+
// });
3535

36-
test("choose empty", async (t) => {
37-
await checkSurveyWithEmptyQuestion(t);
38-
});
36+
// test("choose empty", async (t) => {
37+
// await checkSurveyWithEmptyQuestion(t);
38+
// });
3939

40-
test("choose value", async (t) => {
41-
// TODO d&d doesn't work https://github.com/DevExpress/testcafe/issues/897
42-
// let surveyResult;
43-
//
44-
// await t
45-
// .dragToElement('.source div:nth-child(4)', '.result')
46-
// .dragToElement('.source div:nth-child(1)', '.result')
47-
// .click(`input[value=Complete]`);
48-
//
49-
// surveyResult = await getSurveyResult();
50-
// assert.deepEqual(surveyResult.lifepriopity, ["travels","family"]);
51-
});
40+
// test("choose value", async (t) => {
41+
// // TODO d&d doesn't work https://github.com/DevExpress/testcafe/issues/897
42+
// // let surveyResult;
43+
// //
44+
// // await t
45+
// // .dragToElement('.source div:nth-child(4)', '.result')
46+
// // .dragToElement('.source div:nth-child(1)', '.result')
47+
// // .click(`input[value=Complete]`);
48+
// //
49+
// // surveyResult = await getSurveyResult();
50+
// // assert.deepEqual(surveyResult.lifepriopity, ["travels","family"]);
51+
// });
5252

53-
test("change priority", async (t) => {
54-
// TODO d&d doesn't work https://github.com/DevExpress/testcafe/issues/897
55-
// let surveyResult;
56-
//
57-
// await t
58-
// .dragToElement('.source div:nth-child(1)', '.result')
59-
// .dragToElement('.source div:nth-child(2)', '.result')
60-
// .dragToElement('.source div:nth-child(3)', '.result')
61-
// .dragToElement('.source div:nth-child(4)', '.result')
62-
// .dragToElement('.source div:nth-child(5)', '.result')
63-
// .dragToElement('.result div:nth-child(1)', '.result div:nth-child(5) div')
64-
// .dragToElement('.result div:nth-child(1)', '.result div:nth-child(4) div')
65-
// .dragToElement('.result div:nth-child(1)', '.result div:nth-child(3) div')
66-
// .dragToElement('.result div:nth-child(1)', '.result div:nth-child(2) div')
67-
//
68-
// .click(`input[value=Complete]`);
69-
//
70-
// surveyResult = await getSurveyResult();
71-
// assert.deepEqual(surveyResult.lifepriopity, ["games","travels","pets","work","family"]);
72-
});
73-
});
53+
// test("change priority", async (t) => {
54+
// // TODO d&d doesn't work https://github.com/DevExpress/testcafe/issues/897
55+
// // let surveyResult;
56+
// //
57+
// // await t
58+
// // .dragToElement('.source div:nth-child(1)', '.result')
59+
// // .dragToElement('.source div:nth-child(2)', '.result')
60+
// // .dragToElement('.source div:nth-child(3)', '.result')
61+
// // .dragToElement('.source div:nth-child(4)', '.result')
62+
// // .dragToElement('.source div:nth-child(5)', '.result')
63+
// // .dragToElement('.result div:nth-child(1)', '.result div:nth-child(5) div')
64+
// // .dragToElement('.result div:nth-child(1)', '.result div:nth-child(4) div')
65+
// // .dragToElement('.result div:nth-child(1)', '.result div:nth-child(3) div')
66+
// // .dragToElement('.result div:nth-child(1)', '.result div:nth-child(2) div')
67+
// //
68+
// // .click(`input[value=Complete]`);
69+
// //
70+
// // surveyResult = await getSurveyResult();
71+
// // assert.deepEqual(surveyResult.lifepriopity, ["games","travels","pets","work","family"]);
72+
// });
73+
// });

functionalTests/questions/text.js

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { frameworks, url, initSurvey, getSurveyResult, getQuestionValue, getQuestionJson, getTimeZone, setTimeZoneUnsafe } from "../helper";
2-
import { Selector, fixture, test, ClientFunction } from "testcafe";
3-
const title = "text";
1+
// import { frameworks, url, initSurvey, getSurveyResult, getQuestionValue, getQuestionJson, getTimeZone, setTimeZoneUnsafe } from "../helper";
2+
// import { Selector, fixture, test, ClientFunction } from "testcafe";
3+
// const title = "text";
44

55
// const json = {
66
// elements: [
@@ -243,35 +243,35 @@ const title = "text";
243243
// });
244244
// });
245245

246-
frameworks.forEach((framework) => {
247-
fixture`${framework} ${title}`.page`${url}${framework}`;
248-
test("Test input type (month) in western timezone", async (t) => {
249-
const oldTimeZone = await getTimeZone();
250-
await setTimeZoneUnsafe(t, "America/Los_Angeles");
251-
await initSurvey(framework, {
252-
autoFocusFirstQuestion: true,
253-
elements: [
254-
{
255-
"type": "text",
256-
"name": "monthInput",
257-
"title": "Month Input",
258-
"inputType": "month"
259-
}]
260-
});
261-
262-
await t
263-
.expect(getTimeZone()).eql("America/Los_Angeles")
264-
.pressKey("M tab 2 0 2 4 tab")
265-
.expect(Selector("input").nth(0).value).eql("2024-03")
266-
.click("input[value=Complete]");
267-
268-
const surveyResult = await getSurveyResult();
269-
await t.expect(surveyResult).eql({
270-
monthInput: "2024-03"
271-
});
272-
await setTimeZoneUnsafe(t, oldTimeZone);
273-
});
274-
});
246+
// frameworks.forEach((framework) => {
247+
// fixture`${framework} ${title}`.page`${url}${framework}`;
248+
// test("Test input type (month) in western timezone", async (t) => {
249+
// const oldTimeZone = await getTimeZone();
250+
// await setTimeZoneUnsafe(t, "America/Los_Angeles");
251+
// await initSurvey(framework, {
252+
// autoFocusFirstQuestion: true,
253+
// elements: [
254+
// {
255+
// "type": "text",
256+
// "name": "monthInput",
257+
// "title": "Month Input",
258+
// "inputType": "month"
259+
// }]
260+
// });
261+
262+
// await t
263+
// .expect(getTimeZone()).eql("America/Los_Angeles")
264+
// .pressKey("M tab 2 0 2 4 tab")
265+
// .expect(Selector("input").nth(0).value).eql("2024-03")
266+
// .click("input[value=Complete]");
267+
268+
// const surveyResult = await getSurveyResult();
269+
// await t.expect(surveyResult).eql({
270+
// monthInput: "2024-03"
271+
// });
272+
// await setTimeZoneUnsafe(t, oldTimeZone);
273+
// });
274+
// });
275275
// frameworks.forEach((framework) => {
276276
// fixture`${framework} ${title}`.page`${url}${framework}`;
277277

0 commit comments

Comments
 (0)