Skip to content

Commit

Permalink
πŸ› βœ… Fixed getting the file
Browse files Browse the repository at this point in the history
  • Loading branch information
dukenuken09 committed Oct 3, 2024
1 parent b258c30 commit 51b5096
Showing 1 changed file with 27 additions and 23 deletions.
50 changes: 27 additions & 23 deletions cypress/integration/modifyTariff/modifyTariff.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe('Modify Tariff', () => {
return false
})
beforeEach(() => {
cy.fixture('generalContractTerms.html').as('html')

cy.visit('/ca/contract/indexed')
cy.intercept('GET', '/ping', {
statusCode: 200,
Expand All @@ -29,43 +29,47 @@ describe('Modify Tariff', () => {
},
});

cy.intercept('POST', '/procedures/contract_indexed',{
cy.intercept('POST', '/procedures/contract_indexed', {
statusCode: 200,
body:{
data:{
body: {
data: {
status: "OK"
}
}
})

})

it('Change Tariff to indexada', function () {
cy.intercept('GET', `/static/docs/ca/general-contract-terms.html`, {
statusCode: 200,
headers: {'content-type':'text/html'},
body: this.html
}).as('generalTerms')
cy.request('/static/docs/ca/general-and-indexed-specific-terms.html')
.its('body')
.then((htmlContent) => {
cy.intercept('GET', `/static/docs/ca/general-and-indexed-specific-terms.html`, {
statusCode: 200,
headers: { 'content-type': 'text/html' },
body: htmlContent
}).as('generalTerms')

cy.get('[data-cy="next"]').click()
cy.get('[data-cy="next"]').click()

cy.get('[data-cy="next"]').click()
cy.get('[data-cy="next"]').click()

cy.get('[id=change-tarif-terms-check]').click()
cy.get('[id=change-tarif-terms-check]').click()

cy.wait('@generalTerms')
.its('response.statusCode')
.should('be.oneOf', [200, 304])
cy.wait('@generalTerms')
.its('response.statusCode')
.should('be.oneOf', [200, 304])

cy.get('[id=terms-dialog-accept-btn]').click()
cy.get('[id=terms-dialog-accept-btn]').click()

cy.get('[id=change-tariff-indexada-terms-check]').click()
cy.get('[id=change-tariff-indexada-terms-check]').click()

cy.get('[id=tariff-change-submit]').click()
cy.get('[id=tariff-change-submit]').click()

cy.get('[id=success-page-title]').should(
'contain',
SUCCESS_TITLE
)
cy.get('[id=success-page-title]').should(
'contain',
SUCCESS_TITLE
)
})
})
})

0 comments on commit 51b5096

Please sign in to comment.