Skip to content

Commit

Permalink
teacherCreateCourseCOT4oTest passing!
Browse files Browse the repository at this point in the history
  • Loading branch information
augustocristian committed Jul 30, 2024
1 parent 49cf184 commit e417769
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,26 +119,27 @@ void teacherCreateCourseCOT4oTest() {
NavigationUtilities.toCoursesHome(driver);

// Click on the "Create Course" button
WebElement createCourseButton = driver.findElement(By.id("create-course-button"));
WebElement createCourseButton = driver.findElement(By.id("add-course-icon"));
Click.element(driver, createCourseButton);

// Enter course title
WebElement courseTitleInput = driver.findElement(By.id("course-title-input"));
WebElement courseTitleInput = driver.findElement(By.id("input-post-course-name"));
courseTitleInput.sendKeys("New Course Title");

// Optionally upload an image
WebElement courseImageInput = driver.findElement(By.id("course-image-input"));
courseImageInput.sendKeys("/path/to/image.jpg");
WebElement fileInput = driver.findElement(By.id("inputPostCourseImage"));
File uploadFile= new File("src/test/resources/inputs/image.png");
fileInput.sendKeys(uploadFile.getAbsolutePath());

// Click on the "Create Course" button
WebElement createCourseSubmitButton = driver.findElement(By.id("create-course-submit-button"));
WebElement createCourseSubmitButton = driver.findElement(By.id("submit-post-course-btn"));
Click.element(driver, createCourseSubmitButton);

// Wait for the course to appear in the dashboard
Wait.notTooMuch(driver).until(ExpectedConditions.visibilityOfElementLocated(By.id("course-list")));

// Verify the new course appears in the teacher's dashboard
WebElement newCourse = driver.findElement(By.xpath("//div[contains(text(), 'New Course Title')]"));
WebElement newCourse = driver.findElement(By.xpath("//*[contains(text(), 'New Course Title')]"));
assertTrue(newCourse.isDisplayed(), "New course is not displayed in the dashboard");

} catch (Exception e) {
Expand Down

0 comments on commit e417769

Please sign in to comment.