[MGNLTEST-258] Introduce network logs for requests sent by Chrome webdriver Created: 07/Jun/22  Updated: 24/Jun/22  Resolved: 22/Jun/22

Status: Closed
Project: Magnolia Test Framework
Component/s: None
Affects Version/s: None
Fix Version/s: 1.3.3

Type: Improvement Priority: Neutral
Reporter: Rishab Dhar Assignee: Rishab Dhar
Resolution: Fixed Votes: 0
Labels: None
Σ Remaining Estimate: Not Specified Remaining Estimate: Not Specified
Σ Time Spent: 7.75h Time Spent: 7.75h
Σ Original Estimate: Not Specified Original Estimate: Not Specified

Sub-Tasks:
Key
Summary
Type
Status
Assignee
MGNLTEST-259 Implemation Sub-task Closed Rishab Dhar  
MGNLTEST-260 Review Sub-task Completed Robert Šiška  
MGNLTEST-261 PiQA Sub-task Completed Jaroslav Simak  
MGNLTEST-262 QA Sub-task Completed Phong Le Quoc  
Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Epic Link: SaaS TPR - SPA Tests
Sprint: DevX 12
Story Points: 3
Team: DeveloperX

 Description   

Background

As part of MGNLTEST-238 support for scaled docker setup of external SPA nodes was introduced, however, due to the nature of complexity of external SPA tests which involved a lot of back and forth communication between magnolia and external SPA until the page is finally rendered, the current state of debug tooling - logs, recordings, exposed ports for VNC recorder are insufficient to provide adequate information to the test writer on the cause for test failure.

Proposed solution

Display network logs for the following parameters for the requests sent by selenium web driver:

  • Request Url
  • Headers
  • Response status
  • Reason for failure

Note

In light of the current state of tooling supported by Selenium 4, there is support available atleast for the chrome driver to capture network logs by attaching network event listeners to the devtools API.



 Comments   
Comment by Rishab Dhar [ 20/Jun/22 ]

plequoc To perform the QA of the ticket:

  • Trigger the build of this PR.
  • Follow the logs and search for the expression {{Failed to load content { url: {}, response code: {}, reason: {}, Request headers: {}, Response headers: {} }}} for SPA related communication errors and log expression {{Failed to load content { requestId: {}, blocked reason: {}, resourceType: {}, error: {}, cancelled: {} }}}

In case the build is green or no the recording of the failed test shows SPA content rendered, to trigger a failure of the rendering, simply change the baseUrl to this baseUrl: "http://172.17.0.1:4300" in the decorating light module at magnolia-integration-tests/tests/src/test/resources/spa-test/templates/pages/page.yaml

Generated at Mon Feb 12 07:47:06 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.