-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add #49 Add BDD test for privacy dashboard feature
- Loading branch information
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
from behave import * | ||
import requests | ||
import json | ||
|
||
@when("the admin views the deployed privacy dashboard information") | ||
def views_privacy_dashboard(context): | ||
base_url = context.config.userdata.get("base_url") | ||
headers = {"Authorization": f"Bearer {context.access_token}"} | ||
url = base_url + "/config/privacy-dashboard" | ||
response = requests.get(url, verify=False, headers=headers) | ||
context.response = response | ||
|
||
|
||
@then("the admin should see the current deployed privacy dashboard version, domain URL, and deployment status") | ||
def sees_privacy_dashboard(context): | ||
response_json = json.loads(context.response.content) | ||
assert context.response.status_code == 200 | ||
version = response_json["version"] | ||
hostname = response_json["hostname"] | ||
status = response_json["statusStr"] | ||
assert version == "v1.0.0" | ||
assert hostname == "retail-staging-privacy.igrant.io" | ||
assert status == "Deployed" | ||
|
||
|
||
@given("Consent BB is in single tenant mode") | ||
def step_impl(context): | ||
pass | ||
|
||
|
||
@when("the admin checks the configuration of the privacy dashboard") | ||
def step_impl(context): | ||
base_url = context.config.userdata.get("base_url") | ||
headers = {"Authorization": f"Bearer {context.access_token}"} | ||
url = base_url + "/config/privacy-dashboard" | ||
response = requests.get(url, verify=False, headers=headers) | ||
context.response = response | ||
|
||
|
||
@then(u'the "Configure" button should be disabled') | ||
def step_impl(context): | ||
pass |