Files
isop-mirror/frontend/cypress/e2e/admin/internships/downloads.cy.ts
br0kenpixel 43b056f412
Some checks failed
Cypress E2E Tests / cypress-tests (push) Has been cancelled
fix: broken cypress tests due to new internship list view
2025-12-04 12:46:10 +01:00

37 lines
1.1 KiB
TypeScript

describe('Admin Student Document Downloads', () => {
beforeEach(() => {
cy.visit('/login')
cy.wait(1000)
cy.get('input[type="email"]').type('test@example.com')
cy.get('input[type="password"]').type('password')
cy.get('button[type="submit"]').click()
cy.wait(1000)
cy.contains("Praxe").click()
cy.url().should('include', '/dashboard/admin/internships')
cy.wait(2000)
})
it('should be able to generate and download the default proof', () => {
cy.get('table').within(() => {
cy.get('tbody tr')
.then(rows => {
const count = rows.length
const randomIndex = Math.floor(Math.random() * count)
cy.wrap(rows[randomIndex]).as('randomRow')
})
cy.get('@randomRow').within(() => {
cy.get('td').get('.internship-edit-btn').click()
})
})
cy.url().should('include', '/dashboard/admin/internships/edit/')
cy.contains('Stiahnuť originálnu zmluvu').click()
cy.wait(2000)
})
})