-
Notifications
You must be signed in to change notification settings - Fork 16
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
Add ui tests for notifications #2019
Conversation
Your Render PR Server URL is https://chainsafe-components-stage-pr-2019.onrender.com. Follow its progress at https://dashboard.render.com/static/srv-c8onshvd17c0hukm4ha0. |
Your Render PR Server URL is https://storage-ui-stage-pr-2019.onrender.com. Follow its progress at https://dashboard.render.com/static/srv-c8onsivd17c0hukm4heg. |
Your Render PR Server URL is https://files-ui-stage-pr-2019.onrender.com. Follow its progress at https://dashboard.render.com/static/srv-c8onsjvd17c0hukm4hs0. |
I realized that by introducing the test for the crypto invoice notification I have affected another test in the subscription plan spec related to crypto payments (it's not expecting an unpaid invoice row to be there at the beginning of the test). I might have to see if there's a way to use separate sessions for each test to prevent a conflict as there's not a way to clear down that state afaik. |
I pushed commit to add a flag to generate a random session id, and force a new session. |
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.
Looks good, just left a small comment
@@ -40,8 +40,9 @@ export const settingsPage = { | |||
payNowButton: () => cy.get("[data-testid=button-pay-invoice]"), | |||
|
|||
// use this convenience function when an upgraded account is required as a test requisite | |||
upgradeSubscription(plan: "pro" | "max") { | |||
upgradeSubscription(plan: "pro" | "max", card?: "expiring") { |
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.
I would use a boolean here isCardExpired
instead
If you want to make this easier to read, then instead of having 2 params, you can change this for object 1 param, with the type {plan: "pro"|"max", isCardExpired: boolean}
. Then when you call this function, the params are easy to read, rather than func("pro", true)
, it'd be func({plan: "pro", isCardExpired: true})
edit: Maybe what you wanted to test is the fact that it's expiring this month, the name would change, but not the idea.
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.
@Tbaut thanks for the explanation and letting me know about this approach, I've updated this now 🙏.
It failed with the following, but it passed locally :(
edit: This looks like an api issue. The |
@Tbaut Unfortunately I got stuck on this and was unable to resolve it but I'm fairly confident it's not an API issue (well, it seems related to the API but not caused by the API). I've tried many things but am not fully understanding the underlying issue. I can replicate the issue outside of CI though. Currently, with the two tests marked as The test that is restoring the session will fail on the resetToFreePlan every time, whilst the other test continues to run and pass as it is always using a new session. If you clear the sessions everything works again too (guess that's obvious 😄). So it seems like something weird is going on when using apiTestHelper after a session restore (maybe with the token refresh?). I'll continue to look at it tomorrow with a fresh brain but if you have any ideas please let me know (and thanks for your help so far with this!). |
Hey Andrew, from the suite of calls perspective, there's 100% something weird with the api. This should be tackled in this PR https://github.com/ChainSafe/files-api/pull/2082 I couldn't test with the api preview unfortunately so we'll have to wait until it's merged. The problem is with the "return to free subscription" helper, that is failing for no apparent reason. |
ok I have some news. The "back to free plan" logic does not work if the user that we have is currently having a subscription awaiting payment, which is the case when we have a crypto test right before. There is no way we can go around this api limitation. So the solution is to use my "newSesion" flag, every time we do something with crypto. |
…i-tests-for-notifications
…Safe/ui-monorepo into mnt/add-ui-tests-for-notifications
@Tbaut as mentioned on slack, the issues described above are now resolved by the latest api release on stage :) |
closes #2018
Adds tests for