Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update plugin webview: Sort and capitalise pluginType dropdown entries #1804

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions src/features/contentCreator/addPluginPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@
<span class="normal">Plugin type *</span>
</vscode-label>
<vscode-single-select id="plugin-dropdown">
<vscode-option>filter</vscode-option>
<vscode-option>lookup</vscode-option>
<vscode-option>action</vscode-option>
<vscode-option>Action</vscode-option>
<vscode-option>Filter</vscode-option>
<vscode-option>Lookup</vscode-option>
</vscode-single-select>
</div>
</div>
Expand Down Expand Up @@ -312,7 +312,7 @@

let ansibleCreatorAddCommand = await this.getCreatorCommand(
pluginName,
pluginType,
pluginType.toLowerCase(),
destinationPathUrl,
);

Expand Down Expand Up @@ -383,9 +383,6 @@
) {
const folderUri = vscode.Uri.parse(expandPath(folderUrl));

// add folder to a new workspace
// vscode.workspace.updateWorkspaceFolders(0, 1, { uri: folderUri });

if (vscode.workspace.workspaceFolders?.length === 0) {
vscode.workspace.updateWorkspaceFolders(0, null, { uri: folderUri });
} else {
Expand All @@ -395,7 +392,7 @@
}

// open the plugin file in the editor
const pluginFileUrl = `${folderUrl}/plugins/${pluginType}/${pluginName}.py`;
const pluginFileUrl = `${folderUrl}/plugins/${pluginType.toLowerCase()}/${pluginName}.py`;

Check warning on line 395 in src/features/contentCreator/addPluginPage.ts

View check run for this annotation

Codecov / codecov/patch

src/features/contentCreator/addPluginPage.ts#L395

Added line #L395 was not covered by tests
console.log(`[ansible-creator] Plugin file url: ${pluginFileUrl}`);
const parsedUrl = vscode.Uri.parse(`vscode://file${pluginFileUrl}`);
console.log(`[ansible-creator] Parsed galaxy file url: ${parsedUrl}`);
Expand Down
14 changes: 10 additions & 4 deletions test/ui-test/lightspeedUiTestPlaybookExpTestNoExpTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe("Verify playbook explanation features when no explanation is returned",
await workbenchExecuteCommand(
"Explain the playbook with Ansible Lightspeed",
);
await sleep(5000);
// await sleep(5000);

// Locate the playbook explanation webview
await new EditorView().openEditor("Explanation", 1);
Expand All @@ -46,9 +46,15 @@ describe("Verify playbook explanation features when no explanation is returned",
By.xpath("//div[contains(@class, 'playbookGeneration') ]"),
);
expect(mainDiv, "mainDiv should not be undefined").not.to.be.undefined;
await sleep(5000);
const text = await mainDiv.getText();
expect(text.includes("No explanation provided")).to.be.true;

// await sleep(5000);
// const text = await mainDiv.getText();
// expect(text.includes("No explanation provided")).to.be.true;

await VSBrowser.instance.driver.wait(async () => {
const text = await mainDiv.getText();
return text.includes("No explanation provided");
}, 15000);

await webView.switchBack();
await workbenchExecuteCommand("View: Close All Editor Groups");
Expand Down
Loading