mirror of
https://github.com/UniversityOfHelsinkiCS/ohtuilmo.git
synced 2026-10-12 19:03:41 +03:00
Add command for creating tag
This commit is contained in:
@@ -24,17 +24,8 @@ describe('Student tag page', () => {
|
||||
studentIds: ['012345698'],
|
||||
})
|
||||
cy.visit('/')
|
||||
cy.get('#hamburger-menu-button')
|
||||
.click()
|
||||
.then(() => {
|
||||
cy.contains('Tag management').click()
|
||||
})
|
||||
cy.get('#tagTitle').type('Coding')
|
||||
cy.get('.button').click()
|
||||
cy.contains('Coding').should('exist')
|
||||
cy.get('#tagTitle').type('Meeting')
|
||||
cy.get('.button').click()
|
||||
cy.contains('Meeting').should('exist')
|
||||
cy.createTag('Coding')
|
||||
cy.createTag('Meeting')
|
||||
cy.loginAsRegisteredUser()
|
||||
cy.visit('/')
|
||||
|
||||
|
||||
@@ -893,3 +893,21 @@ Cypress.Commands.add('deleteAllSprints', () => {
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
/* TAG CREATION FOR TESTING */
|
||||
|
||||
Cypress.Commands.add('createTag', (tagTitle) => {
|
||||
withLoggedAdminToken((token) => {
|
||||
const authHeaders = {
|
||||
Authorization: 'Bearer ' + token
|
||||
}
|
||||
cy.request({
|
||||
url: '/api/tags',
|
||||
method: 'POST',
|
||||
headers: authHeaders,
|
||||
body: {
|
||||
title: tagTitle
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user