Skip to content

Commit

Permalink
Improve student profile E2E stability
Browse files Browse the repository at this point in the history
  • Loading branch information
wkurniawan07 committed Feb 5, 2022
1 parent cfa3f2d commit 19b1cf8
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/e2e/java/teammates/e2e/pageobjects/StudentProfilePage.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,6 @@ public class StudentProfilePage extends AppPage {
@FindBy(className = "upload-edit-photo")
private WebElement uploadPopupButton;

@FindBy(className = "profile-upload-picture-submit")
private WebElement uploadPictureSubmit;

@FindBy(tagName = "tm-upload-edit-profile-picture-modal")
private WebElement uploadEditModal;

@FindBy(className = "btn-space")
private List<WebElement> editPictureTools;

public StudentProfilePage(Browser browser) {
super(browser);
}
Expand Down Expand Up @@ -125,11 +116,13 @@ private void selectGender(StudentProfileAttributes.Gender gender) {
}

public void uploadPicture() {
WebElement uploadPictureSubmit = browser.driver.findElement(By.className("profile-upload-picture-submit"));
click(uploadPictureSubmit);
waitForPageToLoad(true);
}

public void editProfilePhoto() {
List<WebElement> editPictureTools = browser.driver.findElements(By.className("btn-space"));
WebElement editPictureRotateRight = editPictureTools.get(0);
WebElement editPictureFlipHorizontal = editPictureTools.get(1);
WebElement editPictureFlipVertical = editPictureTools.get(2);
Expand Down Expand Up @@ -160,7 +153,9 @@ public void showPictureEditor() {
}

public void closePictureEditor() {
WebElement uploadEditModal = browser.driver.findElement(By.tagName("tm-upload-edit-profile-picture-modal"));
click(uploadEditModal.findElement(By.className("close")));
waitForElementStaleness(uploadEditModal);
}

public void verifyPhotoSize(int height, int width) {
Expand Down Expand Up @@ -221,6 +216,6 @@ private void ensureGenderIsSelectedAs(StudentProfileAttributes.Gender gender) {
}

public void waitForUploadEditModalVisible() {
waitForElementVisibility(uploadEditModal);
waitForElementVisibility(By.tagName("tm-upload-edit-profile-picture-modal"));
}
}

0 comments on commit 19b1cf8

Please sign in to comment.