Skip to content

Commit 507f8c6

Browse files
authored
Merge pull request #865 from hisanhunais/test-failues
Fix UI Test Failures
2 parents 77e16fd + d476fd0 commit 507f8c6

File tree

10 files changed

+92
-77
lines changed

10 files changed

+92
-77
lines changed

portals/admin/src/main/webapp/source/src/app/components/Throttling/Subscription/List.jsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ export default function ListSubscriptionThrottlingPolicies() {
300300
color='primary'
301301
endIcon={<ArrowDropDownIcon />}
302302
onClick={handleClick}
303+
data-testid='throttling-subscription-add-button'
303304
>
304305
<FormattedMessage
305306
id='Throttling.Subscription.Policy.List.addButtonProps.title'
@@ -316,13 +317,15 @@ export default function ListSubscriptionThrottlingPolicies() {
316317
onClick={() => handleMenuItemClick(false)}
317318
component={RouterLink}
318319
to={{ pathname: '/throttling/subscription/add', state: { isAI: false } }}
320+
data-testid='throttling-subscription-add-policy-menu-item'
319321
>
320322
Add Policy
321323
</MenuItem>
322324
<MenuItem
323325
onClick={() => handleMenuItemClick(true)}
324326
component={RouterLink}
325327
to={{ pathname: '/throttling/subscription/add', state: { isAI: true } }}
328+
data-testid='throttling-subscription-add-ai-policy-menu-item'
326329
>
327330
Add AI Policy
328331
</MenuItem>

portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/Endpoints/GeneralConfiguration/EndpointSecurity.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ function EndpointSecurity(props) {
107107
} = props;
108108
const [endpointSecurityInfo, setEndpointSecurityInfo] = useState(CONSTS.DEFAULT_ENDPOINT_SECURITY);
109109

110-
if (!(securityInfo?.proxyConfigs != null)) {
110+
if (securityInfo && securityInfo.proxyConfigs == null) {
111111
securityInfo.proxyConfigs = {
112112
proxyEnabled: false,
113113
proxyHost: '',

tests/cypress/fixtures/api_artifacts/advanceConfigFalse.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,5 +388,6 @@
388388
"SignUpRoles": [
389389
"Internal/subscriber"
390390
]
391-
}
391+
},
392+
"AllowSubscriptionValidationDisabling": false
392393
}

tests/cypress/fixtures/api_artifacts/advanceConfigTrue.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,5 +388,6 @@
388388
"SignUpRoles": [
389389
"Internal/subscriber"
390390
]
391-
}
391+
},
392+
"AllowSubscriptionValidationDisabling": false
392393
}

tests/cypress/fixtures/api_artifacts/tenant-conf.json

Lines changed: 75 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"EnableMonetization": false,
3-
"EnableRecommendation": false,
4-
"IsUnlimitedTierPaid": false,
2+
"EnableMonetization" : false,
3+
"EnableRecommendation" : false,
4+
"IsUnlimitedTierPaid" : false,
55
"ExtensionHandlerPosition": "bottom",
66
"RESTAPIScopes": {
77
"Scope": [
@@ -122,7 +122,7 @@
122122
"Roles": "admin,Internal/subscriber,Internal/devops"
123123
},
124124
{
125-
"Name": "apim:monetization_usage_publish",
125+
"Name" : "apim:monetization_usage_publish",
126126
"Roles": "admin, Internal/publisher"
127127
},
128128
{
@@ -265,6 +265,14 @@
265265
"Name": "apim:admin_operations",
266266
"Roles": "admin"
267267
},
268+
{
269+
"Name": "apim:keymanagers_manage",
270+
"Roles": "admin"
271+
},
272+
{
273+
"Name": "apim:api_category",
274+
"Roles": "admin"
275+
},
268276
{
269277
"Name": "apim:shared_scope_manage",
270278
"Roles": "admin"
@@ -302,122 +310,120 @@
302310
"Roles": "admin,Internal/creator"
303311
},
304312
{
305-
"Name": "apim:keymanagers_manage",
306-
"Roles": "admin"
313+
"Name": "apim:comment_view",
314+
"Roles": "admin,Internal/creator,Internal/publisher"
307315
},
308316
{
309-
"Name": "apim:api_category",
310-
"Roles": "admin"
317+
"Name": "apim:comment_write",
318+
"Roles": "admin,Internal/creator,Internal/publisher"
311319
},
312320
{
313-
"Name": "apim:policies_import_export",
314-
"Roles": "admin,Internal/devops"
321+
"Name": "apim:comment_manage",
322+
"Roles": "admin,Internal/creator,Internal/publisher"
315323
},
316324
{
317-
"Name": "apim:admin_tier_manage",
318-
"Roles": "admin"
325+
"Name": "apim:throttling_policy_manage",
326+
"Roles": "admin,Internal/publisher,Internal/creator,Internal/analytics"
319327
},
320328
{
321-
"Name": "apim:admin_tier_view",
329+
"Name": "apim:admin_application_view",
322330
"Roles": "admin"
323331
},
324332
{
325-
"Name": "apim:api_provider_change",
326-
"Roles": "admin"
333+
"Name": "apim:api_list_view",
334+
"Roles": "Internal/integration_dev"
327335
},
328336
{
329-
"Name": "apim:gateway_policy_manage",
330-
"Roles": "admin"
337+
"Name": "apim:api_definition_view",
338+
"Roles": "Internal/integration_dev"
331339
},
332340
{
333-
"Name": "apim:gateway_policy_view",
341+
"Name": "apim:common_operation_policy_view",
334342
"Roles": "admin,Internal/creator,Internal/publisher,Internal/observer"
335343
},
336344
{
337-
"Name": "apim:comment_view",
338-
"Roles": "admin,Internal/creator,Internal/publisher"
345+
"Name": "apim:common_operation_policy_manage",
346+
"Roles": "admin,Internal/creator"
339347
},
340348
{
341-
"Name": "apim:comment_write",
342-
"Roles": "admin,Internal/creator,Internal/publisher"
349+
"Name": "apim:policies_import_export",
350+
"Roles": "admin,Internal/devops"
343351
},
344352
{
345-
"Name": "apim:comment_manage",
346-
"Roles": "admin,Internal/creator,Internal/publisher"
353+
"Name": "apim:admin_tier_manage",
354+
"Roles": "admin"
347355
},
348356
{
349-
"Name": "apim:throttling_policy_manage",
350-
"Roles": "admin,Internal/publisher,Internal/creator,Internal/analytics"
357+
"Name": "apim:admin_tier_view",
358+
"Roles": "admin"
351359
},
352360
{
353-
"Name": "apim:admin_application_view",
361+
"Name": "apim:api_provider_change",
354362
"Roles": "admin"
355363
},
356364
{
357-
"Name": "apim:api_list_view",
358-
"Roles": "Internal/integration_dev"
365+
"Name": "apim:gateway_policy_manage",
366+
"Roles": "admin"
359367
},
360368
{
361-
"Name": "apim:api_definition_view",
362-
"Roles": "Internal/integration_dev"
369+
"Name": "apim:gateway_policy_view",
370+
"Roles": "admin,Internal/creator,Internal/publisher,Internal/observer"
363371
},
364372
{
365-
"Name": "apim:common_operation_policy_view",
366-
"Roles": "admin,Internal/creator,Internal/publisher,Internal/observer"
373+
"Name": "apim:llm_provider_manage",
374+
"Roles": "admin"
367375
},
368376
{
369-
"Name": "apim:common_operation_policy_manage",
370-
"Roles": "admin,Internal/creator"
377+
"Name": "apim:llm_provider_read",
378+
"Roles": "admin,Internal/publisher,Internal/creator"
371379
}
372380
]
373381
},
374-
"Meta": {
382+
"Meta" : {
375383
"Migration": {
376384
"3.0.0": true
377385
}
378386
},
379-
"NotificationsEnabled": "false",
380-
"Notifications": [
381-
{
382-
"Type": "new_api_version",
383-
"Notifiers": [
384-
{
385-
"Class": "org.wso2.carbon.apimgt.impl.notification.NewAPIVersionEmailNotifier",
386-
"ClaimsRetrieverImplClass": "org.wso2.carbon.apimgt.impl.token.DefaultClaimsRetriever",
387-
"Title": "Version $2 of $1 Released",
388-
"Template": " <html> <body> <h3 style=\"color:Black;\">We’re happy to announce the arrival of the next major version $2 of $1 API which is now available in Our API Store.</h3><a href=\"https://localhost:9443/store\">Click here to Visit WSO2 API Store</a></body></html>"
389-
}
390-
]
391-
}
387+
"NotificationsEnabled":"false",
388+
"Notifications":[{
389+
"Type":"new_api_version",
390+
"Notifiers" :[{
391+
"Class":"org.wso2.carbon.apimgt.impl.notification.NewAPIVersionEmailNotifier",
392+
"ClaimsRetrieverImplClass":"org.wso2.carbon.apimgt.impl.token.DefaultClaimsRetriever",
393+
"Title": "Version $2 of $1 Released",
394+
"Template": " <html> <body> <h3 style=\"color:Black;\">We’re happy to announce the arrival of the next major version $2 of $1 API which is now available in Our API Store.</h3><a href=\"https://localhost:9443/devportal\">Click here to Visit WSO2 API Store</a></body></html>"
395+
}]
396+
}
392397
],
393-
"DefaultRoles": {
394-
"PublisherRole": {
395-
"CreateOnTenantLoad": true,
396-
"RoleName": "Internal/publisher"
398+
"DefaultRoles" : {
399+
"PublisherRole" : {
400+
"CreateOnTenantLoad" : true,
401+
"RoleName" : "Internal/publisher"
397402
},
398-
"CreatorRole": {
399-
"CreateOnTenantLoad": true,
400-
"RoleName": "Internal/creator"
403+
"CreatorRole" : {
404+
"CreateOnTenantLoad" : true,
405+
"RoleName" : "Internal/creator"
401406
},
402-
"SubscriberRole": {
403-
"CreateOnTenantLoad": true
407+
"SubscriberRole" : {
408+
"CreateOnTenantLoad" : true
404409
},
405-
"DevOpsRole": {
406-
"CreateOnTenantLoad": true,
407-
"RoleName": "Internal/devops"
410+
"DevOpsRole" : {
411+
"CreateOnTenantLoad" : true,
412+
"RoleName" : "Internal/devops"
408413
},
409-
"ObserverRole": {
410-
"CreateOnTenantLoad": true,
411-
"RoleName": "Internal/observer"
414+
"ObserverRole" : {
415+
"CreateOnTenantLoad" : true,
416+
"RoleName" : "Internal/observer"
412417
},
413-
"IntegrationDeveloperRole": {
414-
"CreateOnTenantLoad": true,
415-
"RoleName": "Internal/integration_dev"
418+
"IntegrationDeveloperRole" : {
419+
"CreateOnTenantLoad" : true,
420+
"RoleName" : "Internal/integration_dev"
416421
}
417422
},
418423
"SelfSignUp": {
419424
"SignUpRoles": [
420425
"Internal/subscriber"
421426
]
422-
}
423-
}
427+
},
428+
"AllowSubscriptionValidationDisabling": false
429+
}

tests/cypress/integration/admin/03-add-edit-delete-subscription-throttle-policies.spec.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ describe("Add Edit Delete subscription throttle policies", () => {
2727
const policyName = 'Platinum';
2828
cy.get('[data-testid="Subscription Policies-child-link"]').click();
2929
cy.get('[data-testid="throttling-subscription-add-button"]').contains('Add Policy').click();
30+
cy.get('[data-testid="throttling-subscription-add-policy-menu-item"]').click();
3031
cy.get('input[name="policyName"]').type(policyName);
3132
cy.get('textarea[name="description"]').type('Allows 10k requests per minute');
3233
cy.get('input[name="requestCount"]').type('10000');

tests/cypress/integration/publisher/011-lifecycle/01-block-demote-to-created-depricate-api.spec.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,12 @@ describe("Lifecycle changes", () => {
104104
// Deprecate
105105

106106
cy.get('button[data-testid="Deprecate-btn"]', {timeout: Cypress.config().largeTimeout}).click();
107+
cy.get('#itest-id-conf', {timeout: Cypress.config().largeTimeout}).contains('DEPRECATE').click();
108+
107109
cy.get('button[data-testid="Retire-btn"]').should('exist');
108110
cy.wait(2000);
109-
110-
cy.get('button[data-testid="Retire-btn"]', {timeout: Cypress.config().largeTimeout}).click();
111+
cy.get('button[data-testid="Retire-btn"]', {timeout: Cypress.config().largeTimeout}).click();
112+
cy.get('#itest-id-conf', {timeout: Cypress.config().largeTimeout}).contains('RETIRE').click();
111113
});
112114
});
113115
afterEach(() => {

tests/cypress/integration/publisher/011-lifecycle/04-depricate-old-versions.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ describe("Depricate old versions of api before publishing", () => {
104104
timeout: Cypress.config().largeTimeout,
105105
}).click();
106106
cy.wait(3000);
107-
cy.get(`div[data-testid="card-action-${apiName}1.0.0"]>div>span`, {
107+
cy.get(`div[data-testid="card-action-${apiName}1.0.0"]>div>div>span`, {
108108
timeout: Cypress.config().largeTimeout,
109109
})
110110
.contains("DEPRECATED")

tests/cypress/integration/publisher/018-third-party-api/00-publish-third-party-api.spec.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ describe("Publish thirdparty api", () => {
9797
cy.get('#left-menu-itemsubscriptions').click();
9898
cy.get('[name="Unlimited"]').click();
9999
cy.get('#subscriptions-save-btn').click();
100+
cy.get('#disable-sub-validation-yes-btn').click();
100101
cy.get('#itest-api-details-portal-config-acc').click();
101102
cy.get('#itest-api-details-api-config-acc').click();
102103
cy.get('#left-menu-itemRuntimeConfigurations').should('exist');
@@ -129,7 +130,7 @@ describe("Publish thirdparty api", () => {
129130
cy.get(`div[data-testid="card-action-${apiName}1.0.0"]`, {timeout: Cypress.config().largeTimeout})
130131
.click();
131132
cy.wait(3000)
132-
cy.get(`div[data-testid="card-action-${apiName}1.0.0"]>div>span`,
133+
cy.get(`div[data-testid="card-action-${apiName}1.0.0"]>div>div>span`,
133134
{timeout: Cypress.config().largeTimeout})
134135
.contains('PUBLISHED').should('exist');
135136

tests/cypress/support/commands.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ Cypress.Commands.add('modifyGraphqlSchemaDefinition', (filepath) => {
466466
cy.get('#import-open-api-btn').click();
467467
cy.get('#import-open-api-btn').should('not.exist')
468468
const searchCmd = Cypress.platform === 'darwin' ? '{cmd}f' : '{ctrl}f'
469-
cy.get('.react-monaco-editor-container', { timeout: 30000 }).get('.monaco-editor textarea:first')
469+
cy.get('.monaco-scrollable-element', { timeout: 30000 }).get('.monaco-editor textarea:first')
470470
.type(searchCmd, { force: true });
471471
cy.get('.find-part .input').type('modified schema file');
472472
cy.contains('.find-actions', '1 of').should('be.visible');

0 commit comments

Comments
 (0)