Files
myep/cypress/e2e/01-booking-full.cy.js
T

62 lines
2.7 KiB
JavaScript

describe('Booking test', () => {
it('Books a double room on test travel 1', () => {
cy.visit('/bookings/create/11946/157047')
cy.contains('Neue Buchung')
// await form refresh after selecting registration type
cy.intercept('POST', '/bookings/create/refresh').as('htmxRequest')
cy.get('#booking_create_step1_roomSelections_76_quantity').select('1')
cy.wait('@htmxRequest')
cy.intercept('POST', '/bookings/create').as('htmxRequest')
cy.get('[data-qa-btn-submit]').click()
cy.wait('@htmxRequest')
cy.intercept('GET', '/bookings/create/participants/0').as('htmxRequest')
cy.get('[data-qa-btn-edit-participant="0"]').click()
cy.wait('@htmxRequest')
cy.get('#booking_participant_firstName').type('Theo')
cy.get('#booking_participant_lastName').type('Test')
cy.get('#booking_participant_email').type('[email protected]')
cy.get('#booking_participant_mobile').type('1234567890')
cy.get('#booking_participant_address_street').type('Teststraße 1')
cy.get('#booking_participant_address_postCode').type('12345')
cy.get('#booking_participant_address_city').type('Testhausen')
cy.intercept('POST', '/bookings/create/participants/0/refresh').as('htmxRequest')
cy.get('#booking_participant_dateOfBirth').type('1980-11-11')
cy.get('#booking_participant_dateOfBirth').trigger('change')
cy.wait('@htmxRequest')
cy.get('#booking_participant_skiPass_0').check()
cy.intercept('POST', '/bookings/create/participants/0/refresh').as('htmxRequest')
cy.get('#booking_participant_courses_0').check()
cy.wait('@htmxRequest')
cy.intercept('POST', '/bookings/create/participants/0/refresh').as('htmxRequest')
cy.get('#booking_participant_insurance_0').check()
cy.wait('@htmxRequest')
cy.intercept('POST', '/bookings/create/participants/0/refresh').as('htmxRequest')
cy.get('#booking_participant_transportationOutbound_1').check()
cy.wait('@htmxRequest')
cy.intercept('POST', '/bookings/create/participants/0/refresh').as('htmxRequest')
cy.get('#booking_participant_transportationInbound_1').check()
cy.wait('@htmxRequest')
cy.intercept('POST', '/bookings/create/participants/0').as('htmxRequest')
cy.get('[data-qa-btn-submit]').click()
cy.wait('@htmxRequest')
cy.intercept('POST', '/bookings/create/participants').as('htmxRequest')
cy.get('[data-qa-btn-submit]').click()
cy.wait('@htmxRequest')
cy.get('[data-qa-alert-form-errors]').should('be.visible')
cy.get('[data-qa-participant-incomplete="1"]').should('be.visible')
})
})