File tree Expand file tree Collapse file tree 3 files changed +17
-5
lines changed
update-conference-prague-2024/demo-code-feedback-system/src Expand file tree Collapse file tree 3 files changed +17
-5
lines changed Original file line number Diff line number Diff line change 49
49
50
50
if (result .IsSuccessStatusCode )
51
51
{
52
- await UpdatePageStateAsync (PageStateType .Submitted );
53
52
FeedbackText = " " ;
53
+ await UpdatePageStateAsync (PageStateType .Submitted );
54
54
}
55
55
else
56
56
{
57
- await UpdatePageStateAsync (PageStateType .Initial );
58
57
ErrorResult = await result .Content .ReadAsStringAsync ();
58
+ await UpdatePageStateAsync (PageStateType .Initial );
59
59
}
60
60
}
61
61
65
65
await InvokeAsync (StateHasChanged );
66
66
}
67
67
68
-
69
68
public enum PageStateType
70
69
{
71
70
Initial ,
Original file line number Diff line number Diff line change 5
5
<Parameter name =" baseUrl" value =" https://sitestorage7a5bcbd5.z20.web.core.windows.net" />
6
6
</TestRunParameters >
7
7
8
+ <!-- Playwright -->
9
+ <Playwright >
10
+ <!-- In milliseconds-->
11
+ <ExpectTimeout >60000</ExpectTimeout >
12
+ </Playwright >
8
13
</RunSettings >
Original file line number Diff line number Diff line change
1
+ using Microsoft . Playwright ;
1
2
using Microsoft . Playwright . MSTest ;
2
3
3
4
namespace UiTests ;
@@ -8,8 +9,7 @@ public class FeedbackTests : PageTest
8
9
[ TestMethod ]
9
10
public async Task WhenCommentsProvided_SubmitSuccessful ( )
10
11
{
11
- var url = $ "{ TestContext . Properties [ "baseUrl" ] } /comments";
12
- await Page . GotoAsync ( url ) ;
12
+ await Page . GotoAsync ( "/comments" ) ;
13
13
14
14
var commentsArea = Page . Locator ( "textarea[id='comments-area']" ) ;
15
15
await commentsArea . FillAsync ( $ "Comment from WhenCommentsProvided_SubmitSuccessful - { DateTime . UtcNow } ") ;
@@ -18,4 +18,12 @@ public async Task WhenCommentsProvided_SubmitSuccessful()
18
18
19
19
await Expect ( Page . Locator ( "p[id='comment-confirmation']" ) ) . ToBeVisibleAsync ( ) ;
20
20
}
21
+
22
+ public override BrowserNewContextOptions ContextOptions ( )
23
+ {
24
+ return new BrowserNewContextOptions ( )
25
+ {
26
+ BaseURL = TestContext . Properties [ "baseUrl" ] ! . ToString ( ) ,
27
+ } ;
28
+ }
21
29
}
You can’t perform that action at this time.
0 commit comments