-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- enabled PageNotFound for 404 status - added prerender meta tag - added integration tests
- Loading branch information
kate-mashkina
committed
Mar 18, 2021
1 parent
971af09
commit a16dc6f
Showing
7 changed files
with
165 additions
and
61 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
{ | ||
"urls": [ | ||
"http://localhost:3000" | ||
"http://localhost:3000", | ||
"http://localhost:3000/chicken-nugget?cfg=0", | ||
"http://localhost:3000/c4872?cfg=0" | ||
] | ||
} |
58 changes: 0 additions & 58 deletions
58
cypress/integration/AppAnalytics/NoParamsPageNotFoundAnalytics.feature
This file was deleted.
Oops, something went wrong.
104 changes: 104 additions & 0 deletions
104
cypress/integration/AppAnalytics/PageNotFoundAnalytics.feature
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,104 @@ | ||
Feature: Analytics Page Not Found | ||
|
||
Scenario: Page Load Analytics fires for a 404 on a disease dynamic listing page with no parameters | ||
Given "trialListingPageType" is set to "Disease" | ||
And "baseHost" is set to "http://localhost:3000" | ||
And "canonicalHost" is set to "https://www.cancer.gov" | ||
And "analyticsPublishedDate" is set to "02/02/2011" | ||
And "siteName" is set to "National Cancer Institute" | ||
When the user navigates to "/" | ||
And page title on error page is "Page Not Found" | ||
And browser waits | ||
Then there should be an analytics event with the following details | ||
| key | value | | ||
| type | PageLoad | | ||
| event | TrialListingApp:Load:PageNotFound | | ||
| page.name | www.cancer.gov/ | | ||
| page.title | Page Not Found | | ||
| page.metaTitle | Page Not Found | | ||
| page.language | english | | ||
| page.type | nciAppModulePage | | ||
| page.channel | Clinical Trials | | ||
| page.contentGroup | Clinical Trials: Custom | | ||
| page.publishedDate | 02/02/2011 | | ||
| page.additionalDetails.trialListingPageType | disease | | ||
|
||
Scenario: Page Load Analytics fires for a 404 on a intervention dynamic listing page with no parameters | ||
Given "trialListingPageType" is set to "Intervention" | ||
And "baseHost" is set to "http://localhost:3000" | ||
And "canonicalHost" is set to "https://www.cancer.gov" | ||
And "analyticsPublishedDate" is set to "02/02/2011" | ||
And "siteName" is set to "National Cancer Institute" | ||
When the user navigates to "/" | ||
And page title on error page is "Page Not Found" | ||
And browser waits | ||
Then there should be an analytics event with the following details | ||
| key | value | | ||
| type | PageLoad | | ||
| event | TrialListingApp:Load:PageNotFound | | ||
| page.name | www.cancer.gov/ | | ||
| page.title | Page Not Found | | ||
| page.metaTitle | Page Not Found | | ||
| page.language | english | | ||
| page.type | nciAppModulePage | | ||
| page.channel | Clinical Trials | | ||
| page.contentGroup | Clinical Trials: Custom | | ||
| page.publishedDate | 02/02/2011 | | ||
| page.additionalDetails.trialListingPageType | intervention | | ||
|
||
Scenario: Page Load Analytics fires for a 404 on a disease dynamic listing page with non-existent c-code | ||
Given "trialListingPageType" is set to "Disease" | ||
And "baseHost" is set to "http://localhost:3000" | ||
And "canonicalHost" is set to "https://www.cancer.gov" | ||
And "analyticsPublishedDate" is set to "02/02/2011" | ||
And "siteName" is set to "National Cancer Institute" | ||
When user navigates to non-existent page "/c123455?cfg=0" | ||
And page title is "Page Not Found" | ||
And browser waits | ||
Then there should be an analytics event with the following details | ||
| key | value | | ||
| type | PageLoad | | ||
| event | TrialListingApp:Load:PageNotFound | | ||
| page.name | www.cancer.gov/c123455 | | ||
| page.title | Page Not Found | | ||
| page.metaTitle | Page Not Found | | ||
| page.language | english | | ||
| page.type | nciAppModulePage | | ||
| page.channel | Clinical Trials | | ||
| page.contentGroup | Clinical Trials: Custom | | ||
| page.publishedDate | 02/02/2011 | | ||
| page.additionalDetails.trialListingPageType | disease | | ||
|
||
Scenario: Page Load Analytics fires for a 404 on a disease dynamic listing page with non-existent pretty-url | ||
Given "trialListingPageType" is set to "Disease" | ||
And "baseHost" is set to "http://localhost:3000" | ||
And "canonicalHost" is set to "https://www.cancer.gov" | ||
And "analyticsPublishedDate" is set to "02/02/2011" | ||
And "siteName" is set to "National Cancer Institute" | ||
When user navigates to non-existent page "/chicken-nugget?cfg=0" | ||
And page title is "Page Not Found" | ||
And browser waits | ||
Then there should be an analytics event with the following details | ||
| key | value | | ||
| type | PageLoad | | ||
| event | TrialListingApp:Load:PageNotFound | | ||
| page.name | www.cancer.gov/chicken-nugget | | ||
| page.title | Page Not Found | | ||
| page.metaTitle | Page Not Found | | ||
| page.language | english | | ||
| page.type | nciAppModulePage | | ||
| page.channel | Clinical Trials | | ||
| page.contentGroup | Clinical Trials: Custom | | ||
| page.publishedDate | 02/02/2011 | | ||
| page.additionalDetails.trialListingPageType | disease | | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
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,32 @@ | ||
Feature: As a user when I visit a non existent trial listing page I am presented with page not found | ||
|
||
Scenario: Disease 404: Page Not Found displays when a user views a dynamic listing page with invalid disease c-code | ||
Given "trialListingPageType" is set to "Disease" | ||
When user navigates to non-existent page "/c123455?cfg=0" | ||
And page title is "Page Not Found" | ||
And the text "We can't find the page you're looking for." appears on the page | ||
And the following links and texts exist on the page | ||
| https://www.cancer.gov | homepage | | ||
| https://www.cancer.gov/types | cancer type | | ||
| https://www.cancer.gov/contact | Get in touch | | ||
And the search bar appears below | ||
Then the title tag should be "Page Not Found" | ||
And the page contains meta tags with the following names | ||
| name | content | | ||
| prerender-status-code | 404 | | ||
|
||
|
||
Scenario: Disease 404: Page Not Found displays when a user views a dynamic listing page with invalid pretty url | ||
Given "trialListingPageType" is set to "Disease" | ||
When user navigates to non-existent page "/chicken-nuggets?cfg=0" | ||
And page title is "Page Not Found" | ||
And the text "We can't find the page you're looking for." appears on the page | ||
And the following links and texts exist on the page | ||
| https://www.cancer.gov | homepage | | ||
| https://www.cancer.gov/types | cancer type | | ||
| https://www.cancer.gov/contact | Get in touch | | ||
And the search bar appears below | ||
Then the title tag should be "Page Not Found" | ||
And the page contains meta tags with the following names | ||
| name | content | | ||
| prerender-status-code | 404 | |
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