Add command for adding timelog as TEST_USER3

This commit is contained in:
Amanda Hämynen
2026-04-09 12:38:05 +03:00
parent ecfffc1606
commit 0b7c6b915f
+24
View File
@@ -849,6 +849,30 @@ Cypress.Commands.add('addTimelogEntry', (timeLogEntryData) => {
})
})
Cypress.Commands.add('addTimelogEntryAlt', (timeLogEntryData) => {
withLoggedRegisteredUserTokenAlt((token) => {
const authHeaders = {
Authorization: 'Bearer ' + token
}
const { studentNumber, sprint, date, minutes, description, tags, groupId } = timeLogEntryData
cy.request({
url: '/api/timelogs',
method: 'POST',
headers: authHeaders,
body: {
studentNumber,
sprint,
date,
minutes,
description,
tags,
groupId
}
})
})
})
/* DELETE ALL TIMELOGS FOR TESTING */
Cypress.Commands.add('deleteAllTimelogs', () => {