Skip to content

Commit

Permalink
add log
Browse files Browse the repository at this point in the history
  • Loading branch information
julian-christl committed Oct 13, 2022
1 parent 5a386b4 commit 36963d2
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/test/cypress/integration/CourseManagement.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,21 @@ describe('Course management', () => {
let courseId: number;

beforeEach(() => {
artemisRequests.courseManagement.createCourse(false, courseName, courseShortName).then((response: Cypress.Response<Course>) => {
course = response.body;
courseId = response.body!.id!;
});
cy.log('Create a course');
artemisRequests.courseManagement
.createCourse(false, courseName, courseShortName)
.its('response.statusCode')
.should('eq', 201)
.then((response: Cypress.Response<Course>) => {
course = response.body;
courseId = response.body!.id!;
cy.log('Created course with id ' + courseId);
cy.log('received response ' + JSON.stringify(response));
});
});

it('Adds a student manually to the course', () => {
cy.log('Add a student manually to the course');
const username = artemis.users.getStudentOne().username;
navigationBar.openCourseManagement();
courseManagementPage.openStudentOverviewOfCourse(courseId);
Expand All @@ -63,6 +71,7 @@ describe('Course management', () => {
});

it('Removes a student manually from the course', () => {
cy.log('Remove a student manually from the course');
const user = artemis.users.getStudentOne();
const username = user.username;
artemisRequests.courseManagement.addStudentToCourse(course, user);
Expand All @@ -75,8 +84,11 @@ describe('Course management', () => {
});

after(() => {
cy.log('Delete the course');
if (!!courseId) {
cy.log('Delete the course with id ' + courseId);
artemisRequests.courseManagement.deleteCourse(courseId).its('status').should('eq', 200);
cy.log('Deleted course with id ' + courseId);
}
});
});
Expand Down

0 comments on commit 36963d2

Please sign in to comment.