cwa-website
cwa-website copied to clipboard
Extend app-to-web Cypress test: CCL, Data Privacy and Terms of Use links
This PR extends the coverage of the Cypress cypress/integration/app_to_web.js test to cover links to the cwa-website used by the apps which do not originate from the Android and iOS app links files (e.g. https://github.com/corona-warn-app/cwa-app-android/blob/main/Corona-Warn-App/src/main/res/values/links.xml (Android) and https://github.com/corona-warn-app/cwa-app-ios/blob/release/2.26.x/src/xcode/ENA/ENA/Resources/Localization/en.lproj/Localizable.links.strings (iOS)).
- CCL injects links into the app using
faqAnchor
for certificate related topics (Certificates tab) - The app Data Privacy page refers to
#interoperability_countries
(App Information > Data Privacy) - The app Terms of Use page refers to
de
,en
andtr
language versions of the Terms of Use and Privacy Notice pdf assets (App Information > Terms of Use)
Verification
npm run test:open
select app_to_web.js
with Chrome browser
npx cypress run -s cypress/integration/app_to_web.js -c baseUrl=https://www.coronawarn.app
npx cypress run -s cypress/integration/app_to_web.js -c baseUrl=https://coronawarn.app
npx cypress run -s 'cypress/integration/*.js' -c baseUrl=https://coronawarn.app --browser chrome
All tests should run without failures (8 Passing for app_to_web.js
, 113 Passing for full test).
@MikeMcC399 thanks for the contribution. Do you think it would make sense to add the source of the FAQ anchors as a comment?
@mlenkeit
thanks for the contribution.
You're welcome!
Do you think it would make sense to add the source of the FAQ anchors as a comment?
Good question! There is a multitude of sources for the links, described in detail below. The links used by the Cypress test are listed in the json file appToWebLinks.json and it would be a bit clumsy to try to add extensive comments to the json
file which is really a data-only format.
It would be possible to add comments to the app_to_web.js Cypress test spec, however none of the other Cypress tests have any extensive in-line comments, so that would be a little inconsistent.
I would prefer to leave the information only here in the PR and not add it to the code. If you think that it should be made more permanent, I would submit a separate markdown document to the https://github.com/corona-warn-app/cwa-website/tree/master/docs folder describing where the links come from.
It would be a separate subject (project) about how to automate gathering the anchors to test for the future. That would be worth looking at if the app anchors are going to change significantly for future versions, otherwise it's probably good enough to leave it as a manual data harvesting task. It would make sense to pass the responsibility to the respective Android and iOS app to prepare one consolidated file for each operating system, containing www.coronawarn.app
links to be tested instead of trying to have the intelligence for crawling the app sources for links delegated to the website code.
Source of anchors
The anchors used in appToWebLinks.json come from:
- CCL: The anchors for the links are in various
*.yml
files on https://github.com/corona-warn-app/cwa-app-ccl/tree/main using the keyfaqAnchor
- Data Privacy: for Android in https://github.com/corona-warn-app/cwa-app-android/tree/main/Corona-Warn-App/src/main/assets using documents privacy_de.html, privacy_en.html and privacy_tr.html
- Data Privacy: for iOS in https://github.com/corona-warn-app/cwa-app-ios/blob/main/src/xcode/ENA/ENA/Resources/Localization/de.lproj/privacy-policy.html and 5 other language files (
bg
,en
,pl
,ro
&tr
) - Terms of Use: for Android in https://github.com/corona-warn-app/cwa-app-android/tree/main/Corona-Warn-App/src/main/assets using documents terms_de.html, terms_en.html and terms_tr.html
- Terms of Use: for iOS in https://github.com/corona-warn-app/cwa-app-ios/blob/main/src/xcode/ENA/ENA/Resources/Localization/de.lproj/usage.html and 5 other language files (
bg
,en
,pl
,ro
&tr
) - Main links: for Android in https://github.com/corona-warn-app/cwa-app-android/blob/main/Corona-Warn-App/src/main/res/values/links.xml and https://github.com/corona-warn-app/cwa-app-android/blob/main/Corona-Warn-App/src/main/res/values-de/links.xml
- Main links: for iOS in https://github.com/corona-warn-app/cwa-app-ios/blob/main/src/xcode/ENA/ENA/Resources/Localization/de.lproj/Localizable.links.strings and 5 other language files (
bg
,en
,pl
,ro
&tr
) - FAQ redirects are defined in https://github.com/corona-warn-app/cwa-website/blob/master/src/data/faq_redirects.json
In addition, looking ahead for CCL, Android and iOS branches in development for any new links. (There have not been any so far for 2.26 or 2.27 compared to 2.25.)
Ok, looks good to me! Unfortunately, I don't have permission to merge it.
@mlenkeit
Ok, looks good to me!
Thank you for your approval!
Unfortunately, I don't have permission to merge it.
Luckily this is not an urgent PR, just "nice-to-have".