-
Notifications
You must be signed in to change notification settings - Fork 732
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
Multi-Page application support for PWA #1556
Conversation
Codecov Report
@@ Coverage Diff @@
## development #1556 +/- ##
=================================================
- Coverage 86.66% 86.66% -0.01%
- Complexity 2072 2073 +1
=================================================
Files 197 197
Lines 5580 5585 +5
Branches 825 825
=================================================
+ Hits 4836 4840 +4
- Misses 301 302 +1
Partials 443 443
Continue to review full report at Codecov.
|
bundles/core/src/main/java/com/adobe/cq/wcm/core/components/internal/models/v2/PWAImpl.java
Outdated
Show resolved
Hide resolved
adminAuthor.getUrl("/"); | ||
|
||
// Manifest | ||
GraniteAssert.assertRegExFind(content, "<link rel=\"manifest\" href=\".*/content/foo/us/en/manifest.webmanifest\" crossorigin=\"use-credentials\"/>"); |
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.
Added support for context path, would fail in our testing pipeline otherwise as we always use a context path.
assertEquals("staleWhileRevalidate", swconfigJson.get("pwaCachestrategy").getAsString()); | ||
assertNotNull(swconfigJson.get("pwaPrecache").getAsJsonArray()); | ||
assertNotNull(swconfigJson.get("pwaCachingpaths").getAsJsonArray()); | ||
//assertNotNull(swconfigJson.get("pwaOfflineClientlibs").getAsJsonArray()); |
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.
Added better handling of JSON as the previous was failing in my local development environment.
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.
You might want to expand assertions by walking the expected tree.
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.
Done.
@@ -55,4 +64,47 @@ public void testBrandSlug() throws ClientException { | |||
content = adminAuthor.doGet("/content/core-components/simple-page/simple-subpage.html", 200).getContent(); | |||
GraniteAssert.assertRegExFind(content, "<title>Simple SubPage \\| Core Components</title>"); | |||
} | |||
|
|||
@Test | |||
public void testPWAProperties() throws ClientException { |
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.
These tests should probably be skipped on 6.4 and 6.5 if the PWA features were not backported. @msagolj, any pointers here?
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.
- create an empty Interface named e.g.
IgnoreOn64
andIgnoreOn65
- Mark tests to ignore with
@Category({IgnoreOn64.class, IgnoreOn65.class})
- In the Jenkinsfile we then have to add a
.withCategoryFilter("IgnoreOn64")
etc. for the correspondingIntergrationTestRun
configurations.
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.
Done. @msagolj Grateful if you could update the JenkinsFile accordingly.
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 reduced the service worker assertions because the previous test was failing on my environment.
Also, please see inline comments!
SonarCloud Quality Gate failed. 1 Bug No Coverage information |
* Multi-Page application support for PWA * IT tests for PWA * Added ignores for 64 and 65 Co-authored-by: fauchere <fauchere@adobe.com> Co-authored-by: Vlad <vlad@bailescu.ro>
This PR adds support for multi-page applications (MPAs) to be recognized as Progressive Web Apps(PWAs) without having to configure each page. With this change you can configure PWA properties once at the project level or even at the localization level in the tree (e.g., us/en). When you access any page within the MPA this solution will traverse up the tree to see if any parent page has PWA properties configured and if so use those properties to show up as a PWA with the installable icon in the browser.