Skip to content

Commit 15bb017

Browse files
authored
update expected json in end2end testing (#290)
* update expected json in end2end testing * add setup tools installation to workflow * remove duplicate installation of setuptools dependency
1 parent 160aadf commit 15bb017

2 files changed

Lines changed: 45 additions & 25 deletions

File tree

.github/workflows/azure-static-web-apps-conformance-rules-editor.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,12 @@ jobs:
8585
with:
8686
python-version: '3.12'
8787

88+
- name: Ensure setuptools is installed
89+
run: python -m pip install --upgrade "pip<25" "setuptools<82"
90+
8891
- name: Install Dependencies
8992
run: |
90-
pip install requests selenium webdriver-manager pyperclip==1.9.0 selenium-wire blinker==1.4 brotli setuptools
93+
pip install requests selenium webdriver-manager pyperclip==1.9.0 selenium-wire blinker==1.4 brotli
9194
9295
- name: Run Selenium Test on Preview
9396
env:

tests/test_rule_editor.py

Lines changed: 41 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -199,21 +199,27 @@ def save_screenshot(driver, name_prefix="screenshot"):
199199
],
200200
"FA": [
201201
{
202-
"executionStatus": "success",
202+
"executionStatus": "issue_reported",
203203
"dataset": "fa.xpt",
204204
"domain": "FA",
205-
"variables": ["$val_dy", "FADTC", "FADY", "RFSTDTC"],
205+
"variables": [
206+
"$val_dy",
207+
"FADY",
208+
"FADTC",
209+
"RFSTDTC",
210+
],
206211
"message": (
207-
"FADY is not correctly calculated even though the date portion of FADTC is complete, "
208-
"the date portion of RFSTDTC is complete, and FADY is not empty."
212+
"FADY is not correctly calculated even though the date portion of "
213+
"FADTC is complete, the date portion of RFSTDTC is complete, and "
214+
"FADY is not empty."
209215
),
210216
"errors": [
211217
{
212218
"value": {
213-
"RFSTDTC": "2012-11-15",
214219
"$val_dy": 18,
215-
"FADTC": "2012-12-02",
216220
"FADY": 35,
221+
"RFSTDTC": "2012-11-15",
222+
"FADTC": "2012-12-02",
217223
},
218224
"dataset": "fa.xpt",
219225
"row": 1,
@@ -222,10 +228,10 @@ def save_screenshot(driver, name_prefix="screenshot"):
222228
},
223229
{
224230
"value": {
225-
"RFSTDTC": "2013-10-08",
226231
"$val_dy": 5,
227-
"FADTC": "2013-10-12",
228232
"FADY": 3,
233+
"RFSTDTC": "2013-10-08",
234+
"FADTC": "2013-10-12",
229235
},
230236
"dataset": "fa.xpt",
231237
"row": 2,
@@ -234,10 +240,10 @@ def save_screenshot(driver, name_prefix="screenshot"):
234240
},
235241
{
236242
"value": {
237-
"RFSTDTC": "2013-01-05",
238243
"$val_dy": -34,
239-
"FADTC": "2012-12-02",
240244
"FADY": -30,
245+
"RFSTDTC": "2013-01-05",
246+
"FADTC": "2012-12-02",
241247
},
242248
"dataset": "fa.xpt",
243249
"row": 4,
@@ -246,10 +252,10 @@ def save_screenshot(driver, name_prefix="screenshot"):
246252
},
247253
{
248254
"value": {
249-
"RFSTDTC": "2014-05-11",
250255
"$val_dy": 206,
251-
"FADTC": "2014-12-02",
252256
"FADY": 230,
257+
"RFSTDTC": "2014-05-11",
258+
"FADTC": "2014-12-02",
253259
},
254260
"dataset": "fa.xpt",
255261
"row": 5,
@@ -261,21 +267,27 @@ def save_screenshot(driver, name_prefix="screenshot"):
261267
],
262268
"IE": [
263269
{
264-
"executionStatus": "success",
270+
"executionStatus": "issue_reported",
265271
"dataset": "ie.xpt",
266272
"domain": "IE",
267-
"variables": ["$val_dy", "IEDTC", "IEDY", "RFSTDTC"],
273+
"variables": [
274+
"$val_dy",
275+
"IEDY",
276+
"IEDTC",
277+
"RFSTDTC",
278+
],
268279
"message": (
269-
"IEDY is not correctly calculated even though the date portion of IEDTC is complete, "
270-
"the date portion of RFSTDTC is complete, and IEDY is not empty."
280+
"IEDY is not correctly calculated even though the date portion of "
281+
"IEDTC is complete, the date portion of RFSTDTC is complete, and "
282+
"IEDY is not empty."
271283
),
272284
"errors": [
273285
{
274286
"value": {
275-
"RFSTDTC": "2022-03-20",
276287
"$val_dy": -3,
277-
"IEDTC": "2022-03-17",
278288
"IEDY": -4,
289+
"RFSTDTC": "2022-03-20",
290+
"IEDTC": "2022-03-17",
279291
},
280292
"dataset": "ie.xpt",
281293
"row": 1,
@@ -287,19 +299,25 @@ def save_screenshot(driver, name_prefix="screenshot"):
287299
],
288300
"LB": [
289301
{
290-
"executionStatus": "success",
302+
"executionStatus": "issue_reported",
291303
"dataset": "lb.xpt",
292304
"domain": "LB",
293-
"variables": ["$val_dy", "LBDTC", "LBDY", "RFSTDTC"],
305+
"variables": [
306+
"$val_dy",
307+
"LBDY",
308+
"LBDTC",
309+
"RFSTDTC",
310+
],
294311
"message": (
295-
"LBDY is not correctly calculated even though the date portion of LBDTC is complete, "
296-
"the date portion of RFSTDTC is complete, and LBDY is not empty."
312+
"LBDY is not correctly calculated even though the date portion of "
313+
"LBDTC is complete, the date portion of RFSTDTC is complete, and "
314+
"LBDY is not empty."
297315
),
298316
"errors": [
299317
{
300318
"value": {
301-
"RFSTDTC": "2022-03-20",
302319
"$val_dy": 11,
320+
"RFSTDTC": "2022-03-20",
303321
"LBDTC": "2022-03-30",
304322
"LBDY": 2,
305323
},
@@ -312,7 +330,6 @@ def save_screenshot(driver, name_prefix="screenshot"):
312330
}
313331
],
314332
}
315-
316333
# Compare result
317334
if rule_exec_response == expected_json:
318335
print("Test Passed: API response matches expected JSON.")

0 commit comments

Comments
 (0)