Skip to content

Pass multiple visualElements #4458

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

Open
2 tasks done
Amerousful opened this issue Mar 3, 2025 · 1 comment
Open
2 tasks done

Pass multiple visualElements #4458

Amerousful opened this issue Mar 3, 2025 · 1 comment
Labels

Comments

@Amerousful
Copy link
Contributor

Amerousful commented Mar 3, 2025

Have you read the documentation?

URL

https://imm-5257-form.com/

What are you trying to accomplish

Hello. I found an issue where only the latter passed value is accepted for flag --scriptInput.visualElements

Image

Sitespeed verison: 35.7.5-plus1

What browser did you use?

Chrome

How to reproduce

Nutshell:

  --plugins.remove="@sitespeed.io/plugin-gpsi" \
  --plugins.remove="@sitespeed.io/plugin-lighthouse" \

Full command:

docker run --rm \
  --name sitespeed_test \
  -v "$(pwd):/sitespeed.io" \
  sitespeedio/sitespeed.io:35.7.5-plus1 \
  https://imm-5257-form.com/ \
  --n 1 \
  --plugins.remove="@sitespeed.io/plugin-gpsi" \
  --plugins.remove="@sitespeed.io/plugin-lighthouse" \
  --plugins.list \
  --visualElements \
  --scriptInput.visualElements="CustomReadiness_1:.cta-button" \
  --scriptInput.visualElements="CustomReadiness_2:.header-logo__name" \
  --filmstrip.showAll \
  --browsertime.videoParams.filmstripFullSize=true

Log output

None
@soulgalore
Copy link
Member

Hi @Amerousful thank you for creating the issue. It seems like yargs handles input differently:

If you have a parameter like --test and add multiple ones, it automatically creates an array: --test 1 --test 2 becomes test: [1,2].

But if the key is like this: --a.test 1 --a.test 2 becomes a: { test: 2}.

For now I updated the documentation to recommend using a configuration file instead and then when I get the time I can check if I can make a PR to yargs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants