-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement Frontend-Only Slow Performance Story (#312)
* add query param for frontend only slowdown (triggers quicker backend products fetch) * move slow render problem behind frontend-only query param * cause 'performance issue' when frontend-slowdown query param is passed * trigger frontend-only slowdown in separate page * TDA test to generate data for frontend slowdown page * improve variable name
- Loading branch information
1 parent
c3deed1
commit e7ac9dd
Showing
5 changed files
with
138 additions
and
19 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
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
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
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
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,24 @@ | ||
import time | ||
import sentry_sdk | ||
from urllib.parse import urlencode | ||
|
||
def test_frontend_slowdown(desktop_web_driver, endpoints, random, batch_size, backend, sleep_length): | ||
|
||
for endpoint in endpoints.react_endpoints: | ||
endpoint_frontend_slowdown = endpoint + "/products-fes" | ||
sentry_sdk.set_tag("endpoint", endpoint_frontend_slowdown) | ||
|
||
for i in range(batch_size): | ||
# Ensures a different backend endpoint gets picked each time | ||
url = "" | ||
# TODO make a query_string builder function for sharing this across tests | ||
query_string = { | ||
# 'ruby' /products /checkout endpoints not available yet | ||
'backend': backend(exclude=['ruby', 'laravel', 'aspnetcore']) | ||
} | ||
url = endpoint_frontend_slowdown + '?' + urlencode(query_string) | ||
|
||
desktop_web_driver.get(url) | ||
time.sleep(sleep_length() + sleep_length() + 1) | ||
|
||
# Checkout button not clicked yet in frontend slowdown flow |