Skip to content

CSCfi/exam

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

EXAM Quickstart for developers

  1. Prerequisites: install SBT, Java (11), Node (>= 14) and PostgreSQL (>= 9.4).

  2. Create PostgreSQL database

    $ createuser -SPRD sitnet
    $ createdb sitnet --owner=sitnet
    

    For tests

    $ createdb sitnet_test --owner=sitnet
    

    For protractor

    $ createdb sitnet_protractor --owner=sitnet
    

    Requires that you have pg_hba.conf set up to accept local connections etc.
    Note that you can configure database related parameters (and others) in the dev config file (conf/dev.conf)

  3. Get frontend dependencies

    $ cd ui
    $ npm install       
    
  4. Start sbt console

    $ cd ..
    $ sbt -Dconfig.file=conf/dev.conf -jvm-debug 9999
    

    This opens up a debug port at 9999 and starts up webpack dev server at 8080. You can run webpack server independent of sbt by passing the following build parameter

    $ sbt -Dconfig.file=conf/dev.conf -DwithoutWebpackServer=true
    

    in which case you can manage the server yourself in a separate terminal like this

    $ cd ui
    $ npm start    
    
  5. Inside sbt console start the app

    [exam] $ run
    
  6. Open http://localhost:9000 in your browser Accept the database migrations in case you see a prompt.

Skipping Karma and Protractor tests

You can skip running UI tests by passing the following build parameter

$ sbt -Dconfig.file=conf/dev.conf -DskipUiTests=true

in which case the tests will not be executed after starting the app.

Running Protractor tests with SBT

You can run protractor tests with sbt build using following command:

$sbt run -Dconfig.resource=protractor.conf

Passing parameters to protractor

You can pass parameters to protractor using protractor.args property. Passing multiple protractor parameters use comma (,) to separate parameters.

-Dprotractor.args=--capabilities.browserName=firefox,--troubleshoot

For example running specific test spec only:

$sbt run -Dconfig.resource=protractor.conf -Dprotractor.args=--specs=protractor/e2e/teacher-exam-spec.js

Running Protractor tests in CI

Using CI specific protractor configuration.

$sbt run -Dconfig.resource=protractor.conf -Dprotractor.config=ciConf.js

More information

For more information see official installation instructions (in Finnish only)