Skip to content
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

Implement End-to-End Testing #696

Open
13 tasks
gagan0123 opened this issue May 29, 2024 · 0 comments
Open
13 tasks

Implement End-to-End Testing #696

gagan0123 opened this issue May 29, 2024 · 0 comments
Assignees
Milestone

Comments

@gagan0123
Copy link
Collaborator

Feature Request

Description:
Implement end-to-end tests for the Privacy Sandbox Analysis Tool (PSAT). These tests will scrape data from the Application and Network panels in DevTools and compare it with information that PSAT gathers from Chrome DevTools Protocol(CDP) and Chrome WebRequests API.

Motivation:
Accurate and reliable data from PSAT is essential for developers transitioning to a privacy-focused web. E2E testing simulates real-world browsing, ensuring PSAT's functionality and accuracy by comparing data from multiple sources.

User Story:
As a PSAT developer, I want robust E2E tests that validate data consistency across different sources so that I can ensure the tool's accuracy and dependability, providing PSAT users with a reliable resource for their Privacy Sandbox efforts.

Acceptance Criteria:

  • Develop a suite of E2E tests that cover the following scenarios:

    Cookie Analysis

    • Cookie Setting: Navigate to a test page, trigger cookie setting events (via JavaScript and HTTP headers), and verify:
      • All the cookies are listed in the PSAT extension's Cookies Table.
      • All the cookie attributes in the Cookies Table (name, value, domain, path, etc.) are correctly parsed and displayed.
      • The cookie is classified correctly as first-party or third-party.
      • The cookie's source (HTTP header or JavaScript) is accurately identified.
    • Cookie Blocking: Navigate to a test page that sets cookies with attributes likely to be blocked (e.g., SameSite=None without Secure, third-party cookies in the future). Verify:
      • The PSAT extension correctly identifies blocked cookies in the Cookies Table.
      • The "Blocked Reasons" column accurately reflects why the cookie was blocked.
      • The information displayed in the Cookies Table matches the blocking details available in the Network panel.
    • Allow Listing: Enable the allow listing feature for a specific domain. Navigate to a test page that sets cookies from that domain. Verify:
      • Cookies from the allowed domain are not flagged as blocked.
      • The "Allow Listed" status is correctly displayed in the Cookies Table.
    • Frame Overlays: Enable the frame overlay feature and navigate to a test page with multiple iframes. Verify:
      • Hovering over an iframe highlights it correctly.
      • The tooltip displayed for each iframe contains accurate information about the frame's origin, cookies, and allowed features.
    • Cookie Exemptions: Using Chrome flags or settings, configure specific cookie exemptions. Navigate to a test page that benefits from those exemptions. Verify:
      • The PSAT extension reflects the exempted cookies accurately.
      • The Cookies Table displays the correct "Exemption Reason."

    Site Boundaries

    • Related Website Sets (RWS) Detection: Navigate to a website that belongs to a known RWS. Verify:
      • The PSAT extension correctly identifies the site's RWS membership.
      • The "Related Website Sets" panel displays the correct information about the set (primary domain, associated sites, rationale).
    • CHIPS: Navigate to a test page that sets cookies with the Partitioned attribute. Verify:
      • The PSAT extension correctly displays the Partition Key in the Cookies Table.

    Library Detection

    • Known Breakages: Navigate to test pages that use known deprecated libraries (Google Sign-In, Google Identity Services, Facebook integrations, etc.). Verify:
      • PSAT correctly detects the libraries and flags them in the "Known Breakages" section.
      • The information presented in the "Known Breakages" section is accurate and up-to-date.

    CLI

    • URL and Sitemap Analysis: Run the PSAT CLI with both single URL and sitemap inputs. Verify:
      • The CLI generates the expected output files (JSON, CSV).
      • The information in the output files is consistent with the extension's analysis.
    • CLI Dashboard: Launch the CLI dashboard and verify that it correctly displays the data from the generated output files.
  • Integrate E2E tests into the CI/CD pipeline, triggering them on every pull request.

  • Provide documentation on running and updating E2E tests.

Additional Information:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
5 participants