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

[feat] Ability to specify group name without modifying id. #85

Merged
merged 2 commits into from
Jul 12, 2021

Conversation

legander
Copy link
Collaborator

@legander legander commented Jul 9, 2021

HAR fragment (page with name property)

// Input
{
  "id": "group_0_id",
  "title": "Title",
  "name": "Name"
}

// Output
group("Name - Title", function () {
  response = http.get("https://test.k6.io/");
});

HAR fragment (page without name property). Still generating same code as before this PR.

// Input
{
  "id": "group_0_id",
  "title": "Title",
}

// Output
group("group_0_id - Title", function () {
  response = http.get("https://test.k6.io/");
});

@EdvinasDaugirdas
Copy link
Contributor

Can we also add a validation rule to be sure that name is always a string? Something similar to this:

https://github.com/k6io/har-to-k6/blob/e7084bd5adfd5ed39f51c1936c598a0ceec94fd0/src/validate/page.js#L50

Copy link
Contributor

@EdvinasDaugirdas EdvinasDaugirdas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@legander legander merged commit 42f08be into master Jul 12, 2021
@legander legander deleted the feat/custom-group-name-property branch July 12, 2021 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants