-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update creator webviews to reflect ansible-creator CLI changes (#1582)
Adds a check for the ansible-creator version, as ansible-creator v24.10.0 is required for ansible-creator's new CLI structure to work with ADT server. Changes any reference of "scm-org" to "namespace" and "scm-project" to "collection". Adds a UI test for the Create Ansible Project Page webview. Adds the "semver" dependency to do version comparison for ansible-creator.
- Loading branch information
1 parent
5c40c83
commit 42d1aaa
Showing
11 changed files
with
152 additions
and
33 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
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
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,78 @@ | ||
import { | ||
By, | ||
EditorView, | ||
WebElement, | ||
WebView, | ||
Workbench, | ||
} from "vscode-extension-tester"; | ||
import { sleep } from "./uiTestHelper"; | ||
import { config, expect } from "chai"; | ||
|
||
config.truncateThreshold = 0; | ||
export function contentCreatorUiTest(): void { | ||
describe("Test Ansible playbook project scaffolding", () => { | ||
let workbench: Workbench; | ||
let createButton: WebElement; | ||
let editorView: EditorView; | ||
|
||
before(async () => { | ||
workbench = new Workbench(); | ||
editorView = new EditorView(); | ||
if (editorView) { | ||
await editorView.closeAllEditors(); | ||
} | ||
}); | ||
|
||
it("Check create-ansible-project webview elements", async () => { | ||
await workbench.executeCommand("Ansible: Create New Playbook Project"); | ||
await sleep(4000); | ||
|
||
const playbookProject = (await new EditorView().openEditor( | ||
"Create Ansible project", | ||
)) as WebView; | ||
|
||
expect(playbookProject, "webView should not be undefined").not.to.be | ||
.undefined; | ||
await playbookProject.switchToFrame(5000); | ||
expect( | ||
playbookProject, | ||
"webView should not be undefined after switching to its frame", | ||
).not.to.be.undefined; | ||
|
||
const namespaceTextField = await playbookProject.findWebElement( | ||
By.xpath("//vscode-text-field[@id='namespace-name']"), | ||
); | ||
expect(namespaceTextField, "namespaceTextField should not be undefined") | ||
.not.to.be.undefined; | ||
await namespaceTextField.sendKeys("test_namespace"); | ||
|
||
const collectionTextField = await playbookProject.findWebElement( | ||
By.xpath("//vscode-text-field[@id='collection-name']"), | ||
); | ||
expect(collectionTextField, "collectionTextField should not be undefined") | ||
.not.to.be.undefined; | ||
await collectionTextField.sendKeys("test_collection"); | ||
|
||
const forceCheckbox = await playbookProject.findWebElement( | ||
By.xpath("//vscode-checkbox[@id='force-checkbox']"), | ||
); | ||
|
||
expect(forceCheckbox, "forceCheckbox should not be undefined").not.to.be | ||
.undefined; | ||
await forceCheckbox.click(); | ||
|
||
createButton = await playbookProject.findWebElement( | ||
By.xpath("//vscode-button[@id='create-button']"), | ||
); | ||
expect(createButton, "createButton should not be undefined").not.to.be | ||
.undefined; | ||
|
||
expect( | ||
await createButton.isEnabled(), | ||
"Create button should be enabled now", | ||
).to.be.true; | ||
await createButton.click(); | ||
await playbookProject.switchBack(); | ||
}); | ||
}); | ||
} |
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