Coder Social home page Coder Social logo

ziadbz / fr.openfisca.org Goto Github PK

View Code? Open in Web Editor NEW

This project forked from openfisca/fr.openfisca.org

0.0 1.0 0.0 3.29 MB

Le site web d'OpenFisca-France. / OpenFisca-France web site.

License: GNU Affero General Public License v3.0

JavaScript 98.10% Shell 1.90%

fr.openfisca.org's Introduction

fr.openfisca.org

[FR] Introduction

OpenFisca est un logiciel libre de micro-simulation. Ceci est le code source du site web de la communauté traitant du modèle socio-fiscal français.

[EN] Introduction

OpenFisca is a versatile microsimulation free software. This is the source code of the web site for the community working on the french tax and benefit system.

Install

This project uses Node.js, Next.js and React.

To install this project's dependencies, go to its directory and run:

npm install

Run

  • To run the website locally in a development mode, call:
npm run dev
# Expected result example:
# DONE  Compiled successfully in 2285ms                                 10:22:29 PM
# > Ready on http://localhost:3000
  • To run the website in a production mode, build it then start it with:
npm run build
# Expected result example:
# > next build

npm start
# Expected result example:
# > next start
# > Ready on http://localhost:3000

Learn more about the server's production configuration for fr.openfisca.org on the openfisca-ops repository.

🎉 In your browser, the website is available at this address: http://localhost:3000

Integration tests

This code uses Watai framework for integration testing.

Install integration tests environment

To run the tests with Watai, we need the Java JRE and a Selenium standalone server.

Install Java JRE

Check if a Java Runtime Environment (JRE) is already installed on your environment with:

java -version
# Expected answer example: java version "1.8.0_40"

If you get an error, download Java last JRE version on the Oracle website.

Install Selenium

Download the standalone Selenium server on the official website.

Your download result is a Java .jar file (e.g., selenium-server-standalone-3.4.0.jar)

Move this file to the desired directory. In this example, we will save it to: /opt/local/lib/selenium

And register the jar full path in $SELENIUM environment variable:

export SELENIUM=/opt/local/lib/selenium/selenium-server-standalone-3.4.0.jar

To test your installation, run:

java -jar $SELENIUM
# Expected answer example:
# 15:26:11.981 INFO - Selenium build info: version: '3.4.0', revision: 'unknown'
# 15:26:11.982 INFO - Launching a standalone Selenium Server
# (...)
# 15:26:12.323 INFO - Selenium Server is up and running

Then, end it with Ctrl-C.

Select testing browser

To run the integration tests locally, you need a testing browser. Default configuration in this project uses Chrome browser.

If you have Chrome, install chromedriver as follows:

sudo npm install --global chromedriver

This will add a chromedriver to your global environment. Its installation directory (e.g., /usr/local/lib/node_modules/chromedriver) will be used in the next step.

If you don't have Chrome, update the browser name in tests/integration/config.js. E.g., for firefox:

    browser: 'firefox',

And this doesn't need further driver installation.

Link Chromedriver & Selenium

Go in the Selenium directory and add a (symbolic) link to the chrome driver:

cd `dirname $SELENIUM`
sudo ln -s /usr/local/lib/node_modules/chromedriver/lib/chromedriver/chromedriver chromedriver

Run tests

Every step is runned in a new terminal window.

  1. Terminal window #1: in fr.openfisca.org directory, run the web site in developement mode
npm run dev
# Expected answer example:
# DONE  Compiled successfully in 2276ms                                3:25:21 PM
# > Ready on http://localhost:3000
  1. Terminal window #2: run the selenium server
java -jar $SELENIUM
# Expected answer example:
# 15:26:11.981 INFO - Selenium build info: version: '3.4.0', revision: 'unknown'
# 15:26:11.982 INFO - Launching a standalone Selenium Server
# (...)
# 15:26:12.323 INFO - Selenium Server is up and running
  1. Terminal window #3: in fr.openfisca.org directory, run the integration tests (this step opens Chrome browser)
npm run test:integration
# Expected answer example:
# (...)
# ⨁  fr.openfisca.org
# ✔  L'en-tête doit présenter ce que fait OpenFisca.
# ✔  La page d'accueil doit indiquer les informations de documentation.

Tracking

fr.openfisca.org uses Matomo (formerly Piwik) to track visits. The tracking is configured in piwik.config.json. Change the information there if you are running a seperate Piwik or Matomo instance.

fr.openfisca.org's People

Contributors

sandcha avatar anna-livia avatar fpagnoux avatar morendil avatar ziadbizri avatar benjello avatar pblayo avatar guillett avatar

Watchers

Ziad Bizri avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.