Skip to content

Commit

Permalink
Fix few cypress tests
Browse files Browse the repository at this point in the history
  • Loading branch information
louptheron committed Jan 25, 2024
1 parent d45dc5a commit 287033a
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,9 @@ jobs:
run: npm ci
working-directory: ./frontend

- name: Install Firefox
run: npx puppeteer browsers install firefox

- name: Run multi-windows tests
run: npm run test:multi-windows:run
working-directory: ./frontend
Expand Down
15 changes: 12 additions & 3 deletions frontend/cypress/e2e/side_window/mission_form/land_control.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,10 +304,20 @@ context('Side Window > Mission Form > Land Control', () => {
it('Should fill the mission zone from the last land control added', () => {
const now = getUtcDateInMultipleFormats()

cy.intercept('POST', '/api/v1/mission', {
cy.intercept('POST', '/api/v1/missions', {
body: {
id: 1
},
statusCode: 201
}).as('createMission')

cy.intercept('POST', '/api/v1/missions/1', {
body: {
id: 1
},
statusCode: 201
}).as('updateMission')

cy.intercept('POST', '/bff/v1/mission_actions', {
statusCode: 201
}).as('createMissionAction')
Expand Down Expand Up @@ -371,7 +381,7 @@ context('Side Window > Mission Form > Land Control', () => {
// Request

cy.waitForLastRequest(
'@createMission',
'@updateMission',
{
body: {
controlUnits: [
Expand Down Expand Up @@ -466,7 +476,6 @@ context('Side Window > Mission Form > Land Control', () => {
isClosed: false,
isGeometryComputedFromControls: true,
isUnderJdp: true,
isValid: true,
missionSource: 'MONITORFISH',
missionTypes: ['LAND']
}
Expand Down
15 changes: 12 additions & 3 deletions frontend/cypress/e2e/side_window/mission_form/sea_control.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -524,10 +524,20 @@ context('Side Window > Mission Form > Sea Control', () => {
cy.clickButton('Ajouter un contrôle en mer')

const now = getUtcDateInMultipleFormats()
cy.intercept('POST', '/api/v1/mission', {
cy.intercept('POST', '/api/v1/missions', {
body: {
id: 1
},
statusCode: 201
}).as('createMission')

cy.intercept('POST', '/api/v1/missions/1', {
body: {
id: 1
},
statusCode: 201
}).as('updateMission')

cy.intercept('POST', '/bff/v1/mission_actions', {
statusCode: 201
}).as('createMissionAction')
Expand Down Expand Up @@ -588,7 +598,7 @@ context('Side Window > Mission Form > Sea Control', () => {
// Request

cy.waitForLastRequest(
'@createMission',
'@updateMission',
{
body: {
controlUnits: [
Expand Down Expand Up @@ -683,7 +693,6 @@ context('Side Window > Mission Form > Sea Control', () => {
isClosed: false,
isGeometryComputedFromControls: true,
isUnderJdp: true,
isValid: true,
missionSource: 'MONITORFISH',
missionTypes: ['SEA']
}
Expand Down
1 change: 1 addition & 0 deletions frontend/cypress/e2e/side_window/mission_form/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,6 @@ export const fillSideWindowMissionFormBase = (

cy.fill('Administration 1', 'DDTM')
cy.fill('Unité 1', 'Cultures marines – DDTM 40')
cy.wait(500)
cy.fill('Moyen 1', ['Semi-rigide 2'])
}

0 comments on commit 287033a

Please sign in to comment.