-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: "Show Config" button in error dialog does not work during initia…
…lization (#3274) * fix: check if profileInfo is nullish during v1 migration Signed-off-by: Trae Yelovich <[email protected]> * chore: update ZE changelog Signed-off-by: Trae Yelovich <[email protected]> * tests: integration test for broken config Signed-off-by: Trae Yelovich <[email protected]> * add unit test for nullish profileinfo Signed-off-by: Trae Yelovich <[email protected]> * fix transient failures in UpdateCredentials scenario Signed-off-by: Trae Yelovich <[email protected]> * remove extra join import in wdio conf Signed-off-by: Trae Yelovich <[email protected]> * make integration test more reliable Signed-off-by: Trae Yelovich <[email protected]> * move getprofileinfo call into try/catch during profiles init Signed-off-by: Trae Yelovich <[email protected]> * test: open notification center to check for dialog Signed-off-by: Trae Yelovich <[email protected]> * add license header to test; add another null check Signed-off-by: Trae Yelovich <[email protected]> * add typedoc to ProfilesUtils.getProfileInfo Signed-off-by: Trae Yelovich <[email protected]> * setupDefaultCredentialManager: log err msgs, update typedoc Signed-off-by: Trae Yelovich <[email protected]> * test: promptUserWithNoConfigs, nullish profileInfo case Signed-off-by: Trae Yelovich <[email protected]> * refactor typedoc for setupDefaultCredentialManager Signed-off-by: Trae Yelovich <[email protected]> --------- Signed-off-by: Trae Yelovich <[email protected]>
- Loading branch information
Showing
8 changed files
with
133 additions
and
8 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
7 changes: 7 additions & 0 deletions
7
...owe-explorer/__tests__/__integration__/bdd/features/dialogs/ShowConfigErrorDialog.feature
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,7 @@ | ||
Feature: Show Config Error Dialog | ||
|
||
Scenario: Initializing Zowe Explorer with a broken profile | ||
When a user opens Zowe Explorer | ||
Then the Show Config dialog should appear | ||
When the user clicks on the "Show Config" button | ||
Then the config should appear in the editor |
54 changes: 54 additions & 0 deletions
54
...rer/__tests__/__integration__/bdd/step_definitions/dialogs/ShowConfigErrorDialog.steps.ts
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,54 @@ | ||
/** | ||
* This program and the accompanying materials are made available under the terms of the | ||
* Eclipse Public License v2.0 which accompanies this distribution, and is available at | ||
* https://www.eclipse.org/legal/epl-v20.html | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Copyright Contributors to the Zowe Project. | ||
* | ||
*/ | ||
|
||
import { Then, When } from "@cucumber/cucumber"; | ||
import { getZoweExplorerContainer } from "../../../../__common__/shared.wdio"; | ||
import { Notification, Workbench } from "wdio-vscode-service"; | ||
|
||
When("a user opens Zowe Explorer", async function () { | ||
this.zoweExplorerPane = await getZoweExplorerContainer(); | ||
await expect(this.zoweExplorerPane).toBeDefined(); | ||
}); | ||
|
||
Then("the Show Config dialog should appear", async function () { | ||
this.workbench = await browser.getWorkbench(); | ||
let notification: Notification; | ||
const notificationCenter = await (this.workbench as Workbench).openNotificationsCenter(); | ||
await notificationCenter.wait(60000); | ||
await browser.waitUntil(async () => { | ||
const notifications: Notification[] = await notificationCenter.getNotifications("error" as any); | ||
for (const n of notifications) { | ||
if ((await n.getMessage()).startsWith("Error encountered when loading your Zowe config.")) { | ||
notification = n; | ||
return true; | ||
} | ||
} | ||
|
||
return false; | ||
}); | ||
await expect(notification).toBeDefined(); | ||
this.configErrorDialog = notification; | ||
await (this.configErrorDialog as Notification).wait(); | ||
}); | ||
|
||
When('the user clicks on the "Show Config" button', async function () { | ||
const button = await this.configErrorDialog.elem.$("a[role='button']"); | ||
await expect(button).toBeClickable(); | ||
await button.click(); | ||
}); | ||
|
||
Then("the config should appear in the editor", async function () { | ||
const editorView = (this.workbench as Workbench).getEditorView(); | ||
await editorView.wait(); | ||
await browser.waitUntil(async () => (await editorView.getOpenEditorTitles()).length > 0); | ||
const editorTitles = await editorView.getOpenEditorTitles(); | ||
await expect(editorTitles.some((editorTitle) => editorTitle.includes("zowe.config.json"))).toBe(true); | ||
}); |
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
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