-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Fix #13798 remove warning check flag and now always warn leaving #20151
Conversation
Assigning @Lawful2002 for the first pass review of this PR. Thanks! |
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.
Thanks @Yushu-He, LGTM.
PTAL at the failing test.
Unassigning @Lawful2002 since they have already approved the PR. |
Hi @Yushu-He, this PR is ready to be merged. Please address any remaining comments prior to merging, and feel free to ask someone to merge your PR once the CI checks pass and you're happy with it. Thanks! |
@Yushu-He Just to check, are you still planning to look at this? (See @Lawful2002's comment about the failing test.) |
@seanlip Yes, I was planning to check on this. But I am not very familiar with the e2e test and didn't get an idea why it fails as this should only affect when leaving the page. I doubt that maybe in the test some actions involve leaving the page and should be modified to adapt the new change. |
@Yushu-He See lines 261-263 in core/tests/webdriverio/learnerFlow.js. I suspect the error lies around there. Our wiki pages have info on the e2e tests if you want to understand how they work in more detail. |
Head branch was pushed to by a user without write access
@seanlip Thanks for your advice! I now add acceptAlert to getHomePageWithAlert But I don't know whether it is a good practice to do so. (Because I add a new method to libraryPage) |
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.
Thanks @Yushu-He, one comment.
@@ -115,6 116,16 @@ var LibraryPage = function () { | |||
); | |||
}; | |||
|
|||
this.getHomePageWithAlert = async function () { | |||
await action.click('Oppia logo', oppiaLogo); |
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.
This isn't the way to do it -- the actions in this file should be actions taken by the user, and the user is not in control of whether they'll get an alert or not.
Instead, keep getHomePage() as it was and pass in a new boolean arg expectAlertToAppear
. Add a comment to that method explaining in which circumstances the alert can appear. Update all existing references to getHomePage() to pass in false for that boolean, and pass in true at the point you need it in your test.
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.
Thanks! I tried to revise the code and now it looks better.
Also @DubeySandeep PTAL as codeowner, thanks. |
Hi, @DubeySandeep, the LGTM Label has been removed because the changes were requested on this PR. Thanks!. |
@seanlip @DubeySandeep Please review the revised code, I think it is now good and pass the test. |
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.
LGTM. Thanks @Yushu-He, and congrats on your first PR to Oppia! 🎉
Overview
isLoggedIn
andisLoggedOutProgressTracked
) for warn leaving and now always warn.Essential Checklist
Please follow the instructions for making a code change.
Proof that changes are correct
unlogin.user.mp4
login.user.mp4
Proof of changes on desktop with slow/throttled network
Proof of changes on mobile phone
Proof of changes in Arabic language
PR Pointers