Skip to content

Commit

Permalink
Use firefox and try try fix Cypress test
Browse files Browse the repository at this point in the history
  • Loading branch information
louptheron committed Oct 2, 2023
1 parent 4bd9864 commit f7c187b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
6 changes: 5 additions & 1 deletion frontend/cypress/e2e/offline/load_offline.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
context('Load offline', () => {
it('Should download tiles in the Cache API with the Service Worker', () => {
/**
* This test can't be runned as `navigator.serviceWorker` is not available in Cypress
*/
// eslint-disable-next-line mocha/no-skipped-tests
it.skip('Should download tiles in the Cache API with the Service Worker', () => {
// Given
cy.visit('/load_offline')
cy.get('*[data-cy="load-offline-downloaded-tiles"]').eq(0).contains('0 tuiles sauvegardées')
Expand Down
4 changes: 2 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"build:dev": "REACT_APP_ENV=dev npm run build",
"build:prod": "REACT_APP_ENV=prod npm run build",
"build:local": "REACT_APP_ENV=local npm run build",
"cypress:open": "cypress open --browser chromium --config-file ./config/cypress.config.ts --e2e",
"cypress:run": "cypress run --browser chromium --config-file ./config/cypress.config.ts --e2e",
"cypress:open": "cypress open --browser firefox --config-file ./config/cypress.config.ts --e2e",
"cypress:run": "cypress run --browser firefox --config-file ./config/cypress.config.ts --e2e",
"dev": "BROWSER=none DISABLE_ESLINT_PLUGIN=true sh -ac '. ../infra/configurations/frontend/.env.local; react-scripts start'",
"eject": "react-scripts eject",
"bundle-sw": "esbuild src/workers/serviceWorker.ts --bundle --outfile=public/service-worker.js",
Expand Down
9 changes: 3 additions & 6 deletions frontend/src/api/geoserver.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import GML from 'ol/format/GML'
import { REGULATION_ACTION_TYPE } from '../domain/entities/regulation'
import { HttpStatusCode } from './constants'
import { ApiError } from '../libs/ApiError'
import { getEnvironmentVariable } from './utils'

export const REGULATORY_ZONE_METADATA_ERROR_MESSAGE = 'Nous n\'avons pas pu récupérer la couche réglementaire'
const REGULATORY_ZONES_ERROR_MESSAGE = 'Nous n\'avons pas pu récupérer les zones réglementaires'
Expand All @@ -20,12 +21,8 @@ function getIrretrievableRegulatoryZoneError (e, regulatoryZone) {
return Error(`Nous n'avons pas pu récupérer la zone réglementaire ${regulatoryZone.topic}/${regulatoryZone.zone} : ${e}`)
}

export const GEOSERVER_URL = self?.env?.REACT_APP_GEOSERVER_REMOTE_URL !== '__REACT_APP_GEOSERVER_REMOTE_URL__'
? self.env.REACT_APP_GEOSERVER_REMOTE_URL
: process.env.REACT_APP_GEOSERVER_REMOTE_URL
export const GEOSERVER_BACKOFFICE_URL = self?.env?.REACT_APP_GEOSERVER_LOCAL_URL !== '__REACT_APP_GEOSERVER_LOCAL_URL__'
? self.env.REACT_APP_GEOSERVER_LOCAL_URL
: process.env.REACT_APP_GEOSERVER_LOCAL_URL
export const GEOSERVER_URL = getEnvironmentVariable('REACT_APP_GEOSERVER_REMOTE_URL')
export const GEOSERVER_BACKOFFICE_URL = getEnvironmentVariable('REACT_APP_GEOSERVER_LOCAL_URL')

/**
* @description This API isn't authenticated
Expand Down

0 comments on commit f7c187b

Please sign in to comment.