Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Naseem77 committed Jan 27, 2025
1 parent 5a75ad8 commit e734415
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
1 change: 1 addition & 0 deletions e2e/config/settingsConfigData.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
],
"roleModificationData": [
{"role": "MAX_QUEUED_QUERIES", "description": "modify maxQueuedQueries", "input": "24", "expected": true},
{"role": "TIMEOUT", "description": "modify timeOut", "input": "1001", "expected": true},
{"role": "TIMEOUT_MAX", "description": "modify maxTimeOut", "input": "1", "expected": true},
{"role": "TIMEOUT_DEFAULT", "description": "modify defaultTimeOut", "input": "1", "expected": true},
{"role": "RESULTSET_SIZE", "description": "modify resultSetSize", "input": "10001", "expected": true},
Expand Down
18 changes: 16 additions & 2 deletions e2e/tests/settingsConfig.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,21 @@ test.describe('Settings Tests', () => {
});
})

Data.inputDataAcceptsZero.forEach(({ input, description, expected }, index) => {
test(`@admin Modify ${roles.maxQueuedQueries} via API validation via UI: Input value: ${input} description: ${description}`, async () => {
const settingsConfigPage = await browser.createNewPage(SettingsConfigPage, urls.settingsUrl)
const apiCall = new ApiCalls()
await new Promise(resolve => { setTimeout(resolve, 1000) });
await apiCall.modifySettingsRole(roles.TimeOut, input)
await settingsConfigPage.refreshPage()
const value = await settingsConfigPage.getRoleContentValue(roles.TimeOut)
expect(value === input).toBe(expected);
if (index === Data.inputDataAcceptsZero.length - 1) {
await apiCall.modifySettingsRole(roles.TimeOut, "1000")
}
});
})

Data.maxTimeOut.forEach(({ input, description, expected }, index) => {
test(`@admin Modify ${roles.maxTimeOut} via API validation via UI: Input value: ${input} description: ${description}`, async () => {
const settingsConfigPage = await browser.createNewPage(SettingsConfigPage, urls.settingsUrl)
Expand Down Expand Up @@ -143,13 +158,12 @@ test.describe('Settings Tests', () => {
expect(value === input).toBe(expected);
if (index === Data.roleModificationData.length - 1) {
await apiCall.modifySettingsRole(roles.maxQueuedQueries, "25")
await apiCall.modifySettingsRole(roles.TimeOut, "1000")
await apiCall.modifySettingsRole(roles.maxTimeOut, "0")
await apiCall.modifySettingsRole(roles.defaultTimeOut, "0")
await apiCall.modifySettingsRole(roles.resultSetSize, "10000")
await apiCall.modifySettingsRole(roles.queryMemCapacity, "0")
await apiCall.modifySettingsRole(roles.vKeyMaxEntityCount, "100000")
await apiCall.modifySettingsRole(roles.queryMemCapacity, "0")
await apiCall.modifySettingsRole(roles.vKeyMaxEntityCount, "100000")
await apiCall.modifySettingsRole(roles.cmdInfo, "yes")
await apiCall.modifySettingsRole(roles.queryMemCapacity, "1000")
}
Expand Down

0 comments on commit e734415

Please sign in to comment.