Skip to content
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

Merged
merged 6 commits into from Mar 27, 2019

Conversation

wkurniawan07
Copy link
Member

Part of #9480 and part of #9536

@wkurniawan07 wkurniawan07 force-pushed the admin-home-tests branch 2 times, most recently from a264713 to d3532f3 Compare March 24, 2019 18:22
@wkurniawan07 wkurniawan07 added the s.ToReview The PR is waiting for review(s) label Mar 24, 2019
Copy link
Contributor

@jacoblipech jacoblipech left a 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")
Copy link
Contributor

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

Copy link
Member Author

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");
Copy link
Contributor

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?

Copy link
Member Author

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";
Copy link
Contributor

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 +++?

Copy link
Member Author

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");
Copy link
Contributor

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?

Copy link
Contributor

@AyushChatto AyushChatto left a 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 :)

@wkurniawan07 wkurniawan07 added s.ToMerge The PR is approved by all reviewers including final reviewer; ready for merging and removed s.ToReview The PR is waiting for review(s) labels Mar 27, 2019
@wkurniawan07 wkurniawan07 merged commit 4e5d230 into TEAMMATES:master Mar 27, 2019
@wkurniawan07 wkurniawan07 deleted the admin-home-tests branch March 27, 2019 13:43
@wkurniawan07 wkurniawan07 added this to the V7.0.0-beta.0 milestone Apr 10, 2019
@wkurniawan07 wkurniawan07 added this to Ongoing in Front-end and RESTful back-end Migration via automation Apr 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s.ToMerge The PR is approved by all reviewers including final reviewer; ready for merging
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants