Skip to content

Commit

Permalink
Merge pull request #1747 from riganti/uitests-fix-validation-waitfor
Browse files Browse the repository at this point in the history
Add WaitFor into ValidationPath tests
  • Loading branch information
tomasherceg authored Dec 1, 2023
2 parents 3817d9f + 35a4119 commit ba3e3ca
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,23 @@
</head>
<body>
<div data-ui="root">
<dot:TextBox Text="{value: Text}" />
<label>Text: <dot:TextBox Text="{value: Text}" placeholder="fill in anything" /></label>
<dot:Validator Value="{value: Text}">*</dot:Validator>
</div>

<div data-ui="innerProp">
<dot:TextBox Text="{value: Data.Text}" />
<label> Data.Text: <dot:TextBox Text="{value: Data.Text}" placeholder="validation will always fail" /></label>
<dot:Validator Value="{value: Data.Text}">*</dot:Validator>
</div>

<div data-ui="dataContext" DataContext="{value: Data2}">
<dot:TextBox Text="{value: Text}" />
<label>Data2 / Text: <dot:TextBox Text="{value: Text}" placeholder="in all of these textboxes" /></label>
<dot:Validator Value="{value: Text}">*</dot:Validator>
</div>

<dot:Repeater data-ui="repeater" DataSource="{value: Col}">
<dot:TextBox Text="{value: Text}" />
<SeparatorTemplate> | </SeparatorTemplate>
{{value: $"Col[{_index}].Text: "}}<dot:TextBox Text="{value: Text}" placeholder="even here" />
<dot:Validator Value="{value: Text}">
*
</dot:Validator>
Expand Down
9 changes: 6 additions & 3 deletions src/Samples/Tests/Tests/Feature/ValidationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -808,10 +808,13 @@ public void Feature_Validation_ValidationPaths(string validationPath)

button.Click();

var validationPaths = validationPathsList.FindElements("li").Select(t => t.GetInnerText()).ToList();
browser.WaitFor(() => {

var validationPaths = validationPathsList.FindElements("li").Select(t => t.GetInnerText()).ToList();

bool hasCorrectValidationPath = validationPaths.Any(t => t == validationPath);
Assert.True(hasCorrectValidationPath,"None of the errors has expected validation path.");
bool hasCorrectValidationPath = validationPaths.Any(t => t == validationPath);
Assert.True(hasCorrectValidationPath, $"None of the errors has expected validation path ({validationPath}).");
}, timeout: 2_000);
});
}

Expand Down

0 comments on commit ba3e3ca

Please sign in to comment.