OpenActive Developers
Data ValidatorDataset DashboardW3C Community Group
  • Welcome to our community
  • Publishing Data
    • Data Feeds
      • How an RPDE data feed works
      • Types of RDPE feed
      • Implementing RPDE
      • Testing RPDE feeds
      • Scaling RPDE feeds
    • Activity list references
    • Including geo coordinates
    • Schedules
    • Dataset Sites
    • Virtual Events
    • On-Demand Events
    • Opening Hours
    • Data Quality
  • Using data
    • Harvesting opportunity data
      • Large Integers in JavaScript
    • Tutorial: Consuming an RPDE feed
    • Attribution
  • Open Booking API
    • Key Decisions
    • Implementing booking
    • Testing booking
      • Configuring Test Suite
      • Implementing the Test Interface
        • Test Interface Actions
        • Create Opportunity Endpoint
      • Random Mode: Generating Test Opportunity Data
      • Running Test Suite
      • Generating the Conformance Certificate
  • Data Model
    • Data Model Overview
    • @context and JSON-LD
    • Types Reference
      • Action
      • AudioObject
      • BabyChanging
      • Barcode
      • BookingService
      • BooleanFormFieldSpecification
      • Brand
      • ChangingFacilities
      • ConceptScheme
      • Concept
      • CourseInstance
      • Course
      • Creche
      • CustomerAccount
      • DataCatalog
      • DataDownload
      • Dataset
      • DropdownFormFieldSpecification
      • DynamicPayment
      • Entitlement
      • EventSeries
      • Event
      • FacilityUse
      • FileUploadFormFieldSpecification
      • GeoCoordinates
      • HeadlineEvent
      • ImageObject
      • IndividualFacilityUse
      • InternalApplicationError
      • InternalLibraryConfigurationError
      • InternalLibraryError
      • Lease
      • LocationFeatureSpecification
      • Lockers
      • MediaObject
      • OfferOverride
      • Offer
      • OnDemandEvent
      • OpenBookingError
      • OpeningHoursSpecification
      • OrderItem
      • OrderProposal
      • OrderQuote
      • Order
      • Organization
      • ParagraphFormFieldSpecification
      • Parking
      • PartialSchedule
      • Payment
      • Person
      • Place
      • PostalAddress
      • PriceSpecification
      • PrivacyPolicy
      • PropertyValueSpecification
      • PropertyValue
      • QuantitativeValue
      • Schedule
      • ScheduledSession
      • SessionSeries
      • ShortAnswerFormFieldSpecification
      • Showers
      • Slot
      • SportsActivityLocation
      • TaxChargeSpecification
      • TermsOfUse
      • Terms
      • Toilets
      • Towels
      • VideoObject
      • VirtualLocation
      • WebAPI
  • Specifications
    • Specifications Overview
  • Useful links
    • Data Visualiser
    • Data Validator
    • Dataset Dashboard
    • Non-technical Guidance
  • OpenActive on GitHub
    • Overview
    • Activity List
    • Community
    • Controlled Vocabularies
    • Dataset Publication
    • Documentation
    • Implementation Support
    • Programmes
    • RPDE
    • SKOS
    • Specifications
    • Validators
Powered by GitBook
On this page
  • Option 1: Single console window
  • Option 2: Two separate console windows
  • Reading the test results and debugging
  • Continuous Integration
Edit on GitHub
  1. Open Booking API
  2. Testing booking

Running Test Suite

How to run your now configured Test Suite to check your booking system.

Option 1: Single console window

With your booking system running, execute the following command in the rootopenactive-test-suite directory:

npm start

This will automatically start the microservice, run the integration tests, then kill the microservice. The output from the microservice and integration tests will be combined in the console.

This mode also offers the ability to rerun the tests interactively, for specific flows, which can be useful for debugging. When running in this mode, press "esc" at any time to cancel the currently running test and return to the interactive prompt.

Individual features or tests can be run in isolation using the following commands, for example:

npm start -- --runInBand test/features/core/test-interface/
npm start -- test/features/core/test-interface/implemented/create-opportunity-test.js

The following shorthand may also be used, as these strings are unique within the path:

npm start test-interface
npm start create-opportunity-test

--runInBand limits the test suite to running all tests in series. This ensures that each test is executed one at a time, which slows down the test suite, and can be helpful when debugging issues relating to faulty transactions.

Option 2: Two separate console windows

Start the Microservice

With your booking system running, execute the following command:

npm run start-broker

This will start to harvest the feeds from your running application.

Run the Integration Tests

With both your booking system and openactive-broker-microservice running, execute the following command, to execute all configured tests:

npm run start-tests

This will execute tests against your booking system, using the openactive-broker-microservice as an intermediary.

Individual features or tests can be run in isolation using the following commands, for example:

npm run start-tests -- --runInBand test/features/core/test-interface/
npm run start-tests -- --runInBand test/features/core/test-interface/implemented/create-opportunity-test.js 

Reading the test results and debugging

The openactive-integration-tests writes log files into the ./output/ directory for each test in Markdown format, so you can see the endpoints that have been called, with both the requests sent and responses received.

A reference version of passing test results is also available for comparison, complete with full model requests and responses for each test:

Continuous Integration

For continuous integration environments, "ci": true must be included in the supplied config JSON to ensure correct console logging output. Then simply run npm start in the rootopenactive-test-suite directory. This will automatically start the microservice, run the integration tests, then kill the microservice.

This always overrides the configuration option "waitForHarvestCompletion": true , to ensure the harvester is up-to-date with the feeds before the tests begin.

PreviousRandom Mode: Generating Test Opportunity DataNextGenerating the Conformance Certificate

Last updated 1 year ago

To understand the requests and responses, please see the in the Open Booking API specification, along with the more detailed and example .

If you don't have an IDE that supports Markdown natively, use a Google Chrome extension to read the output Markdown files, as described .

A is available, and more details can be found .

You can see CI in action within the test suite itself, which against the reference implementation.

The conformance certificate generated from test suite running in CI should be deployed to the relevant location (e.g. ) and referenced from the production Dataset Site. See for more information.

explanation
sequence diagram
requests and responses
here
Output in 'Random' mode, when "useRandomOpportunities": true
Output in 'Controlled' mode, when "useRandomOpportunities": false
sample CI script
here
runs CI
via GitHub CI
here