Skip to content

Commit

Permalink
e2e testen af
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnoutAllaert committed May 23, 2024
1 parent a9ecb64 commit ad78469
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
1 change: 0 additions & 1 deletion api/middleware/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ def __call__(self, request):


class DisableCSRFMiddleware(object):

def __init__(self, get_response):
self.get_response = get_response

Expand Down
8 changes: 3 additions & 5 deletions frontend/frontend/cypress/e2e/teacher/course.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,26 @@ describe('create and change a course', () => {
cy.get('#addCourse').click()
// fill in the fields
cy.get('#courseName').type('test course')
cy.get('#uploadStudent').get('#email').type('[email protected]')
cy.get('#uploadStudent').get('#add').click()
cy.get('#save').click()
cy.get('#confirm').click()
// check if course was added
cy.get('#logo').click();
cy.contains('test course').should('exist')
cy.contains('Students: 1').should('exist')
cy.contains('Students: 0').should('exist')
})

it('alter course', () => {

cy.contains('test course').click()
cy.get('#editButton').click()
// add a student
cy.get('#uploadStudent').get('#email').type('student1@testing.com') // make sure there is a student 1 in the db
cy.get('#uploadStudent').get('#email').type('student@testing.com')
cy.get('#uploadStudent').get('#add').click()
// save course
cy.get('#save').click()
cy.get('#confirm').click()
// check if the student was added
cy.get('#logo').click();
cy.contains('Students: 2').should('exist')
cy.contains('Students: 1').should('exist')
})
})
Binary file modified frontend/frontend/cypress/fixtures/test.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion frontend/frontend/src/components/GroupAccessComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export function GroupAccessComponent({
marginBottom={2}
>
{/* Button to navigate to groups page */}
<Button data-cy="groupButton" onClick={handleClick}>{t('groups')}</Button>
<Button data-cy="groupButton" id='groupButton' onClick={handleClick}>{t('groups')}</Button>
</Box>
</>
)
Expand Down

0 comments on commit ad78469

Please sign in to comment.