-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/better 404 page handling #189
Merged
Merged
Changes from 16 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
a1fcdb2
chore: spa-config -> ilc-config
StyleT 2e6ef40
chore: Prototype implementation
StyleT 04d6253
chore: Special route handler added to Router
StyleT 44ff53f
feat: support of the "'ilc:404'" event
StyleT f17315e
doc: related doc update
StyleT 0ffa482
doc: Updated E2E tests launch instruction
StyleT 269b108
chore: updated default SSR timeout for news app, solves issue with 1s…
StyleT b865b17
chore: E2E tests for 404 page added
StyleT ad03176
chore: More e2e tests
StyleT 14563a4
chore: check of the errors during npm install
StyleT 1da44e4
chore: configs-injector tests update
StyleT 50e4b11
chore: server-router tests update
StyleT 33de12d
chore: router tests update
StyleT 2598213
chore: finished TailorX integration
StyleT 6e6b6d2
chore: client-router tests fix
StyleT 8279da0
chore: e2e tests refactoring
StyleT d7ee563
chore: PR fixes
StyleT File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,83 @@ | ||
Feature('404'); | ||
Feature('404 error handling'); | ||
|
||
Scenario('should show 404 error page', (I) => { | ||
//region 404 page for non-existing ILC route | ||
Scenario('Renders (SSR) global 404 page for non-existing ILC route', (I) => { | ||
I.amOnPage('/nonexistent-path'); | ||
I.waitForText('404 not found', 10, 'body > div#body'); | ||
}); | ||
Scenario('Renders (CSR) global 404 page for non-existing ILC route', (I, peoplePage) => { | ||
const notFoundPageLink = '#navbar a[href="/nosuchpath"]'; | ||
|
||
I.amOnPage(peoplePage.peopleUrl); | ||
I.waitForElement(notFoundPageLink, 30); | ||
I.click(notFoundPageLink); | ||
I.waitForText('404 not found', 10, 'body > div#body'); | ||
}); | ||
//endregion 404 page for non-existing ILC route | ||
|
||
//region 404 page for non-existing News app route | ||
Scenario('Renders (SSR) global 404 page for non-existing News app route', (I) => { | ||
I.amOnPage('/news/nonExisting'); | ||
I.waitForText('404 not found', 10, 'body > div#body'); | ||
}); | ||
|
||
Scenario('Renders (CSR) global 404 page for non-existing News app route', (I, newsPage: newsPage) => { | ||
I.amOnPage(newsPage.url.main); | ||
I.waitInUrl(newsPage.url.main, 10); | ||
I.waitForElement(newsPage.linkWithUrl(newsPage.url.nonExistingRoute), 10); | ||
I.click(newsPage.linkWithUrl(newsPage.url.nonExistingRoute)); | ||
I.waitForText('404 not found', 10, 'body > div#body'); | ||
|
||
//After 404 page ILC continues normal operation | ||
I.click(newsPage.linkWithUrl(newsPage.url.main)); | ||
I.waitForElement(newsPage.newsSources, 10); | ||
I.see('Pick a news source', newsPage.bannerHeadline); | ||
}); | ||
|
||
Scenario('Renders (SSR) overridden 404 page for non-existing News app route', (I, newsPage: newsPage) => { | ||
I.amOnPage(newsPage.url.nonExistingRouteWithOverride); | ||
I.waitForText('404 not found component', 10, 'body > div#body'); | ||
}); | ||
|
||
Scenario('Renders (CSR) overridden 404 page for non-existing News app route', (I, newsPage: newsPage) => { | ||
I.amOnPage(newsPage.url.main); | ||
I.waitInUrl(newsPage.url.main, 10); | ||
I.waitForElement(newsPage.linkWithUrl(newsPage.url.nonExistingRouteWithOverride), 10); | ||
I.click(newsPage.linkWithUrl(newsPage.url.nonExistingRouteWithOverride)); | ||
I.waitForText('404 not found component', 10, 'body > div#body'); | ||
}); | ||
//endregion 404 page for non-existing News app route | ||
|
||
//region 404 page for non-existing News resource | ||
Scenario('Renders (SSR) global 404 page for non-existing News resource', (I, newsPage: newsPage) => { | ||
I.amOnPage(newsPage.url.nonExistingResource); | ||
I.waitForText('404 not found', 10, 'body > div#body'); | ||
}); | ||
|
||
Scenario('Renders (CSR) global 404 page for non-existing News resource', (I, newsPage: newsPage) => { | ||
I.amOnPage(newsPage.url.main); | ||
I.waitInUrl(newsPage.url.main, 10); | ||
I.waitForElement(newsPage.linkWithUrl(newsPage.url.nonExistingResource), 10); | ||
I.click(newsPage.linkWithUrl(newsPage.url.nonExistingResource)); | ||
I.waitForText('404 not found', 10, 'body > div#body'); | ||
|
||
//After 404 page ILC continues normal operation | ||
I.wait(5); //Hack to fix issue with the Vue Router | ||
I.click(newsPage.linkWithUrl(newsPage.url.main)); | ||
I.waitForElement(newsPage.newsSources, 10); | ||
I.see('Pick a news source', newsPage.bannerHeadline); | ||
}); | ||
|
||
Scenario('Renders (SSR) overridden 404 page for non-existing News resource', (I, newsPage: newsPage) => { | ||
I.amOnPage(newsPage.url.nonExistingResourceWithOverride); | ||
I.waitForText('404 not found component', 1000, 'body > div#body'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we exactly need to wait here for 1000 seconds? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
}); | ||
|
||
Scenario('Renders (CSR) overridden 404 page for non-existing News resource', (I, newsPage: newsPage) => { | ||
I.amOnPage(newsPage.url.main); | ||
I.waitInUrl(newsPage.url.main, 10); | ||
I.waitForElement(newsPage.linkWithUrl(newsPage.url.nonExistingResourceWithOverride), 10); | ||
I.click(newsPage.linkWithUrl(newsPage.url.nonExistingResourceWithOverride)); | ||
I.waitForText('404 not found component', 10, 'body > div#body'); | ||
}); | ||
//endregion 404 page for non-existing News resource |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see you added URLs here is
e2e/spec/pages/news.ts
So you can use
newsPage.url.nonExistingRoute
hereThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍