|
| 1 | +describe('Mob.sh Timer', () => { |
| 2 | + const roomId = 'testroom-310a9c47-515c-4ad7-a229-ae8efbab7387'; |
| 3 | + |
| 4 | + it('index page is available', () => { |
| 5 | + cy.visit('https://timer.mob.sh') |
| 6 | + cy.contains('Mob Timer') |
| 7 | + }) |
| 8 | + |
| 9 | + it('room page is available', () => { |
| 10 | + cy.visit('https://timer.mob.sh/' + roomId) |
| 11 | + cy.contains('#' + roomId) |
| 12 | + }) |
| 13 | + |
| 14 | + it('help page is available', () => { |
| 15 | + cy.visit('https://timer.mob.sh/help' + roomId) |
| 16 | + cy.contains('Help') |
| 17 | + }) |
| 18 | + |
| 19 | + it('stats page is available', () => { |
| 20 | + cy.visit('https://timer.mob.sh/help' + roomId) |
| 21 | + cy.contains('Help') |
| 22 | + }) |
| 23 | + |
| 24 | + it('mob timer works', () => { |
| 25 | + cy.visit('https://timer.mob.sh/' + roomId) |
| 26 | + cy.get('[data-bs-toggle="modal"]').click() |
| 27 | + cy.get('#timer-input').clear().type("1") |
| 28 | + cy.wait(100) |
| 29 | + cy.get('.btn-close').click() |
| 30 | + cy.get('#timer-button').contains(1).click() |
| 31 | + cy.get('#timer').should('not.contain', '00:00') |
| 32 | + cy.get('#timer-type').should('not.contain', '☕') |
| 33 | + }) |
| 34 | + |
| 35 | + it('break timer works', () => { |
| 36 | + cy.visit('https://timer.mob.sh/' + roomId) |
| 37 | + cy.get('[data-bs-toggle="modal"]').click() |
| 38 | + cy.get('#breaktimer-input').clear().type("1") |
| 39 | + cy.wait(100) |
| 40 | + cy.get('.btn-close').click() |
| 41 | + cy.get('#breaktimer-button').contains(1).click() |
| 42 | + cy.get('#timer').should('not.contain', '00:00') |
| 43 | + cy.get('#timer-type').contains('☕') |
| 44 | + }) |
| 45 | + |
| 46 | + it('history increases for timer button', () => { |
| 47 | + cy.visit('https://timer.mob.sh/' + roomId) |
| 48 | + cy.get('[data-bs-toggle="modal"]').click() |
| 49 | + cy.get('#timer-input').clear().type("1") |
| 50 | + cy.wait(100) |
| 51 | + cy.get('.btn-close').click() |
| 52 | + let initialHistoryCountChainer = cy.get('#history-container').find('li').its('length') |
| 53 | + cy.get('#timer-button').contains(1).click().wait(100) |
| 54 | + cy.get('#history-container').find('li').its('length').then(currentCount => { |
| 55 | + initialHistoryCountChainer.should('eq', currentCount - 1) |
| 56 | + }) |
| 57 | + }) |
| 58 | + |
| 59 | + it('history increases for breaktimer button', () => { |
| 60 | + cy.visit('https://timer.mob.sh/' + roomId) |
| 61 | + cy.get('[data-bs-toggle="modal"]').click() |
| 62 | + cy.get('#breaktimer-input').clear().type("1") |
| 63 | + cy.wait(100) |
| 64 | + cy.get('.btn-close').click() |
| 65 | + let initialHistoryCountChainer = cy.get('#history-container').find('li').its('length') |
| 66 | + cy.get('#breaktimer-button').contains(1).click().wait(100) |
| 67 | + cy.get('#history-container').find('li').its('length').then(currentCount => { |
| 68 | + initialHistoryCountChainer.should('eq', currentCount - 1) |
| 69 | + }) |
| 70 | + }) |
| 71 | +}) |
0 commit comments