-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CKS-334 Scaffold chapter pages (#42)
* CKS-334 Scaffold chapter pages * CKS-334 Remove extra topic page content * CKS-334 Flatten topic menu until nested stacked nav * CKS-334 Set correct chapter heading * CKS-334 Rewrite chater content links * CKS-334 Remove HTML processing * CKS-334 Add comment for scss declaration * CKS-334 Refactors * CKS-334 Refactor chapter types * CKS-334 Fix test * CKS-334 Fix test * CKS-334 Update sub chapters sub nav indentation * CKS-334 Add key to topic menu fragment * CKS-334 Refactor chapter body * CKS-334 Add HTML utils tests * CKS-334 Ignore graphql fragments from coverage * CKS-334 Add chapter body tests * CKS-334 Add insertId tests * CKS-334 Add placeholder tests for the chapter template * CKS-334 Refactor chapter pages * CKS-334 Refactor chapter headings to correct level * CKS-334 Change home breadcrumb to NICE * CKS-334 Add level 1 chapter tests * CKS-334 Add chapter body tests * CKS-334 Remove unusde fragments * CKS-334 Remove grid from chapter body * CKS-334 Add comments and fix import path * CKS-334 Add split CSS plugin * CKS-334 Fix await in wrong place * CKS-334 Split CSS Reduces total build size and per-page size by including only the required CSS * CKS-334 Remove spacing modifiers Save A LOT of space in the final build size as ALL of the spacing modifiers CSS was being included in EVERY single chapter page of which there are 12000 or so * CKS-334 Update package lock * CKS-334 Update package lock * CKS-334 Fix topic summary link * CKS-334 Fix test * CKS-334 Fix gatsby-react-router-scroll version See gatsbyjs/gatsby#25778 (comment) * CKS-334 Fix type def for test * CKS-334 Fix flakey functional tests * CKS-334 Add Asthma topic page tests * CKS-334 Refactor breadcrumb step * CKS-334 Re-instate topic page a11y tests * CKS-334 Add chapter page functional tests * CKS-334 Use new 2 level stacked nav for topic menu * CKS-334 Fix tests * CKS-334 Increase test timeout * CKS-334 Add LangVersion to latest Avoids "Feature 'using declarations' is not available in C# 7.3. Please use language version 8.0 or greater." error * CKS-334 Refactor topic graphql query * CKS-334 Add topic chapters menu tests * CKS-334 Add chapter level 2 tests * CKS-334 Update design system version * CKS-334 Bump global nav commit * CKS-334 Update NDS version, exclude unused classes * CKS-334 Fix styling issues after NDS update Caused by the new max width on lists * CKS-334 Fix fake API not debugging * CKS-334 Fix HTML encoding in topic lead * CKS-334 Fix jest tests not outputting debug logs * CKS-334 Add topic page lead paragraph test * CKS-334 Refactor chapter level 1 tests * CKS-334 Increase test timeouts * CKS-334 Update design system package Gets new breadcrumbs update with wider max width
- Loading branch information
1 parent
400aa9a
commit d40489b
Showing
56 changed files
with
4,564 additions
and
3,277 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
Feature: Chapter Page | ||
As a user of CKS | ||
I want to be able to use the CKS Chapter Page | ||
|
||
Background: | ||
Given I open the asthma have I got the right topic? page | ||
And I have a screen that is 1366 by 768 pixels | ||
|
||
Scenario: Detect accessibility issues | ||
Then the page should have no accessibility issues | ||
|
||
Scenario: Detect mobile accessibility issues | ||
Given I have a screen that is 320 by 568 pixels | ||
Then the page should have no accessibility issues | ||
|
||
Scenario: NICE breadcrumb | ||
When I click the NICE breadcrumb | ||
Then I expect that the url is "https://www.nice.org.uk/" | ||
|
||
Scenario: Homepage breadcrumb | ||
When I click the CKS breadcrumb | ||
Then I expect that the path is "/" | ||
|
||
Scenario: Topics A to Z breadcrumb | ||
When I click the Topics A to Z breadcrumb | ||
Then I expect that the path is "/topics/" | ||
|
||
Scenario: Asthma breadcrumb | ||
When I click the Asthma breadcrumb | ||
Then I expect that the path is "/topics/asthma/" | ||
|
||
Scenario: Heading text | ||
Then I expect that element "h1" contains the text "Have I got the right topic?" | ||
|
||
Scenario: Chapter navigation | ||
When I click the "Summary" link | ||
And I expect that the path is "/topics/asthma/" | ||
|
||
Scenario: Chapter body | ||
Then I expect that element "main" contains the text "From age 1 month onwards" | ||
|
||
|
||
|
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
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,9 @@ | ||
module.exports = (text) => { | ||
const aside = $("aside"); | ||
if (aside.isExisting("button=Close")) { | ||
aside.$("button=Close").click(); | ||
// Avoid "Element is not clickable at point" errors by calling click in the browser directly | ||
browser.execute(() => { | ||
document.querySelector("aside button").click(); | ||
}); | ||
} | ||
}; |
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,16 @@ | ||
/** | ||
* Waits for the client side React code to be downloaded, parsed and executed by | ||
* checking for an attribute rendered by react-helmet. | ||
* | ||
* Use this method to wait for the page to be interactive. | ||
*/ | ||
module.exports = (timeoutMs = 5000) => { | ||
browser.waitUntil( | ||
() => | ||
browser.execute( | ||
() => !!document.documentElement.getAttribute("data-react-helmet") | ||
).value, | ||
timeoutMs, | ||
"JavaScript React bundle not loaded" | ||
); | ||
}; |
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,3 +1,7 @@ | ||
module.exports = (oldTitle) => { | ||
browser.waitUntil(() => browser.getTitle() !== oldTitle); | ||
module.exports = (oldTitle, timeoutMs = 5000) => { | ||
browser.waitUntil( | ||
() => browser.getTitle() !== oldTitle, | ||
timeoutMs, | ||
`Page title was still '${oldTitle}' after ${timeoutMs}ms` | ||
); | ||
}; |
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.