cypress: fixed flaky cypress for service specs (#11850)

* cypress: fixed flaky cypress for service specs

* updated teams cypress
This commit is contained in:
Shailesh Parmar 2023-06-01 21:27:26 +05:30 committed by GitHub
parent 2bff63fa18
commit 8b0df23b95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 10 deletions

View File

@ -129,10 +129,11 @@ export const handleIngestionRetry = (
if (retryCount !== 0) {
cy.wait('@allPermissions').then(() => {
verifyResponseStatusCode('@serviceDetails', 200);
verifyResponseStatusCode('@ingestionPipelines', 200);
verifyResponseStatusCode('@pipelineStatuses', 200, {
responseTimeout: 50000,
cy.wait('@serviceDetails').then(() => {
verifyResponseStatusCode('@ingestionPipelines', 200);
verifyResponseStatusCode('@pipelineStatuses', 200, {
responseTimeout: 50000,
});
});
});
}
@ -473,7 +474,11 @@ export const editOwnerforCreatedService = (
'/api/v1/system/config/pipeline-service-client',
'airflow'
);
interceptURL('GET', '/api/v1/databases?service=*&fields=*', 'database');
interceptURL(
'GET',
`/api/v1/*?service=${service_Name}&fields=*`,
'assetsDetail'
);
// click on created service
cy.get(`[data-testid="service-name-${service_Name}"]`)
.should('exist')
@ -483,9 +488,9 @@ export const editOwnerforCreatedService = (
verifyResponseStatusCode('@getSelectedService', 200);
verifyResponseStatusCode('@waitForIngestion', 200);
verifyResponseStatusCode('@airflow', 200);
if (isDatabaseService(service_type)) {
verifyResponseStatusCode('@database', 200);
}
verifyResponseStatusCode('@assetsDetail', 200);
interceptURL('GET', '/api/v1/users?&isBot=false&limit=15', 'waitForUsers');
// Click on edit owner button

View File

@ -11,6 +11,9 @@
* limitations under the License.
*/
// eslint-disable-next-line spaced-comment
/// <reference types="Cypress" />
import {
addTeam,
descriptionBox,
@ -94,7 +97,8 @@ describe('Teams flow should work properly', () => {
verifyResponseStatusCode('@getUserDetails', 200);
verifyResponseStatusCode('@getTeam', 200);
cy.get('[data-testid="edit-email"]').should('be.visible').click();
cy.get('[data-testid="edit-email"]').should('be.visible').scrollIntoView();
cy.get('[data-testid="edit-email"]').click();
cy.get('[data-testid="email-input"]')
.should('be.visible')
.clear()
@ -121,11 +125,18 @@ describe('Teams flow should work properly', () => {
.click();
verifyResponseStatusCode('@getUserDetails', 200);
verifyResponseStatusCode('@permissions', 200);
cy.get('[data-testid="add-new-user"]').should('be.visible').click();
cy.get('[data-testid="add-new-user"]')
.should('be.visible')
.scrollIntoView();
cy.get('[data-testid="add-new-user"]').click();
verifyResponseStatusCode('@getUsers', 200);
cy.get('[data-testid="selectable-list"]')
.find(`[title="${TEAM_DETAILS.username}"]`)
.click();
cy.get('[data-testid="selectable-list"]')
.find(`[title="${TEAM_DETAILS.username}"] input[type='checkbox']`)
.should('be.checked');
cy.get('[data-testid="selectable-list-update-btn"]')
.should('be.visible')
.click();