-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
[#13066] Combine Admin Add Account Request Flow into Instructor Account Request Flow #13124
base: master
Are you sure you want to change the base?
Changes from 16 commits
0b29350
13f7add
4f24c5e
880278f
86ecbaf
b97b637
105cb50
1132790
63fb244
b81a48f
0223006
49f4ce1
0de6816
c481da4
35471f2
3e6daf8
1030c7e
2dc547f
9e15d2f
66d4a0e
7862935
28e5c97
7a954f7
3cbf5a0
7d5feca
0fa111b
a2f3b4f
266a37e
3351df8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,26 +26,19 @@ public void testAll() { | |
AdminHomePage homePage = loginAdminToPage(url, AdminHomePage.class); | ||
|
||
______TS("Test adding instructors with both valid and invalid details"); | ||
|
||
String name = "AHPUiT Instrúctör WithPlusInEmail"; | ||
String email = "[email protected]"; | ||
String institute = "TEAMMATES Test Institute 1"; | ||
|
||
homePage.queueInstructorForAdding(name, email, institute); | ||
|
||
String singleLineDetails = "Instructor With Invalid Email | invalidemail | TEAMMATES Test Institute 1"; | ||
|
||
homePage.queueInstructorForAdding(singleLineDetails); | ||
|
||
homePage.addAllInstructors(); | ||
homePage.clickApproveAccountRequestButton(name, email, institute); | ||
|
||
String successMessage = homePage.getMessageForInstructor(0); | ||
String successMessage = homePage.getToastTextContent(); | ||
assertTrue(successMessage.contains( | ||
"Instructor \"AHPUiT Instrúctör WithPlusInEmail\" has been successfully created")); | ||
|
||
String failureMessage = homePage.getMessageForInstructor(1); | ||
assertTrue(failureMessage.contains( | ||
"\"invalidemail\" is not acceptable to TEAMMATES as a/an email because it is not in the correct format.")); | ||
"Account request was successfully approved. Email has been sent to [email protected].")); | ||
} | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,16 +34,6 @@ public void testAll() { | |
|
||
homePage.queueInstructorForAdding(singleLineDetails); | ||
|
||
homePage.addAllInstructors(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As part of our migration to SQL, please keep the E2E tests the same as its non-SQL counterpart as much as possible. The logic here does not represent the same logic in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Both tests use the same logic now, the page reload was removed because |
||
|
||
String successMessage = homePage.getMessageForInstructor(0); | ||
assertTrue(successMessage.contains( | ||
"Instructor \"AHPUiT Instrúctör WithPlusInEmail\" has been successfully created")); | ||
|
||
String failureMessage = homePage.getMessageForInstructor(1); | ||
assertTrue(failureMessage.contains( | ||
"\"invalidemail\" is not acceptable to TEAMMATES as a/an email because it is not in the correct format.")); | ||
|
||
homePage.reloadPage(); | ||
|
||
______TS("Verify that newly added instructor appears in account request table"); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,9 +36,6 @@ public class AdminHomePage extends AppPage { | |
@FindBy (id = "add-instructor-single-line") | ||
private WebElement submitButtonDetailsSingleLineForm; | ||
|
||
@FindBy (id = "add-all-instructors") | ||
private WebElement addAllInstructorsButton; | ||
|
||
public AdminHomePage(Browser browser) { | ||
super(browser); | ||
} | ||
|
@@ -69,13 +66,17 @@ public void queueInstructorForAdding(String instructorDetails) { | |
click(submitButtonDetailsSingleLineForm); | ||
} | ||
|
||
public void addAllInstructors() { | ||
click(addAllInstructorsButton); | ||
waitForElementToBeClickable(addAllInstructorsButton); | ||
public void clickApproveAccountRequestButton(String name, String email, String institute) { | ||
WebElement accountRequestRow = getAccountRequestRow(name, email, institute); | ||
waitForElementPresence(By.cssSelector("[id^='approve-account-request-']")); | ||
WebElement approveButton = accountRequestRow.findElement(By.cssSelector("[id^='approve-account-request-']")); | ||
waitForElementToBeClickable(approveButton); | ||
approveButton.click(); | ||
waitForPageToLoad(); | ||
} | ||
|
||
public String getMessageForInstructor(int i) { | ||
By by = By.id("message-instructor-" + i); | ||
public String getToastTextContent() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There should be a method (i think its named There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Switched over to verifyStatusMessage, thanks. |
||
By by = By.tagName("tm-toast"); | ||
waitForElementVisibility(by); | ||
WebElement element = browser.driver.findElement(by); | ||
if (element == null) { | ||
|
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.
Try not to remove this negative test case
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've added back an error toast for when a single line request has an invalid email under
validateAndAddInstructorDetails
, it works when I add a request manually but when running the e2e test, no toast is shown.A toast made by the approve account button - under the account request table still works, any ideas why on this is happening?
https://github.com/user-attachments/assets/c985d4dd-5a51-4ca0-90e1-67ee7e48197a
I've tried rerunning the e2e tests after deleting all the postgres data and remaking all docker containers.
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.
The issue was user error, I forgot to build the front-end files after editing.
I've added back in the negative test case with a updated error message.