Reputation: 3
Recently, I got some error when running the E2E tests and the only change I made is adding the checkColumns logic in the original test code as following:
it('check search and sort', async () => {
await checkLoadingAndResult();
await checkColumns(table, ...columns); //newly added
await checkTableSorting();
});
The logic of checkColumns is like:
export async function checkColumns(table: Table, ...columns: string[]) {
for (const col of columns) {
expect(await table.isColumnDisplayed(col)).toBeTruthy(`${col} is not displayed`)
}
}
The error message is like:
Error: ECONNREFUSED connect ECONNREFUSED 127.0.0.1:59536
I think maybe there's something wrong in the checkColumns function and I don't know whether it's a correct way to call async methods inside a for-loop. And I guess this for-loop is the cause of the error.
Upvotes: 0
Views: 155
Reputation: 1200
This error message is not generated by your usage of async / await. It is most likely displayed because the HTTP request sent failed due to a connection error, I had the issue on another framework and it was due to the webdriver that was not running.
Upvotes: 1