-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cypress e2e Test - Verify That "Usage Data Collection" Can Be Set In …
…"Cluster Settings" (#3647) * adding new test * add additional tag
- Loading branch information
Showing
2 changed files
with
57 additions
and
1 deletion.
There are no files selected for viewing
56 changes: 56 additions & 0 deletions
56
...src/__tests__/cypress/cypress/tests/e2e/settings/clusterSettings/testDataCollection.cy.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import { HTPASSWD_CLUSTER_ADMIN_USER } from '~/__tests__/cypress/cypress/utils/e2eUsers'; | ||
import { | ||
clusterSettings, | ||
telemetrySettings, | ||
} from '~/__tests__/cypress/cypress/pages/clusterSettings'; | ||
import { getCustomResource } from '~/__tests__/cypress/cypress/utils/oc_commands/customResources'; | ||
|
||
describe('Verify That Usage Data Collection Can Be Set In Cluster Settings', () => { | ||
let skipTest = false; | ||
|
||
before(() => { | ||
// Check if the operator is RHOAI, if its not, skip the test | ||
cy.step('Check if the operator is RHOAI'); | ||
getCustomResource('redhat-ods-operator', 'Deployment', 'name=rhods-operator').then((result) => { | ||
if (!result.stdout.includes('rhods-operator')) { | ||
cy.log('RHOAI operator not found, skipping the test.'); | ||
skipTest = true; | ||
} else { | ||
cy.log('RHOAI operator confirmed:', result.stdout); | ||
} | ||
}); | ||
}); | ||
|
||
it( | ||
'Verify Usage Data Collection can be Enabled/Disabled', | ||
{ tags: ['@Sanity', '@SanitySet1', '@ODS-1218', '@Dashboard', '@ExcludeOnODH'] }, | ||
() => { | ||
if (skipTest) { | ||
cy.log('Skipping test confirmed'); | ||
return; | ||
} | ||
|
||
// Authentication and navigation | ||
cy.step('Log into the application'); | ||
cy.visitWithLogin('/', HTPASSWD_CLUSTER_ADMIN_USER); | ||
clusterSettings.navigate(); | ||
|
||
// Check that usage data collection is enabled by default | ||
cy.step('Data collection is enabled'); | ||
telemetrySettings.findEnabledCheckbox().should('be.checked'); | ||
|
||
// Disable data usage collection | ||
cy.step('Disable usage data collection'); | ||
telemetrySettings.findEnabledCheckbox().click(); | ||
|
||
// Save changes in cluster settings | ||
cy.step('Save changes and wait for changes to be applied'); | ||
clusterSettings.findSubmitButton().click(); | ||
|
||
// Refresh and verify data collection is still disabled | ||
cy.step('Refresh settings view'); | ||
cy.reload(); | ||
telemetrySettings.findEnabledCheckbox().should('not.be.checked'); | ||
}, | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters