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

Report inconsistencies when using beforeAll and >1 workers #4

Open
LisBerndt opened this issue May 10, 2023 · 2 comments
Open

Report inconsistencies when using beforeAll and >1 workers #4

LisBerndt opened this issue May 10, 2023 · 2 comments

Comments

@LisBerndt
Copy link

LisBerndt commented May 10, 2023

When using beforeAll like this with more than one worker:

test.beforeAll(async ({ page }, testInfo) => {
    testInfo.annotations.push({ type: "test_key", description: "Ticket-foo" });
    ...
});
test("An amazing test", async ({
    page,
  }, testInfo) => {
    testInfo.annotations.push({ type: "test_key", description: "Ticket-bar" });
   ...
});

the report will look like this:

...
<properties>
<property name="test_key" value="Ticket-foo">
</property>
<property name="test_key" value="Ticket-bar">
</properties>
...

what will lead to inconsistencies in xray when importing the results. My only solution is: Just use 1 worker :-D

Is there a programmatic solution provided by you possible?

@LisBerndt LisBerndt changed the title Report inconsistency when using beforeAll and >1 workers Report inconsistencies when using beforeAll and >1 workers May 10, 2023
@bitcoder
Copy link
Contributor

hmm in your code you're adding the test_key annotation twice for every test right? Therefore I would expect that each testcase in the XML report to have 2 properties with the name test_key. So, I think the XML is correct for the code above, unless I missed something.
The problem, in my perspective, is that we're adding the same annotation multiple times; it should be only once.

@LisBerndt
Copy link
Author

hmm in your code you're adding the test_key annotation twice for every test right? Therefore I would expect that each testcase in the XML report to have 2 properties with the name test_key. So, I think the XML is correct for the code above, unless I missed something. The problem, in my perspective, is that we're adding the same annotation multiple times; it should be only once.

No problem with the xml; it's only about the workers issue...

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

No branches or pull requests

2 participants