Add waitForNavigation on Continue clicking

This commit is contained in:
Veljko 2021-04-09 11:48:17 +02:00
parent bc40163155
commit bdd9fe7318
1 changed files with 5 additions and 2 deletions

View File

@ -43,8 +43,11 @@ const runImportProductsTest = () => {
await merchant.openImportProducts();
});
it('should show error message if you go without providing CSV file', async () => {
// Verify error message if you go without providing CSV file
await expect(page).toClick('button[value="Continue"]');
// Verify the error message if you go without providing CSV file
await Promise.all( [
page.click( 'button[value="Continue"]' ),
page.waitForNavigation( { waitUntil: 'networkidle0' } ),
]);
await page.waitForSelector('div.error');
await expect(page).toMatchElement('div.error > p', errorMessage);
});