Skip to content

Commit

Permalink
Merge branch 'next' into fix/multi-apiml-logout
Browse files Browse the repository at this point in the history
Signed-off-by: Timothy Johnson <[email protected]>
  • Loading branch information
t1m0thyj committed Sep 19, 2024
2 parents df87926 + c4c9478 commit 4fda88f
Show file tree
Hide file tree
Showing 11 changed files with 165 additions and 503 deletions.
1 change: 1 addition & 0 deletions packages/zowe-explorer-api/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ All notable changes to the "zowe-explorer-api" extension will be documented in t

### Bug fixes

- Updated the `TableViewProvider.setTableView` function to show the Zowe Resources panel if a table is provided. If `null` is passed, the Zowe Resources panel will be hidden. [#3113](https://github.com/zowe/zowe-explorer-vscode/issues/3113)
- Fixed behavior of logout action when token is defined in both base profile and parent profile. [#3076](https://github.com/zowe/zowe-explorer-vscode/issues/3076)

## `3.0.0-next.202409132122`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*
*/

import { EventEmitter, ExtensionContext, WebviewView } from "vscode";
import { commands, EventEmitter, ExtensionContext, WebviewView } from "vscode";
import { TableBuilder, TableViewProvider } from "../../../../src/vscode/ui";

describe("TableViewProvider", () => {
Expand Down Expand Up @@ -45,8 +45,10 @@ describe("TableViewProvider", () => {
{ apple: 9, banana: 10, orange: 11 },
])
.build();
const executeCommandMock = jest.spyOn(commands, "executeCommand").mockImplementation();
await TableViewProvider.getInstance().setTableView(tableOne);
expect((TableViewProvider.getInstance() as any).tableView).toBe(tableOne);
expect(executeCommandMock).toHaveBeenCalledWith("setContext", "zowe.vscode-extension-for-zowe.showZoweResources", true);

const disposeSpy = jest.spyOn(tableOne, "dispose");

Expand All @@ -55,6 +57,14 @@ describe("TableViewProvider", () => {
await TableViewProvider.getInstance().setTableView(tableTwo);
expect((TableViewProvider.getInstance() as any).tableView).toBe(tableTwo);
expect(disposeSpy).toHaveBeenCalled();
executeCommandMock.mockRestore();
});
it("sets the table to null", async () => {
const executeCommandMock = jest.spyOn(commands, "executeCommand").mockImplementation();
await TableViewProvider.getInstance().setTableView(null);
expect((TableViewProvider.getInstance() as any).tableView).toBe(null);
expect(executeCommandMock).toHaveBeenCalledWith("setContext", "zowe.vscode-extension-for-zowe.showZoweResources", false);
executeCommandMock.mockRestore();
});
});

Expand Down
3 changes: 3 additions & 0 deletions packages/zowe-explorer-api/src/vscode/ui/TableViewProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,12 @@ export class TableViewProvider implements WebviewViewProvider {
if (this.view != null) {
this.view.webview.html = "";
}
await commands.executeCommand("setContext", "zowe.vscode-extension-for-zowe.showZoweResources", false);
return;
}

await commands.executeCommand("setContext", "zowe.vscode-extension-for-zowe.showZoweResources", true);

if (this.view) {
this.tableView.resolveForView(this.view);
} else {
Expand Down
1 change: 1 addition & 0 deletions packages/zowe-explorer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen

### Bug fixes

- The "Zowe Resources" panel is now hidden by default until Zowe Explorer reveals it to display a table or other data. [#3113](https://github.com/zowe/zowe-explorer-vscode/issues/3113)
- Fixed behavior of logout action when token is defined in both base profile and parent profile. [#3076](https://github.com/zowe/zowe-explorer-vscode/issues/3076)

## `3.0.0-next.202409132122`
Expand Down
11 changes: 11 additions & 0 deletions packages/zowe-explorer/__tests__/__e2e__/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

This folder contains a set of end-to-end test scenarios that require a test system to run. End-to-end testing ensures that the intended behavior is met without stubbing or mocking chunks of code for a given scenario.

## Creating a Zowe team config

Create a Zowe team config using Zowe CLI or Zowe Explorer and copy it into its own directory for running the end-to-end tests.
Ensure that the config has the following:

- z/OSMF, TSO and SSH profiles are defined in `defaults` section of the config
- All 3 profiles should have their required properties for connecting to a remote system
- Valid TSO account number in the TSO profile properties
- Valid port for SSH in the SSH profile properties
- User and password stored securely for the profiles **in advance** OR user/password specified as properties in a base profile

**Note:** If you need to write a test that involves mocking or stubbing an object, consider writing an [integration test using Mocha](../__integration__/README.md) instead.

## Preparing your environment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,12 @@ Then("a quick pick appears to select a profile", async function () {
});
When("a user selects a profile", async function () {
await expect(this.input).toBeDefined();
let qpItems = await this.input.getQuickPicks();
const qpItems = await this.input.getQuickPicks();
await qpItems.at(0).select();
await expect(this.input.elem).toBeDisplayedInViewport();

// Issue TSO command has an extra quick pick to select from
if (this.openedCommand === "Issue TSO Command") {
qpItems = await this.input.getQuickPicks();
await qpItems.at(0).select();
}
});

Then(/a user can enter in (.*) as the command and submit it/, async function (command: string) {
if (this.openedCommand === "Issue TSO Command") {
await this.input.setText("IZUACCT");
await this.input.confirm();
}
await this.input.setText(command);
await this.input.confirm();
});
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import { TreeItem } from "wdio-vscode-service";

Then("the user should be able to save it successfully", async function () {
await this.editorForFile.save();
// Wait for the editor to remove "dirty" (unsaved) flag to verify successful save operation
await browser.waitUntil(async () => !(await this.editorForFile.isDirty()));
// Give time for the LPAR to finish handling the save
await browser.pause(3000);
// Wait for the editor to remove "dirty" (unsaved) flag to verify successful save operation
await browser.waitUntil(async () => !(await this.editorForFile.isDirty()));
await this.editorView.closeEditor(await this.editorForFile.getTitle());
});
Then("the user can right-click on the child node and add it as a favorite", async function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ Given("a user who has the jobs table view opened", async function () {
});

When("the user clicks on the Gear icon in the table view", async function () {
// clear all notifications to avoid overlapping elements
await browser.executeWorkbench((vscode) => vscode.commands.executeCommand("notifications.clearAll"));

// shift Selenium focus into webview
await this.tableView.open();
const colsBtn = await browser.$("#colsToggleBtn");
await colsBtn.waitForClickable();
Expand Down
1 change: 1 addition & 0 deletions packages/zowe-explorer/__tests__/__e2e__/wdio.conf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ export const config: Options.Testrunner = {
// optional VS Code settings
userSettings: {
"editor.fontSize": 14,
"extensions.ignoreRecommendations": true,
},
},
},
Expand Down
21 changes: 11 additions & 10 deletions packages/zowe-explorer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@
{
"type": "webview",
"id": "zowe-resources",
"name": "%zowe.resources.name%"
"name": "%zowe.resources.name%",
"when": "zowe.vscode-extension-for-zowe.showZoweResources"
}
],
"zowezosconsole": [
Expand Down Expand Up @@ -1823,19 +1824,19 @@
"@types/fs-extra": "^7.0.0",
"@types/promise-queue": "^2.2.0",
"@types/sinon": "^17.0.3",
"@wdio/cli": "^8.36.1",
"@wdio/cucumber-framework": "^8.36.1",
"@wdio/junit-reporter": "^8.36.1",
"@wdio/local-runner": "^8.36.1",
"@wdio/mocha-framework": "^8.37.0",
"@wdio/spec-reporter": "^8.36.1",
"@wdio/types": "^8.36.1",
"@wdio/cli": "^8.40.5",
"@wdio/cucumber-framework": "^8.40.5",
"@wdio/junit-reporter": "^8.40.3",
"@wdio/local-runner": "^8.40.5",
"@wdio/mocha-framework": "^8.40.3",
"@wdio/spec-reporter": "^8.40.3",
"@wdio/types": "^8.40.3",
"chai": "^4.1.2",
"chai-as-promised": "^7.1.1",
"chalk": "^2.4.1",
"eslint-plugin-zowe-explorer": "3.0.0-next-SNAPSHOT",
"expect": "^24.8.0",
"expect-webdriverio": "^4.13.0",
"expect-webdriverio": "^4.15.4",
"glob": "^7.1.6",
"jest-silent-reporter": "^0.5.0",
"log4js": "^6.4.6",
Expand All @@ -1844,7 +1845,7 @@
"ts-node": "^10.9.2",
"wdio-vscode-service": "^6.1.0",
"wdio-wait-for": "^3.0.11",
"webdriverio": "^8.36.1"
"webdriverio": "^8.40.5"
},
"dependencies": {
"@vscode/codicons": "^0.0.35",
Expand Down
Loading

0 comments on commit 4fda88f

Please sign in to comment.