Skip to content

Commit 5a6a2c1

Browse files
committed
Tests: Fix intercept order to ensure it's in place before the API call
1 parent 2f9eb37 commit 5a6a2c1

1 file changed

Lines changed: 28 additions & 28 deletions

File tree

tests/tests/lightspeed-install.cy.ts

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -788,22 +788,6 @@ metadata:
788788

789789
describe('ACM', { tags: ['@acm'] }, () => {
790790
it.skip('Test attach cluster info for ManagedCluster', () => {
791-
cy.visit(
792-
'/k8s/ns/test-cluster/cluster.open-cluster-management.io~v1~ManagedCluster/test-cluster',
793-
);
794-
cy.get(mainButton).click();
795-
cy.get(popover).should('exist');
796-
797-
// Test that the attach menu shows the option for ManagedCluster
798-
cy.get(attachButton).click();
799-
cy.get(attachMenu)
800-
.should('include.text', ACM_ATTACH_CLUSTER_TEXT)
801-
.should('include.text', 'Upload from computer')
802-
.should('not.include.text', 'Full YAML file')
803-
.should('not.include.text', 'Filtered YAML')
804-
.should('not.include.text', 'Events')
805-
.should('not.include.text', 'Logs');
806-
807791
// Mock the API call for ManagedCluster
808792
cy.intercept(
809793
'GET',
@@ -868,6 +852,22 @@ metadata:
868852
},
869853
).as('getManagedClusterInfo');
870854

855+
cy.visit(
856+
'/k8s/ns/test-cluster/cluster.open-cluster-management.io~v1~ManagedCluster/test-cluster',
857+
);
858+
cy.get(mainButton).click();
859+
cy.get(popover).should('exist');
860+
861+
// Test that the attach menu shows the option for ManagedCluster
862+
cy.get(attachButton).click();
863+
cy.get(attachMenu)
864+
.should('include.text', ACM_ATTACH_CLUSTER_TEXT)
865+
.should('include.text', 'Upload from computer')
866+
.should('not.include.text', 'Full YAML file')
867+
.should('not.include.text', 'Filtered YAML')
868+
.should('not.include.text', 'Events')
869+
.should('not.include.text', 'Logs');
870+
871871
cy.get(attachMenu).find('button').contains(ACM_ATTACH_CLUSTER_TEXT).click();
872872

873873
// Wait for both API calls
@@ -916,12 +916,6 @@ metadata:
916916
});
917917

918918
it.skip('Test ManagedCluster attachment error handling', () => {
919-
cy.visit(
920-
'/k8s/ns/test-cluster/cluster.open-cluster-management.io~v1~ManagedCluster/test-cluster',
921-
);
922-
cy.get(mainButton).click();
923-
cy.get(popover).should('exist');
924-
925919
// Mock successful ManagedCluster API call
926920
cy.intercept(
927921
'GET',
@@ -953,6 +947,12 @@ metadata:
953947
},
954948
).as('getManagedClusterInfoError');
955949

950+
cy.visit(
951+
'/k8s/ns/test-cluster/cluster.open-cluster-management.io~v1~ManagedCluster/test-cluster',
952+
);
953+
cy.get(mainButton).click();
954+
cy.get(popover).should('exist');
955+
956956
cy.get(attachButton).click();
957957
cy.get(attachMenu).find('button').contains(ACM_ATTACH_CLUSTER_TEXT).click();
958958

@@ -965,8 +965,6 @@ metadata:
965965
});
966966

967967
it('Test ACM search resources page context for Pod', () => {
968-
cy.visit('/multicloud/search/resources?kind=Pod&name=test-pod&namespace=test-namespace');
969-
970968
// Mock successful pod API call
971969
cy.intercept('GET', '/api/kubernetes/api/v1/namespaces/test-namespace/pods/test-pod', {
972970
statusCode: 200,
@@ -979,6 +977,8 @@ metadata:
979977
},
980978
}).as('getManagedCluster');
981979

980+
cy.visit('/multicloud/search/resources?kind=Pod&name=test-pod&namespace=test-namespace');
981+
982982
cy.get(mainButton).click();
983983
cy.get(popover).should('exist');
984984

@@ -993,10 +993,6 @@ metadata:
993993
});
994994

995995
it('Test ACM search resources page context for VirtualMachine', () => {
996-
cy.visit(
997-
'/multicloud/search/resources?kind=VirtualMachine&name=test-vm&namespace=test-namespace',
998-
);
999-
1000996
// Mock successful VirtualMachine API call
1001997
cy.intercept(
1002998
'GET',
@@ -1014,6 +1010,10 @@ metadata:
10141010
},
10151011
).as('getVirtualMachine');
10161012

1013+
cy.visit(
1014+
'/multicloud/search/resources?kind=VirtualMachine&name=test-vm&namespace=test-namespace',
1015+
);
1016+
10171017
cy.get(mainButton).click();
10181018
cy.get(popover).should('exist');
10191019

0 commit comments

Comments
 (0)