Skip to content

Commit 9bf7a4a

Browse files
bjlaadependabot[bot]paulsoucheClemogincubateur-ademe-admin
authored
🔖 Release 2.33.0 (#1307)
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Benjamin Arias <12382534+bjlaa@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Paul Souche <paul@bettercallpaul.fr> Co-authored-by: Clément <55186402+Clemog@users.noreply.github.com> Co-authored-by: Clément <clem.auger@hotmail.fr> Co-authored-by: Bot Incubateur Ademe <153178900+incubateur-ademe-admin@users.noreply.github.com>
1 parent 460a6f8 commit 9bf7a4a

File tree

72 files changed

+918
-1163
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+918
-1163
lines changed

‎.github/workflows/e2e.yaml‎

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ on:
44
push:
55
branches:
66
- preprod
7+
workflow_dispatch:
8+
inputs:
9+
branch:
10+
description: 'Branch to test'
11+
required: true
12+
type: string
713

814
jobs:
915
e2e:
@@ -19,16 +25,41 @@ jobs:
1925
- name: Install dependencies
2026
run: yarn install
2127

28+
# - name: Generate E2E test specs from personas
29+
# run: yarn e2e:generate
30+
2231
- name: Get PR number for non-main/preprod branches
23-
if: ${{ github.event.inputs.branch != 'main' && github.event.inputs.branch != 'preprod' }}
32+
if: ${{ (github.event_name == 'workflow_dispatch' && github.event.inputs.branch != 'preprod') || (github.event_name == 'push' && github.ref != 'refs/heads/preprod') || (github.event_name == 'pull_request' && github.head_ref != 'preprod') }}
2433
id: pr
2534
uses: actions/github-script@v7
2635
with:
2736
script: |
37+
// For workflow_dispatch events, we need to find the PR for the specified branch
38+
if (context.eventName === 'workflow_dispatch') {
39+
const prs = await github.rest.pulls.list({
40+
owner: context.repo.owner,
41+
repo: context.repo.repo,
42+
head: context.repo.owner + ':' + '${{ github.event.inputs.branch }}',
43+
sort: 'created',
44+
direction: 'desc'
45+
});
46+
if (prs.data.length > 0) {
47+
return prs.data[0].number;
48+
}
49+
return '';
50+
}
51+
// For pull_request events, we can get the PR number directly
52+
if (context.payload.pull_request) {
53+
return context.payload.pull_request.number;
54+
}
55+
// Fallback: try to find PR by current branch
56+
const currentBranch = context.ref.replace('refs/heads/', '');
2857
const prs = await github.rest.pulls.list({
2958
owner: context.repo.owner,
3059
repo: context.repo.repo,
31-
head: context.repo.owner + ':' + '${{ github.event.inputs.branch }}'
60+
head: context.repo.owner + ':' + currentBranch,
61+
sort: 'created',
62+
direction: 'desc'
3263
});
3364
if (prs.data.length > 0) {
3465
return prs.data[0].number;
@@ -38,9 +69,9 @@ jobs:
3869
- name: Set test URL
3970
id: set-url
4071
run: |
41-
if [ "${{ github.event.inputs.branch }}" = "main" ]; then
42-
echo "TEST_URL=https://nosgestesclimat.fr" >> $GITHUB_ENV
43-
elif [ "${{ github.event.inputs.branch }}" = "preprod" ]; then
72+
if [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ "${{ github.event.inputs.branch }}" = "preprod" ]; then
73+
echo "TEST_URL=https://preprod.nosgestesclimat.fr" >> $GITHUB_ENV
74+
elif [ "${{ github.event_name }}" = "push" ] && [ "${{ github.ref }}" = "refs/heads/preprod" ]; then
4475
echo "TEST_URL=https://preprod.nosgestesclimat.fr" >> $GITHUB_ENV
4576
else
4677
PR_NUMBER=${{ steps.pr.outputs.result }}

‎.github/workflows/iframe-healthcheck.yaml‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ permissions:
55
on:
66
schedule:
77
- cron: '0 5 * * *' # Runs at 5:00 AM UTC
8-
- cron: '0 14 * * *' # Runs at 2:00 PM UTC
9-
- cron: '0 17 * * *' # Runs at 5:00 PM UTC
108
workflow_dispatch:
119
inputs:
1210
branch:

‎.gitignore‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,3 @@ coverage
6868
.husky/pre-push-custom
6969

7070
*.log
71-

‎cypress/constants/elements-ids.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,6 @@ export const ORGANISATION_PAGE_SEE_PARAMETERS_BUTTON =
4747
'organisation-page-see-parameters-button'
4848
export const ORGANISATION_ADMINISTRATOR_POSITION_INPUT =
4949
'organisation-administrator-position-input'
50-
export const CAR_OPTION_20_000_KM = 'suggestion-20000'
50+
export const CAR_TYPE_INPUT =
51+
'transport . voiture . utilisateur-propriétaire-label'
5152
export const QUESTION_LABEL = 'question-label'

‎cypress/e2e/integration/accessibility/static-pages.cy.js‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import 'cypress-axe'
22
import { checkA11y } from '../../../helpers/accessibility/checkA11y'
3+
import { dismissCookieBanner } from '../../../helpers/cookies/dismissCookieBanner'
4+
import { visit } from '../../../helpers/interactions/visit'
35

46
// Define the pages to test
57
const staticPagesToTest = [
@@ -42,21 +44,26 @@ describe('Accessibility Tests', () => {
4244
cy.viewport('iphone-6')
4345

4446
// Visit the page
45-
cy.visit(page)
47+
visit(page)
4648

4749
// Wait for the page to load completely
4850
cy.wait(800)
4951
cy.injectAxe()
5052

5153
// Run accessibility checks
5254
checkA11y()
55+
56+
dismissCookieBanner()
57+
58+
// Run accessibility checks after dismissing the cookie banner
59+
checkA11y()
5360
})
5461

5562
it(`Should have no accessibility violations on ${page} on desktop`, () => {
5663
cy.intercept({ resourceType: /xhr|fetch|uncaught/ }, { log: false })
5764

5865
// Visit the page
59-
cy.visit(page)
66+
visit(page)
6067

6168
// Wait for the page to load completely
6269
cy.wait(800)

‎cypress/e2e/integration/features/i18n-middleware.cy.js‎

Lines changed: 0 additions & 113 deletions
This file was deleted.

‎cypress/e2e/integration/features/lang-search-params.cy.js‎

Lines changed: 0 additions & 45 deletions
This file was deleted.

‎cypress/e2e/integration/features/load-simulation-from-sid-parameter.cy.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {
22
BACK_BUTTON,
3-
CAR_OPTION_20_000_KM,
3+
CAR_TYPE_INPUT,
44
QUESTION_LABEL,
55
SAVE_MODAL_EMAIL_INPUT,
66
SAVE_MODAL_SUBMIT_BUTTON,
@@ -34,7 +34,7 @@ describe('Loading the simulation from the sid parameter', () => {
3434
initialValue = text
3535
})
3636

37-
click(CAR_OPTION_20_000_KM)
37+
click(CAR_TYPE_INPUT)
3838
clickNextButton()
3939
click(BACK_BUTTON)
4040

@@ -52,7 +52,7 @@ describe('Loading the simulation from the sid parameter', () => {
5252
beforeEach(() => {
5353
cy.clearLocalStorage()
5454

55-
cy.visit(`/simulateur/bilan?sid=${simulationId}`)
55+
visit(`/simulateur/bilan?sid=${simulationId}`)
5656
})
5757

5858
it('then it should load the simulation with the correct total footprint number', () => {

‎cypress/e2e/integration/pages/404.cy.js‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { visit } from '../../../helpers/interactions/visit'
2+
13
describe('404 Page', () => {
24
it('should display 404 page when accessing non-existent URL', () => {
35
// Intercept and handle the Next.js not found error
@@ -8,10 +10,10 @@ describe('404 Page', () => {
810
})
911

1012
// Visit a URL that definitely doesn't exist
11-
cy.visit('/definitely-not-a-page-url', { failOnStatusCode: false })
13+
visit('/definitely-not-a-page-url', { failOnStatusCode: false })
1214

1315
// Verify that we're on the 404 page
14-
cy.url().should('include', '/definitely-not-a-page-url')
16+
cy.url().should('include', '/404')
1517

1618
// Check for common 404 page elements
1719
cy.get('h1').should('exist')

‎cypress/e2e/integration/pages/actions.cy.js‎

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import 'cypress-axe'
2-
import { skipTutoIfExists } from '../../../helpers/elements/buttons'
2+
import { dismissCookieBanner } from '../../../helpers/cookies/dismissCookieBanner'
3+
import { visit } from '../../../helpers/interactions/visit'
34
import { recursivelyFillSimulation } from '../../../helpers/simulation/recursivelyFillSimulation'
45
import { setupSimulation } from '../../../helpers/simulation/setupSimulation'
56

@@ -15,34 +16,36 @@ describe('Action userflow', () => {
1516
cy.intercept({ resourceType: /xhr|fetch|uncaught/ }, { log: false })
1617

1718
// Actions when user hasn't completed the simulation
18-
cy.visit('/actions')
19+
visit('/actions')
1920

2021
cy.wait(2000)
2122

23+
dismissCookieBanner()
24+
2225
cy.get('h1')
2326
.contains(
2427
Cypress.env('testLangURL') === 'en' ? 'My gestures' : 'Mes gestes'
2528
)
2629
.should('be.visible')
2730

28-
// checkA11y() // TODO: fix A11Y test breaking only when running on CI
29-
3031
// Actions when user has completed the simulation
31-
cy.visit('/')
32+
visit('/')
3233

3334
setupSimulation()
3435

3536
recursivelyFillSimulation()
3637

37-
skipTutoIfExists()
38-
3938
cy.wait(4000)
4039

41-
cy.visit('/actions')
40+
visit('/actions')
4241

4342
cy.wait(2000)
4443

45-
// checkA11y() // TODO: fix A11Y test breaking only when running on CI
44+
cy.get('h1')
45+
.contains(
46+
Cypress.env('testLangURL') === 'en' ? 'My gestures' : 'Mes gestes'
47+
)
48+
.should('be.visible')
4649
})
4750
})
4851
})

0 commit comments

Comments
 (0)