Skip to content

Commit e8201eb

Browse files
Update the case for disabled save button rangeFunctions.js #13
1 parent c861e47 commit e8201eb

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

tests/RPM/utils/rangeFunctions.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,9 @@ async function checkRangeConstraint(page, constraint, hasDescription, hasRangeTy
9999
else if (!constraint && !hasDescription && hasRangeType && hasLowerBoundValue && hasUpperBoundValue) {
100100
await page.waitForLoadState('load');
101101
await page.waitForTimeout(1000);
102-
// Check if the save button is enable and reload the page
103-
const saveButton = page.locator('button#save').click();
104-
await page.waitForSelector('.toast[data-testid=toast] .text-base');
105-
const toast = await page.locator('.toast[data-testid=toast]');
106-
107-
let expectedMessage = `Can't save Constraint "null" .Name is Null or Empty`;
108-
await expect(await toast.locator('.text-base')).toHaveText(expectedMessage);
109-
await toast.locator('button').click(); // Close the toast
102+
// Check if the save button is disabled and reload the page
103+
const saveButton = page.locator('button#save');
104+
await expect(saveButton).toBeDisabled();
110105
await page.reload();
111106
}
112107
}
@@ -168,7 +163,7 @@ async function editRangeDescription(page, constraint) {
168163
await page
169164
.locator('textarea[id=description]')
170165
.fill('Test constraint');
171-
// Wait for 500 milliseconds
166+
// Wait for 500 milliseconds
172167
await page.waitForTimeout(500);
173168
await page.locator('input[id=name]').fill(constraint);
174169

0 commit comments

Comments
 (0)