I'm using playwright 1.32 against a web application developed with Oracle Apex 20.2. I'm writing a dummy test (see below) just to learn how to control if the error message is shown, to make the test fail:
This is the result of bellow code. The yellow box indicates several errors:
When the button "Create" is clicked for second time, the page is submitted to the server and when it's rendered again, the yellow box is shown.
My problem is that if I run the test, I get the green arrow indicating that it's fine, but if I debug it slowly, I get the test failed (which is the expected overcome).
How should I fix this? Thanks, Jose.
test('check yellow notification', async ({ page }) => {
await page.goto('https://xxxxx.yyyyy.com/ords/f?p=500:1:8793700790638'); //8793700790638 is the value read from the SQL
//Go to application menu and click into Create button:
await page.getByRole('listitem').filter({ hasText: /^Projects$/ }).locator('span').first().click();
await page.getByRole('treeitem', { name: 'All Projects' }).click();
await page.getByRole('button', { name: 'Create' }).click();
//Do not fill any data, so all the mandatory field validations will be triggered
await page.getByRole('button', { name: 'Create' }).click();
//Check if error message is shown/not shown
const locator = page.locator('#t_Alert_Notification');
await expect(locator, 'Error amarillo visualizado').not.toBeVisible();
});