|
4 | 4 |
|
5 | 5 |
|
6 | 6 | HOSTNAME_URL = os.environ['HOSTNAME_URL'] |
| 7 | +USE_NEW_PERM_SCREEN = os.environ['USE_NEW_PERM_SCREEN'] |
7 | 8 | PROD_URL = 'https://api.bluebutton.cms.gov' |
8 | 9 | USER_ACTIVATION_PATH_FMT = "{}/v1/accounts/activation-verify/{}" |
9 | 10 |
|
@@ -126,7 +127,13 @@ class Action(Enum): |
126 | 127 | # Demographic info access grant form |
127 | 128 | BTN_ID_GRANT_DEMO_ACCESS = "approve" |
128 | 129 | BTN_ID_DENY_DEMO_ACCESS = "deny" |
129 | | -BTN_ID_RADIO_NOT_SHARE = "label:nth-child(5)" |
| 130 | +if USE_NEW_PERM_SCREEN == "true": |
| 131 | + # Below works for new auth screen |
| 132 | + BTN_ID_RADIO_NOT_SHARE = "radio_1" |
| 133 | +else: |
| 134 | + # Below works for old auth screen |
| 135 | + BTN_ID_RADIO_NOT_SHARE = "label:nth-child(5)" |
| 136 | + |
130 | 137 |
|
131 | 138 | # API versions |
132 | 139 | API_V2 = "v2" |
@@ -170,9 +177,17 @@ class Action(Enum): |
170 | 177 | CLICK_RADIO_NOT_SHARE = { |
171 | 178 | "display": "Click 'Share healthcare data, but not your personal info' on DEMO info grant form", |
172 | 179 | "action": Action.FIND_CLICK, |
| 180 | + # Below works for old auth screen |
173 | 181 | "params": [20, By.CSS_SELECTOR, BTN_ID_RADIO_NOT_SHARE] |
174 | 182 | } |
175 | 183 |
|
| 184 | +CLICK_RADIO_NOT_SHARE_NEW_PERM_SCREEN = { |
| 185 | + "display": "Click 'Share healthcare data, but not your personal info' on DEMO info grant form (NEW PERM SCREEN)", |
| 186 | + "action": Action.FIND_CLICK, |
| 187 | + # Below works for new auth screen |
| 188 | + "params": [20, By.ID, BTN_ID_RADIO_NOT_SHARE] |
| 189 | +} |
| 190 | + |
176 | 191 | CLICK_AGREE_ACCESS = { |
177 | 192 | "display": "Click 'Agree' on DEMO info grant form", |
178 | 193 | "action": Action.FIND_CLICK, |
@@ -475,6 +490,13 @@ class Action(Enum): |
475 | 490 | CLICK_RADIO_NOT_SHARE, |
476 | 491 | CLICK_AGREE_ACCESS, |
477 | 492 | {"sequence": SEQ_QUERY_FHIR_RESOURCES_NO_DEMO} |
| 493 | + ], |
| 494 | + "auth_grant_w_no_demo_new_perm_screen": [ |
| 495 | + {"sequence": SEQ_AUTHORIZE_START}, |
| 496 | + CALL_LOGIN, |
| 497 | + CLICK_RADIO_NOT_SHARE_NEW_PERM_SCREEN, |
| 498 | + CLICK_AGREE_ACCESS, |
| 499 | + {"sequence": SEQ_QUERY_FHIR_RESOURCES_NO_DEMO} |
478 | 500 | ] |
479 | 501 | } |
480 | 502 |
|
|
0 commit comments