Skip to content

Installation

tpronk edited this page Aug 19, 2021 · 7 revisions

Home - Installation


General Installation

The steps below are for any developer that would like to run tests of psychojs and/or create new tests.

A. Install this repo

  1. Clone the psychojs_testing repo to your hard drive
  2. Go to its root folder and run npm install

B. Install PsychoJS

This is required for both Karma and WebdriverIO tests.

  1. Clone and install the PsychoJS repo
  2. Create an environment variable PSYCHOJS_PATH that points to the directory you cloned PsychoJS into

C. Install PsychoPy

This is required for compiling test-experiments to PsychoJS, which you'll need if you've developed your own WebdriverIO test:

  1. Clone and install the PsychoPy repo.
  2. Create an environment variable PSYCHOPY_PATH that points to the directory you cloned PsychoPy into.

D. Install a local webserver

To perform a WebDriverIO (end-to-end) test, you'll need to host the experiments on a web-server. The easiest approach is setting up a local webserver:

  1. Install a web-server, such as WampServer for Windows (2do: guides for MacOS and Linux)
  2. Set up an alias from http://localhost/psychojs to the directory deployed_experiments in your clone of the psychojs_testing repo (for example /my_repos/psychojs_testing/deployed_experiments

E. Set up a Selenium/Appium server

To perform a WebDriverIO (end-to-end) test, you'll need a Selenium/Appium server. Installation of the psychojs_testing comes with a built-in Selenium Standalone service that includes drivers for Chrome and Firefox. If this doesn't work out-of-the-box, or if you'd like to test on Edge and Safari as well, see Setting up a Selenium or Appium server.

Additional steps for core team members

If you're part of the PsychoPy/PsychoJS core team, you can deploy your experiments to a staging server and run tests via BrowserStack. To achieve this, set up the environment variables below.

F. Staging server

You'll need the environment variables STAGING_PORT, STAGING_USERNAME, and STAGING_PASSWORD.

G, BrowserStack

  1. Store your Browserstack username in an environment variable named BROWSERSTACK_USER
  2. Store your Browserstack Automate access key (found on this page in an environment variable named BROWSERSTACK_ACCESSKEY

Clone this wiki locally