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
[#9536] [#9480] Add front-end, snapshot, E2E tests for admin home page #9605
Conversation
a264713
to
d3532f3
Compare
d3532f3
to
21b3a52
Compare
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 and works smoothly for the E2E side! Just some minor comments and clarifications
*/ | ||
public class AdminHomePage extends AppPage { | ||
|
||
@FindBy(id = "instructor-details-single-line") |
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.
Is it a good practice to actually add an id for testing only? Cos I have been trying to avoid adding an id directly in my PRs for simple fields
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.
Hard to say. Adding production code for testing purpose is most of the time frowned upon and this should not be an exception, but this simplifies stuffs by quite a lot.
@@ -62,8 +55,7 @@ public void testAll() { | |||
StudentProfileAttributes.Gender.FEMALE, "this is enough!$%&*</>"); | |||
profilePage.verifyPhotoSize("295px", "295px"); | |||
|
|||
StudentProfileAttributes studentProfileAttributes = | |||
BackDoor.getStudentProfile(TestProperties.TEST_STUDENT2_ACCOUNT); | |||
StudentProfileAttributes studentProfileAttributes = BackDoor.getStudentProfile("SProfUiT.student"); |
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.
should we assertNotNull()
for the studentProfileAttributes
before assertTrue the value? Else the return null may not be useful right?
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.
Good to have but not necessary. Without assertNotNull
the block will hit NPE instead of assertion error, which pretty much is the same thing.
AdminHomePage homePage = loginAdminToPage(url, AdminHomePage.class); | ||
|
||
String name = "AHPUiT Instrúctör WithPlusInEmail"; | ||
String email = "AHPUiT+++_.instr1!@gmail.tmt"; |
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.
whats the naming convention for the +++?
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.
Why do you need a naming convention? This is just a sample test data.
@@ -33,9 +26,9 @@ public void testAll() { | |||
|
|||
______TS("Typical case: Log in with filled profile values"); |
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.
Should we keep this style of describing test cases? On a side note, do you think it is necessary to add a description to testAll()
somewhere since we are removing descriptions for all testAll()
functions?
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.
Just some minor nits. Rest LGTM :)
Part of #9480 and part of #9536