-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ❇️ add tutorial to secure a firearm (#159)
* refactor: ♻️ remove swiper component and add page instead * refactor: ♻️ remove swiper component and add page instead * refactor: ♻️ refactoring StartPage * chore: ⬆️ Upgrade dependancies * feat: 🐛 Fix routing * feat: ✨ Add 2 buttons on StartPage * feat: ✨ Add new stepper to securing firearm * style: 🎨 * style: 💄 Move stepper title inline * feat: 💄 Update Basegun baseline * feat: ✨ Add tutorial content to secure a firearm * feat: 🎨 Add new identification guide * WIP identification stepper * fix: 🐛 Fix issues in routing * chore: ⬆️ Upgrade dependancies * refactor: 🎨 Replace OnboardingPage by Swiper * refactor: 🎨 * refactor: ♻️ Refactoring on page result * fix: 🎨 Improve navigation in identificationGuide * style: 💄 Add style on ResultPage * feat: ⚡ WIP : Switch to different routes for each tutorial * add test video to secure a firearm * feat: ✨ Add securing-firearm-util.js file * fix: ✅ Fix tests E2E in securing branch * split securing-firearms-utils.js in 12 specifics files * feat: ⚡ Fix selectAmmo for dummy typologies * WIP * WIP MES * upgrade dependencies * Wip MES * Add new photos and videos in several typologies * Add specific select options for revolver * Change legal category if revolver black powder * Add step 3 options for revolver * Add content and style on accordions title * wip css integration * add minified header on mobile * style: 💄 Add whole logo only on start pages * style: 💄 Add whole logo only on start pages * fix DsfrRadioButton rich image ratio * add accordion design to revolver-1873-fr * add video parts to accordion design * refactor: ♻️ Remove useless code and clean code * refactor: ♻️ Renaming components * refactor: ♻️ Add highlight bold on tutorial texts manipulations * refactor: ♻️ remove useless const identificationTutorial * wip-refacto * refactor: ♻️ improve navigation in guideSecuringFirearms * perf: ♻️ Downsize too big photos * refactoring titles styles * chore: ⬇️ Downgrade Cypress from 13.1.0 to 12.17.4 * refactor: ⚡ Make accordion tutorial only visible for revolver 1873 typology * style: 💄 add new routes names and new icons on securing tutorial * feat: ✨ add a different security message for civilians * fix: 🐛 fix tutorial display for revolver different from 1892 and 1873fr * style: 💄 add new images with focus for securing firearm * style: 💄 add new photos with circle * refactoring titles styles * refactor: ♻️ wip refactor selectOption component * fix: 🐛 fix navigation for revolver typology * refactor: ♻️ Fix refactoring selectOption component * chore: ⬆️ upgrade dependencies * [WIP] test: 🧪 tests/e2e (#176) * chore: 🔧 add start script * refactor: 🔥 remove unused code * chore: 🚨 improve eslint config * test: ✅ add new test to identificate a firearm * test: ✅ add new test to securing firearm * fix: ✅ fix errors and variable name * fix: ✅ triying to fix video loading issue * test: ✅ add new test to identificate firearm fiability * chore: ⬆️ upgrade dependencies in frontend * test: ✅ add new test to identificate revolver typology * test: ✅ add new test to identificate revolver typology * test: ✅ add new test to securing shoulder bolt rifle * test: ✅ add new test to securing old mechanism pistol * test: 🔨 add new commands for tests e2e * test: ✅ update existing tests with new commands * test: ✅ add new test for check if it's FSI or Civilians recommendations * test: ✅ update tests and files * test: ✅ update tests and files --------- Co-authored-by: Nadeige COUTHON <[email protected]> * feat: ✨ handle video in options steps (#187) * feat: ✨ handle video in options steps * style: 💄 updated revolver securing first steps video * style: 💄 updated revolver securing first steps video * style: 💄 update revolver barrel video and instructions * style: 💄 update revolver choice display * style: 💄 updated shotgun videos * test: ✅ skip fiability test --------- Co-authored-by: David Mendy <[email protected]> Co-authored-by: nutfdt <[email protected]>
- Loading branch information
1 parent
a54d74a
commit e1edd0a
Showing
208 changed files
with
6,017 additions
and
3,848 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
version: '3.8' | ||
services: | ||
backend: | ||
build: | ||
args: | ||
- http_proxy | ||
- https_proxy | ||
- no_proxy | ||
- VERSION=${TAG:-2.0} | ||
- CACERT_LOCATION | ||
context: ./backend | ||
target: ${BUILD_TARGET:-dev} | ||
container_name: basegun-backend | ||
environment: | ||
- PATH_LOGS=/app/logs | ||
- OS_USERNAME | ||
- OS_PASSWORD | ||
- OS_PROJECT_NAME | ||
- http_proxy | ||
- https_proxy | ||
- UVICORN_LOG_LEVEL=${UVICORN_LOG_LEVEL} | ||
- LOG_LEVEL=${UVICORN_LOG_LEVEL} | ||
- no_proxy | ||
- WORKSPACE=dev | ||
- REQUESTS_CA_BUNDLE=$CACERT_LOCATION | ||
image: basegun-backend:${TAG:-2.0}-dev | ||
ports: | ||
- 5000:5000 | ||
volumes: | ||
- $PWD/backend/src:/app/src | ||
- $PWD/backend/tests:/app/tests | ||
- $PWD/backend/logs:/app/logs | ||
- /app/src/weights |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# EditorConfig is awesome: https://EditorConfig.org | ||
|
||
# top-most EditorConfig file | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
describe('Firearm Fiability', () => { | ||
it.skip('should identificate firearm with high fiability', () => { | ||
cy.accueil() | ||
cy.getByDataTestid('identification') | ||
.contains('J’ai déjà mis mon arme en sécurité, je veux l’identifier') | ||
.click() | ||
cy.url().should('contain', '/instructions') | ||
cy.contains('h3', 'Pour un résultat optimal') | ||
cy.contains('span', 'canon vers la droite') | ||
|
||
cy.getByDataTestid('select-file').as('fileInput') | ||
cy.intercept('POST', '/api/upload').as('upload') | ||
cy.get('@fileInput').selectFile('./cypress/images/pistolet-semi-auto.jpg', { force: true }) | ||
cy.wait('@upload').then(({ response }) => { | ||
expect(response.statusCode).to.eq(200) | ||
}) | ||
cy.getByDataTestid('next-step').click() | ||
cy.url().should('contain', '/guide-identification/informations-complementaires') | ||
cy.getByDataTestid('explanation').should('contain', 'questions supplémentaires') | ||
cy.getByDataTestid('next-step').click() | ||
cy.url().should('contain', '/guide-identification/munition-type') | ||
cy.getByDataTestid('next-step').should('have.attr', 'disabled') | ||
cy.contains('cartouches').first().click() | ||
cy.getByDataTestid('next-step').should('not.have.attr', 'disabled') | ||
cy.getByDataTestid('next-step').click() | ||
cy.url().should('contain', '/guide-identification/resultat-final') | ||
cy.getByDataTestid('arm-category').should('contain', 'Catégorie B') | ||
cy.getByDataTestid('arm-category').should(() => { | ||
expect(localStorage.getItem('confidenceLevel')).to.eq('"high"') | ||
}) | ||
}) | ||
|
||
it.skip('should identificate firearm with medium fiability', () => { | ||
cy.accueil() | ||
cy.getByDataTestid('identification') | ||
.contains('J’ai déjà mis mon arme en sécurité, je veux l’identifier') | ||
.click() | ||
cy.url().should('contain', '/instructions') | ||
cy.contains('h3', 'Pour un résultat optimal') | ||
cy.contains('span', 'canon vers la droite') | ||
|
||
cy.getByDataTestid('select-file').as('fileInput') | ||
cy.intercept('POST', '/api/upload').as('upload') | ||
cy.get('@fileInput').selectFile('./cypress/images/arme-medium.jpg', { force: true }) | ||
cy.wait('@upload').then(({ response }) => { | ||
expect(response.statusCode).to.eq(200) | ||
}) | ||
cy.url().should('contain', '/guide-identification/resultat-typologie') | ||
cy.contains('p', 'Arme semi-automatique ou automatique') | ||
cy.get('h2').should(() => { | ||
expect(localStorage.getItem('confidenceLevel')).to.eq('"medium"') | ||
}) | ||
}) | ||
|
||
it.skip('should identificate firearm with low fiability', () => { | ||
cy.accueil() | ||
cy.getByDataTestid('identification') | ||
.contains('J’ai déjà mis mon arme en sécurité, je veux l’identifier') | ||
.click() | ||
cy.url().should('contain', '/instructions') | ||
cy.contains('h3', 'Pour un résultat optimal') | ||
cy.contains('span', 'canon vers la droite') | ||
|
||
cy.getByDataTestid('select-file').as('fileInput') | ||
cy.intercept('POST', '/api/upload').as('upload') | ||
cy.get('@fileInput').selectFile('./cypress/images/arme-low.jpg', { force: true }) | ||
cy.wait('@upload').then(({ response }) => { | ||
expect(response.statusCode).to.eq(200) | ||
}) | ||
cy.url().should('contain', '/guide-identification/resultat-typologie') | ||
cy.contains('p', 'Catégorie Non déterminée') | ||
cy.get('h2').should(() => { | ||
expect(localStorage.getItem('confidenceLevel')).to.eq('"low"') | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
describe('Firearm Identification', () => { | ||
it('should identificate real firearm', () => { | ||
cy.accueil() | ||
cy.getByDataTestid('identification') | ||
.contains('J’ai déjà mis mon arme en sécurité, je veux l’identifier') | ||
.click() | ||
cy.url().should('contain', '/instructions') | ||
cy.contains('h3', 'Pour un résultat optimal') | ||
cy.contains('span', 'canon vers la droite') | ||
|
||
cy.getByDataTestid('select-file').as('fileInput') | ||
cy.intercept('POST', '/api/upload').as('upload') | ||
cy.get('@fileInput').selectFile('./cypress/images/pistolet-semi-auto.jpg', { force: true }) | ||
cy.wait('@upload').then(({ response }) => { | ||
expect(response.statusCode).to.eq(200) | ||
}) | ||
cy.getByDataTestid('next-step').click() | ||
cy.url().should('contain', '/guide-identification/informations-complementaires') | ||
cy.getByDataTestid('explanation').should('contain', 'questions supplémentaires') | ||
cy.getByDataTestid('next-step').click() | ||
cy.url().should('contain', '/guide-identification/munition-type') | ||
cy.getByDataTestid('next-step').should('have.attr', 'disabled') | ||
cy.contains('cartouches').first().click() | ||
cy.getByDataTestid('next-step').should('not.have.attr', 'disabled') | ||
cy.getByDataTestid('next-step').click() | ||
cy.url().should('contain', '/guide-identification/resultat-final') | ||
cy.getByDataTestid('arm-category').should('contain', 'Catégorie B') | ||
cy.getByDataTestid('return-to-home-end').click() | ||
cy.url().should('contain', '/accueil') | ||
}) | ||
|
||
it('should identificate dummy firearm', () => { | ||
cy.accueil() | ||
cy.getByDataTestid('identification') | ||
.contains('J’ai déjà mis mon arme en sécurité, je veux l’identifier') | ||
.click() | ||
cy.url().should('contain', '/instructions') | ||
cy.contains('h3', 'Pour un résultat optimal') | ||
cy.contains('span', 'canon vers la droite') | ||
|
||
cy.getByDataTestid('select-file').as('fileInput') | ||
cy.intercept('POST', '/api/upload').as('upload') | ||
cy.get('@fileInput').selectFile('./cypress/images/pistolet-semi-auto.jpg', { force: true }) | ||
cy.wait('@upload').then(({ response }) => { | ||
expect(response.statusCode).to.eq(200) | ||
}) | ||
cy.getByDataTestid('next-step').click() | ||
cy.url().should('contain', '/guide-identification/informations-complementaires') | ||
cy.getByDataTestid('explanation').should('contain', 'questions supplémentaires') | ||
cy.getByDataTestid('next-step').click() | ||
cy.getByDataTestid('next-step').should('have.attr', 'disabled') | ||
cy.contains('billes').first().click() | ||
cy.url().should('contain', '/guide-identification/munition-type') | ||
cy.getByDataTestid('next-step').should('not.have.attr', 'disabled') | ||
cy.getByDataTestid('next-step').click() | ||
cy.url().should('contain', '/guide-identification/resultat-final') | ||
cy.getByDataTestid('arm-category').should('contain', 'Catégorie Non Classée') | ||
cy.getByDataTestid('return-to-home-end').click() | ||
cy.url().should('contain', '/accueil') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
describe('Securing Firearm and Identification', () => { | ||
it('should secure and identificate real firearm', () => { | ||
cy.accueil() | ||
cy.miseEnSecurite() | ||
cy.getByDataTestid('select-file').as('fileInput') | ||
cy.intercept('POST', '/api/upload').as('upload') | ||
cy.get('@fileInput').selectFile('./cypress/images/pistolet-semi-auto.jpg', { force: true }) | ||
cy.wait('@upload').then(({ response }) => { | ||
expect(response.statusCode).to.eq(200) | ||
}) | ||
cy.url().should('contain', '/mise-en-securite-choix-option-etape/1') | ||
cy.getByDataTestid('button-next').should('have.attr', 'disabled') | ||
cy.contains('bouton pontet').first().click() | ||
cy.getByDataTestid('button-next').should('not.have.attr', 'disabled') | ||
cy.getByDataTestid('button-next').click() | ||
cy.url().should('contain', '/mise-en-securite-tutoriel') | ||
cy.getVideo() | ||
cy.contains('h2', 'Mettre en sécurité mon arme') | ||
cy.contains('li', 'Actionner la culasse') | ||
cy.getByDataTestid('button-next').click() | ||
cy.Identification() | ||
cy.contains('cartouches').first().click() | ||
cy.getByDataTestid('next-step').should('not.have.attr', 'disabled') | ||
cy.getByDataTestid('next-step').click() | ||
cy.url().should('contain', '/guide-identification/resultat-final') | ||
cy.getByDataTestid('arm-category').should('contain', 'Catégorie B') | ||
cy.getByDataTestid('return-to-home-end').click() | ||
cy.url().should('contain', '/accueil') | ||
}) | ||
}) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
describe('HomePage', () => { | ||
it('shoud visit HomePage', () => { | ||
cy.visit('/') | ||
cy.getByDataTestid('basegun-logo').should('exist') | ||
cy.contains('li', 'Basegun est une application') | ||
cy.get('.swiper-button-next').click() | ||
cy.contains('li', 'Une arme doit toujours être') | ||
cy.get('#position-button').contains('J\'ai compris').click() | ||
cy.url().should('contain', '/accueil') | ||
}) | ||
it('shoud visit HomePage', () => { | ||
cy.visit('/') | ||
cy.getByDataTestid('basegun-logo').should('exist') | ||
cy.contains('li', 'Basegun est une application') | ||
cy.get('swiper-container').shadow().find('.swiper-button-next').click() | ||
cy.contains('li', 'ne remplace en aucun cas l\'avis d\'un expert') | ||
cy.get('#agree-button').contains('J\'ai compris').click() | ||
cy.url().should('contain', '/accueil') | ||
}) | ||
|
||
it('should open Menu informations', () => { | ||
cy.visit('/') | ||
cy.getByDataTestid('header-logo').contains('Ministère') | ||
|
@@ -20,24 +20,28 @@ describe('HomePage', () => { | |
.click() | ||
cy.url() | ||
.should('contain', '/a-propos') | ||
cy.contains('p', 'Basegun est un projet') | ||
|
||
cy.get('#button-menu') | ||
.click() | ||
cy.getByRole('navigation') | ||
.contains('a', 'Mentions légales') | ||
.click() | ||
cy.url() | ||
.should('contain', '/mentions-legales') | ||
cy.contains('p', 'basegun.fr') | ||
|
||
cy.get('#button-menu') | ||
.click() | ||
cy.getByRole('navigation') | ||
.contains('a', 'Contact') | ||
.click() | ||
cy.url() | ||
.should('contain', '/contact') | ||
cy.get('.information') | ||
.should('exist') | ||
.click() | ||
cy.url().should('contain','/') | ||
}) | ||
} | ||
) | ||
cy.contains('a', '[email protected]') | ||
cy.getByRole('navigation') | ||
.contains('a', 'Important') | ||
.click({ force: true }) | ||
}) | ||
}, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
describe('Old Mechanism Pistol Securing', () => { | ||
it('should secure and identificate old mechanism pistol', () => { | ||
cy.accueil() | ||
cy.miseEnSecurite() | ||
cy.getByDataTestid('select-file').as('fileInput') | ||
cy.intercept('POST', '/api/upload').as('upload') | ||
cy.get('@fileInput').selectFile('./cypress/images/pistolet-ancien-a-percussion-monocoup.jpg', { force: true }) | ||
cy.wait('@upload').then(({ response }) => { | ||
expect(response.statusCode).to.eq(200) | ||
}) | ||
cy.pasDeGuide() | ||
cy.getByDataTestid('arm-category').should('contain', 'Catégorie D') | ||
cy.getByDataTestid('return-to-home-end').click() | ||
cy.url().should('contain', '/accueil') | ||
}) | ||
}) |
Oops, something went wrong.