question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Unknown test(s) in worker

See original GitHub issue

Context:

  • Playwright Version: 1.22.2
  • Operating System: Windows 10
  • Node.js version: 14.18.1
  • Browser: All

Code Snippet

import { test } from '@playwright/test'
import * as faker from 'faker';

  test.only(`test with name ${faker.random.alpha({ count: 5 })}`, async ({ }) => {
    console.log('not working test');
  });

Describe the bug When running parameterized tests with randomly generated names using faker library tests are failing with the error “Unknown test(s) in worker:” It was working fine on version 1.20.2.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
patrickromo1commented, May 31, 2022

We have a similar use case but instead of random values we are sampling/iterating values such as states. For heavy data driven applications this is really useful because iterating over all the values without sampling would equate to thousands of tests and test suites running multiple times a day mitigates the risk of sampling because it slowly fills in the gaps. If playwright does not want to support this going forward it can be orchestrated at a higher level before test execution but it probably would not be as valuable.

import { _ } from 'lodash';

const states = _.sample(['AL', 'GA', 'IN', 'MO', 'NE', 'OR', 'PA', 'VA']);

for (const state of states) {
  test(`should do something in ${state}`, async ({ page }) => {
    console.log(`Do something in ${state}`);
  });
}
2reactions
szamaczcommented, May 27, 2022

What do you mean by “it was fixed in 1.22”? It was working for us until now (we have over 2k parametrized tests written in such a way) so by fixing something else looks like you introduced this regression. If from now on it is not possible to have parameterized tests with randomly generated names could you please advise how we can change our tests written like one below to have this working:

const uniqueValues = [
faker.random.alpha({ count: 5 }), 
faker.random.alpha({ count: 10 })
]
 for (const value of uniqueValues ) {
 test(`do smth with ${value} , async ({page }) => {
 await functionThatUse(value); 
  });
}

It is crucial in our case to use randomly generated test data and because parametrizing tests in playwright require to have unique test name till now this was the best option that we have found.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Allure plugin for VSTS returns error: Unknown Test Runner
The error is : Unable to process command '##vso[results.publish type=Allure;mergeResults=true;publishRunAttachments=true;resultFiles=D:\a\1\s\ ...
Read more >
Unit tests fail: ERROR Unknown test found in profile: B111
With a recent release of bandit tool, the current test configuration does not work anymore: pep8 runtests: commands[8] | bandit -r neutron ...
Read more >
Errors | Node.js v19.3.0 Documentation
AssertionError s are a special class of error that can be triggered when Node.js detects an exceptional logic violation that should never occur....
Read more >
Troubleshooting | Cypress Documentation
Run the same tests in both Electron and Chrome, then compare the ... However, probing for browsers across different environments can be error-prone....
Read more >
Known issues with Android Studio and Android Gradle Plugin
If you experience an issue not already included here, please report a bug. ... Running tests using Gradle from the command line will...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found