Rayrun
← Back to Discord Forum

test.describe() does not support async/await to generate test() ?

Linhtinh603posted in #help-playwright
Open in Discord
Linhtinh603
Linhtinh603

I have a code below:

test.describe('basic test', async () => { const testList = **await **getTestCaseByCsvFile();

for(let i = 0; i < testList.length; i++) {

**test**(testList[i].testName, async () => {
       // doSomething()
     });

} });

test function will not be generated after an async/await function (I removed the await, the test case can be generated.)

Does test.describe() not support async/await to generate test case? Please advise.

This thread is trying to answer question "Does test.describe() not support async/await to generate test case? How can this issue be fixed?"

4 replies
cherry_picker_01

test.describe function does not directly support the use of async/await to generate test cases.

Linhtinh603
Linhtinh603
@cherry_picker_01: What solution can i fix this issue? I use csv-parser to read csv file to generate test case.

What solution can i fix this issue? I use csv-parser to read csv file to generate test case.

Linhtinh603
Linhtinh603
@valkum: Thanks, i have updated csv-parser to csv-parse/sync. It worked.

Thanks, i have updated csv-parser to csv-parse/sync. It worked.

Related Discord Threads

TwitterGitHubLinkedIn
AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email luc@ray.run.