forked from wso2/apim-apps
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request wso2#400 from binodmx/main
Add UI test to verify gateway environments
- Loading branch information
Showing
5 changed files
with
236 additions
and
2 deletions.
There are no files selected for viewing
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
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
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,40 @@ | ||
{ | ||
"count": 1, | ||
"list": [ | ||
{ | ||
"displayName": "Revision 1", | ||
"id": "1f4733db-2c48-449a-9fea-e5fd7068430a", | ||
"description": "test", | ||
"createdTime": 1670230943000, | ||
"apiInfo": { | ||
"id": "e2e5c296-0569-4074-9794-974131b65363" | ||
}, | ||
"deploymentInfo": [ | ||
{ | ||
"revisionUuid": "1f4733db-2c48-449a-9fea-e5fd7068430a", | ||
"name": "Default", | ||
"vhost": "localhost", | ||
"displayOnDevportal": true, | ||
"deployedTime": 1670230943000, | ||
"successDeployedTime": null | ||
}, | ||
{ | ||
"revisionUuid": "1f4733db-2c48-449a-9fea-e5fd7068430a", | ||
"name": "WSO2", | ||
"vhost": "wso2.com", | ||
"displayOnDevportal": true, | ||
"deployedTime": 1670230943000, | ||
"successDeployedTime": null | ||
}, | ||
{ | ||
"revisionUuid": "1f4733db-2c48-449a-9fea-e5fd7068430a", | ||
"name": "APIM", | ||
"vhost": "apim.com", | ||
"displayOnDevportal": true, | ||
"deployedTime": 1670230943000, | ||
"successDeployedTime": null | ||
} | ||
] | ||
} | ||
] | ||
} |
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,132 @@ | ||
{ | ||
"devportalUrl": "https://localhost:9443/devportal", | ||
"environment": [ | ||
{ | ||
"id": "Default", | ||
"name": "Default", | ||
"displayName": "Default", | ||
"type": "hybrid", | ||
"serverUrl": "https://localhost:9443/services/", | ||
"provider": "wso2", | ||
"showInApiConsole": true, | ||
"vhosts": [ | ||
{ | ||
"host": "localhost", | ||
"httpContext": "", | ||
"httpPort": 8280, | ||
"httpsPort": 8243, | ||
"wsPort": 9099, | ||
"wssPort": 8099, | ||
"websubHttpPort": 9021, | ||
"websubHttpsPort": 8021 | ||
} | ||
], | ||
"endpointURIs": [], | ||
"additionalProperties": [] | ||
}, | ||
{ | ||
"id": "WSO2", | ||
"name": "WSO2", | ||
"displayName": "WSO2", | ||
"type": "hybrid", | ||
"serverUrl": "https://localhost:9443/services/", | ||
"provider": "wso2", | ||
"showInApiConsole": true, | ||
"vhosts": [ | ||
{ | ||
"host": "wso2.com", | ||
"httpContext": "", | ||
"httpPort": -1, | ||
"httpsPort": 443, | ||
"wsPort": 9100, | ||
"wssPort": 8100, | ||
"websubHttpPort": 9022, | ||
"websubHttpsPort": 8022 | ||
} | ||
], | ||
"endpointURIs": [], | ||
"additionalProperties": [] | ||
}, | ||
{ | ||
"id": "APIM", | ||
"name": "APIM", | ||
"displayName": "APIM", | ||
"type": "hybrid", | ||
"serverUrl": "https://localhost:9443/services/", | ||
"provider": "wso2", | ||
"showInApiConsole": true, | ||
"vhosts": [ | ||
{ | ||
"host": "apim.com", | ||
"httpContext": "", | ||
"httpPort": 8280, | ||
"httpsPort": -1, | ||
"wsPort": 9100, | ||
"wssPort": 8100, | ||
"websubHttpPort": 9022, | ||
"websubHttpsPort": 8022 | ||
} | ||
], | ||
"endpointURIs": [], | ||
"additionalProperties": [] | ||
} | ||
], | ||
"scopes": [ | ||
"apim:admin", | ||
"apim:api_create", | ||
"apim:api_definition_view", | ||
"apim:api_delete", | ||
"apim:api_generate_key", | ||
"apim:api_import_export", | ||
"apim:api_list_view", | ||
"apim:api_manage", | ||
"apim:api_mediation_policy_manage", | ||
"apim:api_product_import_export", | ||
"apim:api_publish", | ||
"apim:api_view", | ||
"apim:app_import_export", | ||
"apim:client_certificates_add", | ||
"apim:client_certificates_manage", | ||
"apim:client_certificates_update", | ||
"apim:client_certificates_view", | ||
"apim:comment_manage", | ||
"apim:comment_view", | ||
"apim:comment_write", | ||
"apim:common_operation_policy_manage", | ||
"apim:common_operation_policy_view", | ||
"apim:document_create", | ||
"apim:document_manage", | ||
"apim:ep_certificates_add", | ||
"apim:ep_certificates_manage", | ||
"apim:ep_certificates_update", | ||
"apim:ep_certificates_view", | ||
"apim:mediation_policy_create", | ||
"apim:mediation_policy_manage", | ||
"apim:mediation_policy_view", | ||
"apim:pub_alert_manage", | ||
"apim:publisher_settings", | ||
"apim:shared_scope_manage", | ||
"apim:subscription_block", | ||
"apim:subscription_manage", | ||
"apim:subscription_view", | ||
"apim:threat_protection_policy_create", | ||
"apim:threat_protection_policy_manage", | ||
"apim:tier_manage", | ||
"apim:tier_view", | ||
"openid" | ||
], | ||
"monetizationAttributes": [], | ||
"securityAuditProperties": { | ||
"isGlobal": null, | ||
"overrideGlobal": null, | ||
"apiToken": null, | ||
"collectionId": null, | ||
"baseUrl": null | ||
}, | ||
"externalStoresEnabled": false, | ||
"docVisibilityEnabled": false, | ||
"crossTenantSubscriptionEnabled": false, | ||
"defaultAdvancePolicy": "Unlimited", | ||
"defaultSubscriptionPolicy": "Unlimited", | ||
"authorizationHeader": "Authorization" | ||
} |
62 changes: 62 additions & 0 deletions
62
tests/cypress/integration/publisher/015-deployments/02-verify-gateway-environments.spec.js
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,62 @@ | ||
/* | ||
* Copyright (c) 2022, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. | ||
* | ||
* WSO2 Inc. licenses this file to you under the Apache License, | ||
* Version 2.0 (the "License"); you may not use this file except | ||
* in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import Utils from "@support/utils"; | ||
|
||
describe("publisher-015-02 : Verify Gateway Environments", () => { | ||
const { publisher, password, superTenant, testTenant} = Utils.getUserInfo(); | ||
|
||
const verifyGatewayEnvironments = (tenant) => { | ||
cy.loginToPublisher(publisher, password, tenant); | ||
Utils.addAPIWithEndpoints({}).then((apiId) => { | ||
cy.intercept('GET', `/api/am/publisher/v3/settings`, {fixture:'multipleEnvironments.json'}).as('settings'); | ||
cy.intercept('GET', `/api/am/publisher/v3/apis/${apiId}/revisions?query=deployed%3Atrue`, | ||
{fixture:'multipleDeployments.json'}).as('revisions'); | ||
|
||
// Go to overview page | ||
cy.visit(`/publisher/apis/${apiId}/overview`); | ||
|
||
// Go to deployments page | ||
cy.get('#left-menu-itemdeployments').click(); | ||
cy.wait(2000); | ||
|
||
// Deploy API | ||
cy.get('#Default').click({ "force": true }); | ||
cy.get('#add-description-btn').scrollIntoView().click({ "force": true }); | ||
cy.get('#add-description').click({ "force": true }); | ||
cy.get('#add-description').type('test'); | ||
cy.get('#deploy-btn').should('not.have.class', 'Mui-disabled').click(); | ||
cy.get('#undeploy-btn').should('not.have.class', 'Mui-disabled').should('exist'); | ||
cy.wait(2000); | ||
|
||
// Verify environments | ||
cy.get('#gateway-access-url-cell > div').should('have.text', | ||
'http://localhost:8280https://localhost:8243https://wso2.comhttp://apim.com:8280').should('exist'); | ||
|
||
// Delete API | ||
Utils.deleteAPI(apiId); | ||
}); | ||
} | ||
|
||
it.only("Verify Gateway Environments - super admin", () => { | ||
verifyGatewayEnvironments(superTenant); | ||
}); | ||
it.only("Verify Gateway Environments - tenant user", () => { | ||
verifyGatewayEnvironments(testTenant); | ||
}); | ||
}); |