Skip to content

Commit

Permalink
work for the #6058 (func tests)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry-kurmanov committed May 18, 2023
1 parent f56a29a commit c420c4d
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
32 changes: 16 additions & 16 deletions testCafe/questions/allTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,21 +164,21 @@ var json = {

await t.typeText(
Selector("span").withText("text_question")
.parent("[aria-labelledby]")
.parent("[data-name]")
.find("input"),
"test text"
);

await t.click(
Selector("span").withText("checkbox_question")
.parent("[aria-labelledby]")
.parent("[data-name]")
.find("span")
.withText("item1")
);

await t.click(
Selector("span").withText("radiogroup_question")
.parent("[aria-labelledby]")
.parent("[data-name]")
.find("span")
.withText("item1")
);
Expand All @@ -189,29 +189,29 @@ var json = {

await t.typeText(
Selector("span").withText("comment_question")
.parent("[aria-labelledby]")
.parent("[data-name]")
.find("textarea"),
"test comment"
);

await t.click(
Selector("span").withText("rating_question")
.parent("[aria-labelledby]")
.parent("[data-name]")
.find("span")
.withText("3")
);

await t.click(
Selector("span").withText("imagepicker_question")
.parent("[aria-labelledby]")
.parent("[data-name]")
.find("img")
.withAttribute("alt", "item1")
.parent()
);

await t.click(
Selector("span").withText("boolean_question")
.parent("[aria-labelledby]")
.parent("[data-name]")
.find("span")
.withText("Yes")
);
Expand All @@ -222,52 +222,52 @@ var json = {

await t.click(
Selector("span").withText("signature_question")
.parent("[aria-labelledby]")
.parent("[data-name]")
.find("button")
.withAttribute("title", "Clear")
);

await t.hover(
Selector("span").withText("expression_question")
.parent("[aria-labelledby]")
.parent("[data-name]")
.find("div")
.withText("1")
);

await t.click(
Selector("span").withText("file_question")
.parent("[aria-labelledby]")
.parent("[data-name]")
.find("button")
.withText("Clear")
.filterVisible()
);

await t.click(
Selector("span").withText("matrix_question")
.parent("[aria-labelledby]")
.parent("[data-name]")
.find("tr")
.withText("Row 1")
.find("input[type='radio']")
.parent()
);

const matrixDropdownRow = Selector("span").withText("matrixdropdown_question")
.parent("[aria-labelledby]")
.parent("[data-name]")
.find("tr").withText("Row 1");
await t
.click(matrixDropdownRow.find("div[aria-label='Column 1']"))
.click(getListItemByText("1"));

await t.click(
Selector("span").withText("matrixdynamic_question")
.parent("[aria-labelledby]")
.parent("[data-name]")
.find("span")
.withText("Remove")
);

await t.typeText(
Selector("span").withText("multipletext_question")
.parent("[aria-labelledby]")
.parent("[data-name]")
.find("input"),
"test multiple text"
);
Expand All @@ -277,12 +277,12 @@ var json = {
await t.click(getDynamicPanelRemoveButton("paneldynamic", "Remove"));

// const rankItem1 = Selector("span").withText('ranking_question')
// .parent("[aria-labelledby]")
// .parent("[data-name]")
// .find("div")W
// .withText("item1");

// const rankItem2 = Selector("span").withText('ranking_question')
// .parent("[aria-labelledby]")
// .parent("[data-name]")
// .find("div")
// .withText("item2");
// await t.dragToElement(rankItem1, rankItem2, { destinationOffsetY: -1, speed: 0.1 });
Expand Down
6 changes: 3 additions & 3 deletions testCafe/questions/progressButtons.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ const json = {
await initSurvey(framework, json);
});
test("check progress buttons", async (t) => {
await t.hover(Selector("[aria-label='question1']"));
await t.hover(Selector("[data-name='question1']"));
await t.click(Selector("[title='page3']"));
await t.hover(Selector("[aria-label='question3']"));
await t.hover(Selector("[data-name='question3']"));
await t.click(Selector("[title='page2']"));
await t.hover(Selector("[aria-label='question2']"));
await t.hover(Selector("[data-name='question2']"));
});
});
});
2 changes: 1 addition & 1 deletion testCafe/questions/text.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ frameworks.forEach((framework) => {
test("expand collapse title", async (t) => {
const title = "Please enter your name:";
const questionTitle = Selector("h5").withText(title);
const contentItem = Selector(`input[aria-label='${title}']`);
const contentItem = Selector("input[type='text']");

assert.equal(await contentItem.visible, true);
await t.click(questionTitle);
Expand Down
2 changes: 1 addition & 1 deletion testCafe/survey/composite_components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ frameworks.forEach(framework => {
test("check custom markup in list behavior", async t => {
await registerComponet_onValueChanging();
await initSurvey(framework, json);
const item1Input = Selector("input[aria-label='item1']");
const item1Input = Selector("input[type='text']");
await t
.typeText(item1Input, "1")
.pressKey("tab")
Expand Down

0 comments on commit c420c4d

Please sign in to comment.