-
Prerequisites: install SBT, Java (11), Node (>= 14) and PostgreSQL (>= 9.4).
-
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) -
Get frontend dependencies
$ cd ui $ npm install
-
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
-
Inside sbt console start the app
[exam] $ run
-
Open http://localhost:9000 in your browser Accept the database migrations in case you see a prompt.
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.
You can run protractor tests with sbt build using following command:
$sbt run -Dconfig.resource=protractor.conf
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
Using CI specific protractor configuration.
$sbt run -Dconfig.resource=protractor.conf -Dprotractor.config=ciConf.js
For more information see official installation instructions (in Finnish only)