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

Add a Playwright fixture that allows retrieving POST request parameters #1992

Closed
obulat opened this issue May 3, 2023 · 1 comment · Fixed by #2449
Closed

Add a Playwright fixture that allows retrieving POST request parameters #1992

obulat opened this issue May 3, 2023 · 1 comment · Fixed by #2449
Labels
🤖 aspect: dx Concerns developers' experience with the codebase ✨ goal: improvement Improvement to an existing user-facing feature 🟩 priority: low Low priority and doesn't need to be rushed 🧱 stack: frontend Related to the Nuxt frontend

Comments

@obulat
Copy link
Contributor

obulat commented May 3, 2023

Problem

Currently, we use the following code to extract the Analytics payloads from POST requests in Playwright tests:

 page.on("request", (req) => {
    if (req.method() === "POST") {
      const requestData = req.postDataJSON()
      if (requestData?.n == "SELECT_EXTERNAL_SOURCE") {
        eventData = JSON.parse(requestData?.p)
      }
    }
  })

This code is repeated in every test that tests analytics.

Description

Abstract this out into a utility or custom Playwright fixture that provides this more generally (like a list of all events that get sent that can be asserted against).

Alternatives

Additional context

Based on quote from @sarayourfriend 's comment

@obulat obulat added 🟩 priority: low Low priority and doesn't need to be rushed ✨ goal: improvement Improvement to an existing user-facing feature 🤖 aspect: dx Concerns developers' experience with the codebase 🧱 stack: frontend Related to the Nuxt frontend labels May 3, 2023
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Openverse Backlog May 3, 2023
@zackkrida
Copy link
Member

Added in #1158

@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Openverse Backlog Jun 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖 aspect: dx Concerns developers' experience with the codebase ✨ goal: improvement Improvement to an existing user-facing feature 🟩 priority: low Low priority and doesn't need to be rushed 🧱 stack: frontend Related to the Nuxt frontend
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants