Skip to content

Commit 9d43f2c

Browse files
update the failing test case #24
1 parent 562f46d commit 9d43f2c

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

tests/RPM/utils/patternFunctions.js

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ async function checkPatternConstraint(page, constraint, hasDescription, hasPatte
2727

2828
// Fill in the name and description if provided
2929
if (constraint) {
30-
await page.locator('input[id=name]').fill(constraint);
30+
await page.locator('#name').fill(constraint);
3131
}
3232
if (hasDescription) {
3333
await page.locator('textarea[id=description]').fill('Test constraint');
@@ -101,17 +101,12 @@ async function checkPatternConstraint(page, constraint, hasDescription, hasPatte
101101
else if (!constraint && !hasDescription && hasPatternType && hasExpInput) {
102102
await page.waitForLoadState('load');
103103
await page.waitForTimeout(1500);
104-
// Click on save button and wait for toast message
105-
await page.click('#save');
104+
// Check if the save button is disabled and reload the page
105+
const saveButton = page.locator('button#save');
106+
await expect(saveButton).toBeDisabled();
107+
await page.reload();
106108
// Set the value
107-
await page.waitForSelector('.toast[data-testid=toast] .text-base');
108-
const toast = await page.locator('.toast[data-testid=toast]');
109-
let expectedMessage = "Can't save Constraint \"null\" .Name is Null or Empty";
110-
111-
await expect(await toast.locator('.text-base')).toHaveText(expectedMessage);
112-
await toast.locator('button').click(); // Close the toast
113109
handler.constraintDelete = true;
114-
await page.reload();
115110

116111
}
117112
}

0 commit comments

Comments
 (0)