Skip to content

Commit

Permalink
Add back playbook generation option from welcome page
Browse files Browse the repository at this point in the history
  • Loading branch information
audgirka committed Oct 21, 2024
1 parent bc1c6ec commit e156a8c
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 47 deletions.
8 changes: 8 additions & 0 deletions src/features/welcomePage/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,14 @@ export class AnsibleWelcomePage {
<div class="categories-column-left">
<div class="index-list start-container">
<h2>Start</h2>
<div class="catalogue">
<h3>
<a href="command:ansible.lightspeed.playbookGeneration">
<span class="codicon codicon-file-code"></span> Playbook with Ansible Lightspeed
</a>
</h3>
<p>Create a lists of tasks that automatically execute for your specified inventory or groups of hosts.</p>
</div>
<div class="catalogue">
<h3>
<a href="command:ansible.content-creator.create-ansible-project">
Expand Down
72 changes: 25 additions & 47 deletions test/ui-test/welcomePageUITest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,21 @@ import { sleep } from "./uiTestHelper";

config.truncateThreshold = 0;
export function welcomePageUITest(): void {
let view: ViewControl;
let sideBar: SideBarView;
let adtSection: ViewSection;

before(async () => {
// Open Ansible Development Tools by clicking the Getting started button on the side bar
view = (await new ActivityBar().getViewControl("Ansible")) as ViewControl;
sideBar = await view.openView();
// to get the content part
adtSection = await sideBar
.getContent()
.getSection("Ansible Development Tools");
});

after(async function () {
if (view) {
await view.closeView();
}
});
describe("ADT sidebar and welcome page is displayed as expected", async () => {
let view: ViewControl;
let sideBar: SideBarView;
let adtSection: ViewSection;
let welcomePageWebView: WebView;

before(async () => {
// Open Ansible Development Tools by clicking the Getting started button on the side bar
view = (await new ActivityBar().getViewControl("Ansible")) as ViewControl;
sideBar = await view.openView();
// to get the content part
adtSection = await sideBar
.getContent()
.getSection("Ansible Development Tools");

describe("Verify welcome page sidebar and title is displayed as expected", async () => {
it("check for header and subtitle", async function () {
const title = await adtSection.getTitle();
expect(title).not.to.be.undefined;
expect(title).to.equals("Ansible Development Tools");
Expand All @@ -51,14 +44,23 @@ export function welcomePageUITest(): void {
}
await sleep(3000);

const welcomePageWebView = await new WebView();
welcomePageWebView = await new WebView();
expect(welcomePageWebView, "welcomePageWebView should not be undefined")
.not.to.be.undefined;
await welcomePageWebView.switchToFrame(3000);
expect(
welcomePageWebView,
"welcomePageWebView should not be undefined after switching to its frame",
).not.to.be.undefined;
});

after(async function () {
if (view) {
await view.closeView();
}
});

it("check for header and subtitle", async function () {
const adtHeaderTitle = await welcomePageWebView.findWebElement(
By.className("title caption"),
);
Expand All @@ -75,34 +77,10 @@ export function welcomePageUITest(): void {
"Create, test and deploy Ansible content",
);

await welcomePageWebView.switchBack();
// await welcomePageWebView.switchBack();
});
});

describe("Check for start section and related links", async () => {
it("Check if start and walkthrough list section is visible", async () => {
const getStartedButton = await adtSection.findElement(
By.xpath(
"//a[contains(@class, 'monaco-button') and " +
".//span/text()='Get started']",
),
);

expect(getStartedButton).not.to.be.undefined;

if (getStartedButton) {
await getStartedButton.click();
}
await sleep(3000);

const welcomePageWebView = await new WebView();
expect(welcomePageWebView, "welcomePageWebView should not be undefined")
.not.to.be.undefined;
await welcomePageWebView.switchToFrame(3000);
expect(
welcomePageWebView,
"welcomePageWebView should not be undefined after switching to its frame",
).not.to.be.undefined;
const startSection = await welcomePageWebView.findWebElement(
By.className("index-list start-container"),
);
Expand Down

0 comments on commit e156a8c

Please sign in to comment.