Skip to content

Latest commit

 

History

History
126 lines (87 loc) · 5.36 KB

TESTS.md

File metadata and controls

126 lines (87 loc) · 5.36 KB

Tests

Test the "cold start" of the Pod to Google Sheet synchronisation

Preconditions

  • Run npm run prepare:pods to prepare a local Community Solid Server.
  • Run npm run start:pods to start the local CSS.
  • Make sure correct tokens have been generated by following the authentication steps as described in README.md in sections Google Sheet API and OAuth2 tokens.
  • Copy the contents of config.query.example.yml to config.yml in the working directory. Set the id section to the id of an existing Google Sheet.
  • Copy the contents of rules.example.yml to rules.yml.

Steps

  1. Run npm start to start the synchronisation agent.
  2. Wait a couple of seconds until the initial cold start of the synchronisation process is completed.

Postconditions

  • All the RDF data on the resource should be correctly converted and displayed on the Google Sheet.

Test if changes on the Google Sheet are synced back to the Pod

Preconditions

  • Follow and execute all steps in the "cold start" test above.

Steps

  1. Change and/or delete any amount of cells in the Google Sheet. Do not delete an entire row.
  2. Wait at least the configured amount of milliseconds as configured under interval in the configuration file (default 5000).

Postconditions

  • The resource http://localhost:3000/testing/software contains the new data.

Test if changes on the Pod are synced back to the Google Sheet

Preconditions

  • Follow and execute all steps in the "cold start" test above.

Steps

The pod can be updated with the following request:

curl --location --request PATCH 'http://localhost:3000/testing/software' --header 'Content-Type: text/n3' --data-raw '@prefix solid: <http://www.w3.org/ns/solid/terms#>. @prefix software: <https://data.knows.idlab.ugent.be/person/office/software#>. @prefix schema: <http://schema.org/>. _:rename a solid:InsertDeletePatch; solid:inserts { software:test schema:name "test"; schema:description "abracadabra". }.'

When using websockets, the change should be almost immediately shown, otherwise wait at least the configured amount of milliseconds (default 5000ms).

Postconditions

  • The Google sheet contains the new data.

Test if authentication works correctly

Preconditions

  • Go to initial-pod-data/software.acl and change acl:agentClass foaf:Agent; to acl:agentClass acl:AuthenticatedAgent;. This makes the resource only accessible for authenticated Agents.
  • Make sure all dependencies have been installed by running npm i.
  • Run npm run prepare:pods to prepare a local Community Solid Server.
  • Run npm run start:pods to start the local CSS.
  • Make sure correct tokens have been generated by following the authentication steps as described in README.md in sections Google Sheet API and OAuth2 tokens.
  • Copy the contents of config.query.example.yml to config.yml in the working directory. Set the id section to the id of an existing Google Sheet.
  • Copy the contents of rules.example.yml to rules.yml.

Steps

  1. Run npm run auth to start the authentication web app.

  2. Navigate to http://localhost:8081/ (or another port if changed) in a browser.

  3. Fill in all the necessary information:

    • host server (Url of your Community Solid Server where your pod is located)
    • email for your pod
    • password for your pod

    The Solid instance that comes with this program is seeded with 1 pod by default. The default pod name is example. The email is [email protected] with password abc123. You can use these values to authenticate. For the host value, use http://localhost:3000.

  4. Press "Authenticate" under the "Solid Pod" section.

  5. Run npm start to start the synchronisation agent.

  6. Wait a couple of seconds until the initial cold start of the synchronisation process is completed.

Postconditions

If authentication was done correctly and successfully, everything should work the same as without authentication.

Test a setup using multiple sources

Preconditions

  • Make sure all dependencies have been installed by running npm i.
  • Run npm run prepare:pods to prepare a local Community Solid Server.
  • Run npm run start:pods to start the local CSS.
  • Make sure correct tokens have been generated by following the authentication steps as described in README.md in sections Google Sheet API and OAuth2 tokens.
  • Copy the contents of config.query-multiple.example.yml to config.yml in the working directory. Set the id section to the id of an existing Google Sheet.
  • Copy the contents of rules-multiple.example.yml to rules.yml.

Steps

  1. Run npm start to start the synchronisation agent.
  2. You can change the description, score, reviewDate and title of tv-shows

Postconditions

Depending on the column that you edit, the corresponding file will be changed as well. The columns description and title are stored in pods/testing/tv-shows$.ttl, score and reviewDate are stored in pods/testing/ratings$.ttl.

The other columns are the IRIs of the objects (the identifiers). You can change these but it is generally not a good idea, since new objects will be created.