NYU Libraries Special Collections Discovery Application recreated with Blacklight 8.x
To check out the project and stand up a local instance:
git clone git@github.com:NYULibraries/specialcollections-prototype.git
cd specialcollections-prototype
bundle install
bin/rake sc:serverThen visit http://localhost:3000
There is a growing number of fixture files in spec/fixtures/files, pulled from dlfa-188_v1-indexer-http-requests-xml.
While the dev server is running (sc:server above) you can load these fixtures by running:
bin/rake sc:loadThe Playwright service automatically runs bin/rake sc:load in a short-lived helper container before executing the browser tests. This seeds the development Solr core with the full fixture set and leaves the index populated for ad-hoc browsing afterward.
To launch the suite (and its prerequisite containers) in one step:
docker compose up playwrightAdd --build if you need to rebuild the Docker images first. The command will:
- Start Solr and the Rails app
- Run
solr-fixtures(which executesbin/rake sc:loadagainst the Solr container) - Execute the Playwright suite
Playwright test files share a Prettier + ESLint configuration scoped to the e2e workspace. Run the formatter:
yarn --cwd e2e formatUse yarn --cwd e2e lint to verify formatting and linting without modifying files.
To exercise the suite without Docker, start bin/rake sc:server in another terminal. With the app running locally, use the helper script to run the Playwright suite without reloading fixtures on every invocation:
bin/playwright-localImportant: create an .env.test file in the e2e directory with the following content so the helper points Playwright at your local app:
PLAYWRIGHT_BASE_URL=http://localhost:3000Note: if your local Rails database has pending migrations you may see an
ActiveRecord::PendingMigrationError when starting the app or running the
tests. Apply migrations before running the server or Playwright with:
bin/rails db:migrateFixtures remain in Solr between runs. When you do need a fresh load, either set PLAYWRIGHT_LOAD_FIXTURES=1 bin/playwright-local or pass --load-fixtures as the first argument before any Playwright flags.
To run Playwright in headed mode, run from root:
yarn --cwd e2e test:e2e --headedTo run the test suite:
bin/rake sc:testTo autofix any Rubocop issues, run the following:
bundle exec rubocop -aTo stand up dev against an existing instance of Solr:
SOLR_URL=http://ip-address:port/solr/findingaids bin/rails server