GirlsCodeLincoln / Website

The Girls Code Lincoln website
https://girlscodelincoln.org
5 stars 1 forks source link

Normalize URLs before comparing in Selenium tests #107

Open troynguyen8 opened 4 years ago

troynguyen8 commented 4 years ago

We've had a couple issues with our selenium tests asserting the equality of links such as www.google.com and www.google.com/. There are techniques to normalize URLs before comparing them. We should attempt to leverage this so we can do the following:

assert url_norm('www.google.com') == url_norm('www.google.com/') # most common case
assert url_norm('http://www.google.com') == url_norm('google.com')
...

Reading on URL normalization here: https://en.wikipedia.org/wiki/URI_normalization I'm sure there are some Python packages that can do normalization to the extent we need.

benweese commented 4 years ago

Will look more into this when I get home. url-normalize