Skip to content

Commit bf5a558

Browse files
Merge pull request #261 from LeoLuosifen/wlyu
Migrate end-to-end testing framework from Cypress to Playwright
2 parents 8a3e409 + fd4117e commit bf5a558

31 files changed

Lines changed: 1268 additions & 2631 deletions

.github/workflows/cypress.yml

Lines changed: 0 additions & 58 deletions
This file was deleted.

.github/workflows/python.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@ jobs:
3131
run: |-
3232
pipenv run ruff format --check .
3333
34+
- name: Install Playwright Browsers
35+
run: |
36+
pipenv run playwright install --with-deps
37+
38+
- name: Start Clima
39+
run: |-
40+
pipenv run python main.py &
41+
3442
- name: Test Clima
3543
run: |-
36-
pipenv run python -m pytest
44+
cd tests
45+
pipenv run pytest --base-url=http://127.0.0.1:8080

Pipfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ bump2version = "*"
2424
black = "*"
2525
ruff = "*"
2626
pre-commit = "*"
27+
pytest-playwright = "*"
28+
pytest-xdist = "*"
2729

2830
[requires]
2931
python_version = "3.11"

Pipfile.lock

Lines changed: 420 additions & 96 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ This ongoing project results from the collaboration and contributions of the peo
3434
* [Chun Him Lee](https://www.linkedin.com/in/chun-him-lee-01b553129/): Coding and review
3535
* [Tu Minh Phuong Doan](https://www.linkedin.com/in/harry-doan-legopher/): Coding and review
3636
* [Yixun Quan](https://www.linkedin.com/in/yixun-quan-929a661a3): Coding and review
37-
* Yuqing Luo: Coding, code maintenance and review
37+
* [Yuqing Luo](https://leo-5a2.pages.dev/): Coding, code maintenance and review
3838
* Wenshu lyu: Coding, code maintenance and review
3939
* Ziqi Liu: Coding, code maintenance and review
4040
* Tianchi Liu: Coding, code maintenance and review
41-
* Qian Liu: Coding, code maintenance and review
41+
* [Qian Liu](https://www.linkedin.com/in/qian-liu-48b294342): Coding, code maintenance and review
4242
* Feng Wang: Coding, code maintenance and review
4343

4444
## Acknowledgment

docs/contributing/contributing.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,17 @@ Before submitting a Pull Request, please make sure:
123123

124124
```bash
125125
pipenv sync --dev
126+
pipenv run playwright install # Required to install browsers
126127
```
127-
128-
- Run tests using pytest:
129-
128+
Start the app server:
130129
```bash
131-
pipenv run pytest
130+
pipenv run python main.py
131+
```
132+
Then, from the root directory, run tests using pytest:
133+
```bash
134+
cd tests
135+
136+
pipenv run pytest --base-url=http://127.0.0.1:8080
132137
```
133138

134139
## Submitting changes

docs/version/changelog.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Changelog
22

3+
## Version 0.9.0\(2025-10-30)
4+
5+
Feat:
6+
7+
* Moved the top navigation bar to the left side
8+
* Extracted the hours and months into a global filter and place it in the Sidebar
9+
* Migrated testing framework from Cypress to Playwright
10+
11+
Fix:
12+
13+
* Fixed issues #249, #245, #159, #242: Code redundancy and CSS styling issues
14+
* Fixed issues #248
15+
* Fixed issues #236, #259: Sidebar issues
16+
317
## Version 0.8.5 \(2023-04-12\)
418

519
Feat:

pages/natural_ventilation.py

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -161,21 +161,16 @@ def inputs_tab(t_min, t_max, d_set):
161161
),
162162
],
163163
),
164-
dmc.CheckboxGroup(
164+
dmc.Checkbox(
165165
id=ElementIds.ENABLE_CONDENSATION,
166-
value=[],
167-
children=[
168-
dmc.Checkbox(
169-
label=(
170-
"Avoid condensation with radiant systems: If the "
171-
"outdoor dew point temperature is below the radiant "
172-
"system surface temperature, the data point is not plot."
173-
),
174-
value=1,
175-
size="sm",
176-
w="70%",
177-
)
178-
],
166+
label=(
167+
"Avoid condensation with radiant systems: If the "
168+
"outdoor dew point temperature is below the radiant "
169+
"system surface temperature, the data point is not plot."
170+
),
171+
checked=False,
172+
size="sm",
173+
w="70%",
179174
),
180175
dmc.Button(
181176
"Apply filter",
@@ -565,17 +560,17 @@ def nv_bar_chart(
565560

566561
@callback(
567562
Output(ElementIds.NV_DPT_FILTER, "disabled"),
568-
Input(ElementIds.ENABLE_CONDENSATION, "value"),
563+
Input(ElementIds.ENABLE_CONDENSATION, "checked"),
569564
)
570-
def enable_disable_button_data_filter(state_checklist):
571-
if len(state_checklist) == 1:
565+
def enable_disable_button_data_filter(state_checkbox):
566+
if state_checkbox:
572567
return False
573568
else:
574569
return True
575570

576571

577572
def enable_dew_point_data_filter(condensation_enabled):
578-
if len(condensation_enabled) == 1:
573+
if condensation_enabled:
579574
return True
580575
else:
581576
return False

tests/conftest.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import pytest
2+
3+
4+
@pytest.fixture(scope="session")
5+
def base_url(pytestconfig):
6+
return pytestconfig.getoption("base_url")

tests/node/cypress.config.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)