Skip to content

Commit

Permalink
Merge pull request #1247 from bipuladh/enhance-tests
Browse files Browse the repository at this point in the history
Reduce number of refreshes in tests
  • Loading branch information
openshift-merge-bot[bot] authored Mar 12, 2024
2 parents 7bc97d8 + 4f82052 commit efff5b7
Show file tree
Hide file tree
Showing 10 changed files with 7 additions and 21 deletions.
11 changes: 2 additions & 9 deletions cypress/tests/block-pool.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,21 +102,14 @@ describe('Tests form validations on BlockPool', () => {
cy.login();
cy.visit('/');
cy.install();
navigateToBlockPool();
cy.byTestID('item-create').click();
});

after(() => {
cy.logout();
});

beforeEach(() => {
navigateToBlockPool();
});

beforeEach(() => {
navigateToBlockPool();
cy.byTestID('item-create').click();
});

fieldValidationOnWizardFormsTests(
nameFieldTestId,
'Create',
Expand Down
2 changes: 0 additions & 2 deletions cypress/tests/create-backing-store.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ describe('Tests creation of Backing Stores', () => {
});

beforeEach(() => {
cy.visit('/');
commonFlows.navigateToObjectStorage();
cy.byTestID('horizontal-link-Backing Store').first().click();
cy.byTestID('item-create').click();
Expand All @@ -47,7 +46,6 @@ describe('Tests form validations on Backing Stores', () => {
});

beforeEach(() => {
cy.visit('/');
commonFlows.navigateToObjectStorage();
cy.byTestID('horizontal-link-Backing Store').first().click();
cy.byTestID('item-create').click();
Expand Down
1 change: 0 additions & 1 deletion cypress/tests/expand-pvc.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ describe('Tests Expansion of a PVC', () => {
});

beforeEach(() => {
cy.visit('/');
cy.clickNavLink(['Storage', 'PersistentVolumeClaims']);
});

Expand Down
1 change: 0 additions & 1 deletion cypress/tests/multiple-pool.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ describe('Test Ceph pool creation', () => {
});

it('Check for a new pool creation', () => {
cy.visit('/');
cy.clickNavLink(['Storage', 'StorageClasses']);
cy.byTestID('item-create').click();

Expand Down
1 change: 0 additions & 1 deletion cypress/tests/namespace-store.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ describe('Tests creation of Namespace Stores', () => {
});

beforeEach(() => {
cy.visit('/');
commonFlows.navigateToObjectStorage();
cy.byTestID('horizontal-link-Namespace Store').first().click();
cy.byTestID('item-create').click();
Expand Down
1 change: 0 additions & 1 deletion cypress/tests/obc-test.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ describe('Tests form validations on Object Bucket Claim', () => {
});

beforeEach(() => {
cy.visit('/');
obcNavigate.navigateToOBC();
cy.byTestID('item-create').click();
});
Expand Down
1 change: 0 additions & 1 deletion cypress/views/bc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ export const deleteBucketClass = () => {
};

export const visitBucketClassPage = () => {
cy.visit('/');
commonFlows.navigateToObjectStorage();
cy.log(
'Planning to start testing for standard bucket class visitBucketClassPage ....'
Expand Down
7 changes: 3 additions & 4 deletions cypress/views/block-pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const navigateToBlockPool = () => {
};

export const populateBlockPoolForm = () => {
cy.byTestID('new-pool-name-textbox').type(poolName);
cy.byTestID('new-pool-name-textbox').clear().type(poolName);
cy.byTestID('replica-dropdown').click();
cy.byLegacyTestID('replica-dropdown-item')
.contains(`${replicaCount}-way Replication`)
Expand Down Expand Up @@ -107,7 +107,6 @@ export const openBlockPoolKebab = (
cy.byLegacyTestID('item-filter').clear().type(targetPoolName);
cy.log('Only one resource should be present after filtering');
cy.byTestID('kebab-button').should('have.length', 1);
if (isDefaultPool)
cy.byTestID('kebab-button').first().find('button').should('be.disabled');
else cy.byTestID('kebab-button').first().click();
if (isDefaultPool) cy.byTestID('kebab-button').should('be.disabled');
else cy.byTestID('kebab-button').click();
};
2 changes: 1 addition & 1 deletion cypress/views/list-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const listPage = {
.contains(resourceName)
.parents('tr')
.within(() => {
cy.get('[data-test-id="kebab-button"]').click();
cy.get('[data-test="kebab-button"]').click();
});
cy.byTestActionID(actionName).click();
},
Expand Down
1 change: 1 addition & 0 deletions packages/shared/src/kebab/kebab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ export const Kebab: React.FC<KebabProps> & KebabStaticProperties = ({
onClick={() => setOpen((o) => !o)}
isExpanded={isOpen}
data-test="kebab-button"
isDisabled={isDisabled}
>
{toggleType === 'Kebab' ? <EllipsisVIcon /> : t('Actions')}
</MenuToggle>
Expand Down

0 comments on commit efff5b7

Please sign in to comment.