A set of Capybara tests that drive a browser to do inter-system integration testing of SDR in the stage or QA environment.
The tests use Ruby 3.3.
The tests depend on having Firefox (default) or Chrome downloaded.
bundle install
bin/rake webdrivers:geckodriver:update
See the Other Configuration
section below for
- instructions on using Chrome
- tweaking default selenium browser settings.
- Connect to Stanford VPN (full-tunnel or split-tunnel)
- Ensure you have a valid, non-expired Kerberos ticket (use
klist
to verify, or runkinit
to refresh) - Set up SSH per DLSS developer best practices
- See the
Authentication Configuration
section below to set up necessary credentials:
- dor_services_app credentials
- etd credentials
By default, the integration tests run in the SDR stage environment:
bin/rspec
To test in the SDR QA environment, run tests with the SDR_ENV
environment variable, like so:
SDR_ENV=qa bin/rspec
No matter which environment you run tests in, you may be prompted to type in your Stanford credentials and will then need to approve a multi-factor authentication push. If you tire of typing in your credentials, see the Other Configuration
section below for help securely storing them.
When running the virtual_object_creation test, you can create more than two constituents by running as follows:
SETTINGS__NUMBER_OF_CONSTITUENTS=11 bin/rspec
Please use the integration-testing APO and collection when feasible:
- APO: druid:qc410yz8746 (available as
Settings.default_apo
) - Collection: druid:bc778pm9866 (available as
Settings.default_collection
)
Configure your SSH client to allow delegation of Kerberos credentials (required for any tests that use scp
), by adding the following to ~/.ssh/config
or wherever your system stores SSH configuration:
# Add to appropriate place, such as:
Host *.stanford.edu
GSSAPIDelegateCredentials yes
For the stage environment, copy config/settings.yml
to config/settings/stage.local.yml
. You will be adding stage environment specific settings here.
NOTE: config/settings/stage.local.yml
is ignored by git and should remain so. Please do not add this file to version control.
For the QA environment, copy config/settings.yml
to config/settings/qa.local.yml
. You will be adding stage environment specific settings here.
NOTE: config/settings/qa.local.yml
is ignored by git and should remain so. Please do not add this file to version control.
Some integration tests use the dor-services-client
to interact with the dor-services-app
. In order to successfully use the dor-services-client, you must first have a token. To generate dor-services-app tokens, see the dor-services-app README. You'll need to generate separate tokens for each dor-services-app environment (stage, qa), and add them to config/settings/stage.local.yml
and config/settings/qa.local.yml
. See config/settings.yml
for the expected YAML syntax.
In order to run spec/features/etd_creation_spec.rb
, you need the ETD application's backdoor username and password for HTTP POST requests. You can get these from Vault:
vault kv get puppet/application/hydra_etd/qa/username
vault kv get puppet/application/hydra_etd/qa/password
or
vault kv get puppet/application/hydra_etd/stage/username
vault kv get puppet/application/hydra_etd/stage/password
Add them to config/settings/stage.local.yml
and config/settings/qa.local.yml
respectively. See config/settings.yml
for the expected YAML syntax.
In order to run spec/features/goobi_accessioning_spec.rb
, you need the Goobi application's integration username and password to login to the UI. Get these values from Vault and add them to config/settings/stage.local.yml
.
vault kv get puppet/application/goobi/stage/username
vault kv get puppet/application/goobi/stage/password
This test cannot be run in QA, since there is no Goobi QA. So this configuration is only relevant for stage. See config/settings.yml
for the expected YAML syntax.
You may want to lower the timeout value of Settings.timeouts.post_authentication_text
in config/settings.local.yml
.
If you tire of typing in your SUNet credentials over and over, you may add them to config/settings.local.yml
(ignored by git). Copy the dummy values from config/settings.yml
to get started. Do not add this file to version control, if you do this!
bundle install
bin/rake webdrivers:chromedriver:update
- Set
browser.driver
tochrome
inconfig/settings.local.yml
If you find you need to modify the default window size for either browser---e.g., because the size is too small and causing responsive elements to disappear behind clickable menus---copy the default settings for browser.height
and browser.width
from config/settings.yml
to config/settings.local.yml
and modify them to meet your needs.
If you are experiencing timeout errors when running tests, you may override the default timeout values by adding timeouts.capybara
, timeouts.bulk_action
, and/or timeouts.workflow
in config/settings.local.yml
depending on where you see timeouts.