Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add example assurance test #1022

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Add example assurance test #1022

wants to merge 7 commits into from

Conversation

jonsnyder
Copy link
Contributor

Description

This adds a call to get a token and start an assurance session for tests that need it. Then you can read the logs and find the one you are interested in.

  • This is implemented as a Request Hook. Call createAssuranceRequestHook inside a functional test, then call t.addRequestHooks with the new request hook.
  • This will create or use the current assurance session (One session per test run)
  • When there is a request to experience edge, the request hook will add the assurance session id header to the request. It also keeps track of that request id and buckets all the assurance events that were logged for that request.
  • You can then look for a specific log by calling assuranceRequestHook.find() with a predicate. This will wait up to 5 seconds for a log matching the predicate.
  • Then you can run assertions on the event that you found.
  • To debug and see all the requests, you can wait 5 seconds for all the events to be recorded, then call fetchMore on the requestHook so that all the events all fetched. Then call debug on one of the requests to log all the events.

Related Issue

Motivation and Context

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improvement (non-breaking change which does not add functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA or I'm an Adobe employee.
  • I have made any necessary test changes and all tests pass.
  • I have run the Sandbox successfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants