-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test: 348 make Playwright detect 500s #358
Merged
myieye
merged 2 commits into
develop
from
test/348-write-playwright-test-that-verifies-an-error-is-shown-when-the-server-returns-a-500
Nov 6, 2023
Merged
Test: 348 make Playwright detect 500s #358
myieye
merged 2 commits into
develop
from
test/348-write-playwright-test-that-verifies-an-error-is-shown-when-the-server-returns-a-500
Nov 6, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
myieye
force-pushed
the
test/348-write-playwright-test-that-verifies-an-error-is-shown-when-the-server-returns-a-500
branch
from
October 31, 2023 10:40
f5eb31b
to
6a7f17e
Compare
hahn-kev
reviewed
Nov 1, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work, I like storing the errors and throwing them later if none were expected.
myieye
force-pushed
the
test/348-write-playwright-test-that-verifies-an-error-is-shown-when-the-server-returns-a-500
branch
2 times, most recently
from
November 2, 2023 10:21
2f9d07e
to
eb1eb4a
Compare
hahn-kev
reviewed
Nov 6, 2023
hahn-kev
approved these changes
Nov 6, 2023
myieye
force-pushed
the
test/348-write-playwright-test-that-verifies-an-error-is-shown-when-the-server-returns-a-500
branch
from
November 6, 2023 10:47
eb1eb4a
to
def31a5
Compare
myieye
deleted the
test/348-write-playwright-test-that-verifies-an-error-is-shown-when-the-server-returns-a-500
branch
November 6, 2023 12:46
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #348
Resolves #349
Status code handling is further improved in a draft PR (#357) that is waiting for this one to be merged.
Here's what the output looks like for the tests that were getting 500s. It's still a lot to parse, but at least there's a 500 in there:
EmailWorkflowTests.RegisterVerifyUpdateVerifyEmailAdress
[xUnit.net 00:00:40.47] Testing.Browser.EmailWorkflowTests.RegisterVerifyUpdateVerifyEmailAdre ss [FAIL] Failed Testing.Browser.EmailWorkflowTests.RegisterVerifyUpdateVerifyEmailAdress [37 s] Error Message: System.AggregateException : One or more errors occurred. (Timeout 30000ms exceeded. =========================== logs =========================== waiting for navigation to "/user" until "NetworkIdle" ============================================================) (One or more errors occurred. (Unexp ected response: Internal Server Error (500). URL: http://localhost/api/login/verifyEmail?jwt=***** &returnTo=%2Fuser%3FemailResult%3DverifiedEmail&email=54fb1b67-e426-4367-928a-f863514b1159@mailina tor.com.)) ---- System.TimeoutException : Timeout 30000ms exceeded. =========================== logs =========================== waiting for navigation to "/user" until "NetworkIdle" ============================================================ -------- System.TimeoutException : Timeout 30000ms exceeded. ---- System.AggregateException : One or more errors occurred. (Unexpected response: Internal Serve r Error (500). URL: http://localhost/api/login/verifyEmail?jwt=*****&returnTo=%2Fuser%3FemailResul t%3DverifiedEmail&[email protected].) -------- Testing.Browser.Base.UnexpectedResponseException : Unexpected response: Internal Server E rror (500). URL: http://localhost/api/login/verifyEmail?jwt=*****&returnTo=%2Fuser%3FemailResult%3 DverifiedEmail&[email protected]. Stack Trace:
----- Inner Stack Trace #1 (System.TimeoutException) -----
at Microsoft.Playwright.Core.Waiter.WaitForPromiseAsync[T](Task
1 task, Action dispose) in /_/s rc/Playwright/Core/Waiter.cs:line 219 at Microsoft.Playwright.Core.Frame.WaitForNavigationInternalAsync(Waiter waiter, String url, Fu nc
2 urlFunc, Regex urlRegex, String urlString, Nullable1 waitUntil) in /_/src/Playwright/Core/Fr ame.cs:line 257 at Microsoft.Playwright.Core.Frame.RunAndWaitForNavigationAsync(Func
1 action, FrameRunAndWaitForNavigationOptions options) in //src/Playwright/Core/Frame.cs:line 225
at Testing.Browser.Page.BasePage
1.WaitFor() in D:\code\languageforge-lexbox\backend\Testing\Br owser\Page\BasePage.cs:line 39 at Testing.Browser.EmailWorkflowTests.RegisterVerifyUpdateVerifyEmailAdress() in D:\code\langua geforge-lexbox\backend\Testing\Browser\EmailWorkflowTests.cs:line 31 at Testing.Browser.EmailWorkflowTests.RegisterVerifyUpdateVerifyEmailAdress() in D:\code\langua geforge-lexbox\backend\Testing\Browser\EmailWorkflowTests.cs:line 63 --- End of stack trace from previous location --- ----- Inner Stack Trace ----- at Microsoft.Playwright.Helpers.TaskHelper.<>c__DisplayClass2_0.<WithTimeout>b__0() in /_/src/P laywright/Helpers/TaskHelper.cs:line 73 at Microsoft.Playwright.Helpers.TaskHelper.WithTimeout(Task task, Func
1 timeoutAction, TimeSpan timeout, CancellationToken cancellationToken) in //src/Playwright/Helpers/TaskHelper.cs:line 10
9
at Microsoft.Playwright.Core.Waiter.WaitForPromiseAsync[T](Task`1 task, Action dispose) in /_/s
rc/Playwright/Core/Waiter.cs:line 211
----- Inner Stack Trace #2 (System.AggregateException) -----
at Testing.Browser.Base.PageTest.DisposeAsync() in D:\code\languageforge-lexbox\backend\Testing
\Browser\Base\PageTest.cs:line 91
----- Inner Stack Trace -----
EmailWorkflowTests.ForgotPassword
[xUnit.net 00:00:43.78] Testing.Browser.EmailWorkflowTests.ForgotPassword [FAIL] Failed Testing.Browser.EmailWorkflowTests.ForgotPassword [40 s] Error Message: System.AggregateException : One or more errors occurred. (response.Status should be 200 but was 403
Additional Info:
code was 403 (Forbidden)) (One or more errors occurred. (Unexpected response: Internal Server
Error (500). URL: http://localhost/api/login/resetPassword.))
---- Shouldly.ShouldAssertException : response.Status
should be
200
but was
403
Additional Info:
code was 403 (Forbidden)
---- System.AggregateException : One or more errors occurred. (Unexpected response: Internal Serve
r Error (500). URL: http://localhost/api/login/resetPassword.)
-------- Testing.Browser.Base.UnexpectedResponseException : Unexpected response: Internal Server E
rror (500). URL: http://localhost/api/login/resetPassword.
Stack Trace:
----- Inner Stack Trace #1 (Shouldly.ShouldAssertException) -----
at Testing.Browser.Util.HttpUtils.ExecuteGql(IPage page, String gql, Boolean expectGqlError) in
D:\code\languageforge-lexbox\backend\Testing\Browser\Util\HttpUtils.cs:line 16
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task tas
k)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Testing.Browser.Page.TempUserDashboardPage.DisposeAsync() in D:\code\languageforge-lexbox\ba
ckend\Testing\Browser\Page\TempUserDashboardPage.cs:line 17
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task tas
k)
at Testing.Browser.EmailWorkflowTests.ForgotPassword() in D:\code\languageforge-lexbox\backend
Testing\Browser\EmailWorkflowTests.cs:line 96
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task tas
k)
--- End of stack trace from previous location ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task tas
k)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task tas
k)
----- Inner Stack Trace #2 (System.AggregateException) -----
at Testing.Browser.Base.PageTest.DisposeAsync() in D:\code\languageforge-lexbox\backend\Testing
\Browser\Base\PageTest.cs:line 91
----- Inner Stack Trace -----
Here's the error dialog that will now be shown if "Reset password" gets a 500 response: