Skip to content

Commit

Permalink
Merge pull request meshery#7093 from Abhishek-kumar09/Abhi/cypress-fix
Browse files Browse the repository at this point in the history
[Fix] Cypress integration Test failure
  • Loading branch information
leecalcote authored Feb 15, 2023
2 parents 12c7626 + 4da18f9 commit 5d8fc1b
Show file tree
Hide file tree
Showing 6 changed files with 117 additions and 23 deletions.
2 changes: 1 addition & 1 deletion provider-ui/cypress/e2e/provider-ui.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('Provider UI', () => {
it('selects None as provider', () => {
cy
.get('[data-cy="select_provider"]').click()
.get('#split-button-menu').contains('None').click()
.get('#split-button-menu').contains('None')
})

it('opens and closes modal to learn more about providers', () => {
Expand Down
28 changes: 20 additions & 8 deletions provider-ui/cypress/fixtures/providers.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
{
"Meshery": {
"ProviderType": "remote",
"DisplayName": "Meshery",
"Description": "Provider: Meshery (default)\n\t- persistent sessions \n\t- save environment setup \n\t- retrieve performance test results \n\t- free use",
"Capabilities": []
"provider_type": "remote",
"provider_name": "Meshery",
"provider_description": [
"Persistent sessions",
"Save environment configurations and user preferences",
"Store and retrieve patterns, filters, and application defintions",
"Retrieve performance and conformance test results",
"RBAC support",
"Free use"
],
"provider_url": "https://meshery.layer5.io"
},
"None": {
"ProviderType": "local",
"DisplayName": "None",
"Description": "Provider: None\n\t- ephemeral sessions\n\t- environment setup not saved\n\t- no performance test result history\n\t- free use",
"Capabilities": []
"provider_type": "local",
"package_version": "v0.6.51",
"provider_name": "None",
"provider_description": [
"Ephemeral sessions",
"Environment setup not saved",
"No performance or conformance test result history",
"Free Use"
]
}
}
6 changes: 2 additions & 4 deletions ui/cypress/e2e/integration/settings_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ describe("Settings", () => {
describe("Service Meshes", () => {
before(() => {
cy.visit("/settings");
cy.intercept("GET", "/api/system/adapters", { fixture: "getMeshAdapters.json" }).as("getMeshAdapters");
cy.intercept("POST", "/api/system/adapter/manage", { fixture: "postMeshManage.json" }).as("postMeshManage");
cy.get('[data-cy="tabServiceMeshes"]').click();
});

it("select, submit, and confirm", () => {
cy.intercept("GET", "/api/system/adapters", { fixture: "getMeshAdapters.json" }).as("getMeshAdapters");
cy.intercept("POST", "/api/system/adapter/manage", { fixture: "postMeshManage.json" }).as("postMeshManage");

cy.get(".MuiInputBase-input").type("localhost:10000{enter}");

cy.get("[data-cy=btnSubmitMeshAdapter]").click();
cy.wait("@postMeshManage");
cy.wait("@getMeshAdapters");
Expand Down
78 changes: 70 additions & 8 deletions ui/cypress/fixtures/getMeshAdapters.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,72 @@
[
"localhost:10004",
"localhost:10006",
"localhost:10008",
"localhost:10009",
"localhost:10000",
"localhost:10001",
"localhost:10002",
"localhost:10003"
{
"adapter_location": "localhost:10007",
"name": "",
"version": "",
"git_commit_sha": "",
"ops": null
},
{
"adapter_location": "localhost:10009",
"name": "",
"version": "",
"git_commit_sha": "",
"ops": null
},
{
"adapter_location": "localhost:10010",
"name": "",
"version": "",
"git_commit_sha": "",
"ops": null
},
{
"adapter_location": "localhost:10000",
"name": "",
"version": "",
"git_commit_sha": "",
"ops": null
},
{
"adapter_location": "localhost:10002",
"name": "",
"version": "",
"git_commit_sha": "",
"ops": null
},
{
"adapter_location": "localhost:10004",
"name": "",
"version": "",
"git_commit_sha": "",
"ops": null
},
{
"adapter_location": "localhost:10005",
"name": "",
"version": "",
"git_commit_sha": "",
"ops": null
},
{
"adapter_location": "localhost:10006",
"name": "",
"version": "",
"git_commit_sha": "",
"ops": null
},
{
"adapter_location": "localhost:10012",
"name": "",
"version": "",
"git_commit_sha": "",
"ops": null
},
{
"adapter_location": "localhost:10001",
"name": "",
"version": "",
"git_commit_sha": "",
"ops": null
}
]
4 changes: 2 additions & 2 deletions ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions ui/patches/subscriptions-transport-ws+0.9.19.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
diff --git a/node_modules/subscriptions-transport-ws/dist/client.js b/node_modules/subscriptions-transport-ws/dist/client.js
index 3202dcd..ec570ce 100644
--- a/node_modules/subscriptions-transport-ws/dist/client.js
+++ b/node_modules/subscriptions-transport-ws/dist/client.js
@@ -122,11 +122,12 @@ var SubscriptionClient = (function () {
this.unsubscribeAll();
this.sendMessage(undefined, message_types_1.default.GQL_CONNECTION_TERMINATE, null);
}
- this.client.close();
- this.client.onopen = null;
- this.client.onclose = null;
- this.client.onerror = null;
- this.client.onmessage = null;
+ const client = this.client;
+ client.close();
+ client.onopen = null;
+ client.onclose = null;
+ client.onerror = null;
+ client.onmessage = null;
this.client = null;
this.eventEmitter.emit('disconnected');
if (!isForced) {

0 comments on commit 5d8fc1b

Please sign in to comment.