diff --git a/tests/e2e/skip-specs/read-tests-2.ts b/tests/e2e/skip-specs/read-tests-2.ts new file mode 100644 index 0000000..a1d9f0f --- /dev/null +++ b/tests/e2e/skip-specs/read-tests-2.ts @@ -0,0 +1,20 @@ +// import { expect } from "@wdio/globals"; +// import { VSCodePO } from "../page-objects"; + +// describe("Testing view in sidebar", () => { +// describe("after read tests", () => { +// it("should replace loader item on main folder item in tree", async () => { +// const vscodePO = await VSCodePO.create(); +// const testingViewControl = vscodePO.getTestingViewControl(); +// await testingViewControl.open(); + +// const sidebar = vscodePO.getTestingSideBar(); +// await sidebar.waitTestsRead(); + +// const [firstSection] = await sidebar.getSections(); +// const firstItemLabel = await firstSection.getLabel(); + +// expect(firstItemLabel).toBe("tests"); +// }); +// }); +// }); diff --git a/tests/e2e/skip-specs/read-tests-3.ts b/tests/e2e/skip-specs/read-tests-3.ts new file mode 100644 index 0000000..3f08a2a --- /dev/null +++ b/tests/e2e/skip-specs/read-tests-3.ts @@ -0,0 +1,28 @@ +// import { expect } from "@wdio/globals"; +// import { VSCodePO } from "../page-objects"; + +// describe("Testing view in sidebar", () => { +// describe("after read tests", () => { +// it("should correctly render tests tree", async () => { +// const vscodePO = await VSCodePO.create(); +// const testingViewControl = vscodePO.getTestingViewControl(); +// await testingViewControl.open(); + +// const sidebar = vscodePO.getTestingSideBar(); +// await sidebar.waitTestsRead(); + +// const [firstSection] = await sidebar.getSections(); +// const [mainTreeItem] = await firstSection.getVisibleItems(); + +// await mainTreeItem.expandAll(); +// const testsFullTitle = await mainTreeItem.getTestsFullTitle(); + +// expect(testsFullTitle).toEqual([ +// "tests test.testplane.ts suite success chrome", +// "tests test.testplane.ts suite fail chrome", +// "tests test.testplane.ts suite skipped chrome", +// "tests test.testplane.ts test without suite chrome", +// ]); +// }); +// }); +// }); diff --git a/tests/e2e/skip-specs/run-tests-1.ts b/tests/e2e/skip-specs/run-tests-1.ts new file mode 100644 index 0000000..4565076 --- /dev/null +++ b/tests/e2e/skip-specs/run-tests-1.ts @@ -0,0 +1,38 @@ +// import { expect } from "@wdio/globals"; +// import { VSCodePO } from "../page-objects"; + +// describe("Testing view in sidebar", () => { +// describe("run tests", () => { +// it("should correctly show test statistics after run all tests", async () => { +// const vscodePO = await VSCodePO.create(); +// const testingViewControl = vscodePO.getTestingViewControl(); +// await testingViewControl.open(); + +// const sidebar = vscodePO.getTestingSideBar(); +// await sidebar.waitTestsRead(); +// await sidebar.runAllTests(); +// await sidebar.waitTestsRunComplete(); + +// await expect(await sidebar.getTestsRunStats()).toBe("2/3"); + +// const [firstSection] = await sidebar.getSections(); +// const [mainTreeItem] = await firstSection.getVisibleItems(); +// await mainTreeItem.expandAll(); + +// const items = await firstSection.getVisibleItems(); + +// await expect(items).toHaveLength(11); +// await expect(await items[0].getAriaLabelAttr()).toContain("tests (Failed)"); +// await expect(await items[1].getAriaLabelAttr()).toContain("test.testplane.ts (Failed)"); +// await expect(await items[2].getAriaLabelAttr()).toContain("suite (Failed)"); +// await expect(await items[3].getAriaLabelAttr()).toContain("success (Passed)"); +// await expect(await items[4].getAriaLabelAttr()).toContain("chrome (Passed)"); +// await expect(await items[5].getAriaLabelAttr()).toContain("fail (Failed)"); +// await expect(await items[6].getAriaLabelAttr()).toContain("chrome (Failed)"); +// await expect(await items[7].getAriaLabelAttr()).toContain("skipped (Skipped)"); +// await expect(await items[8].getAriaLabelAttr()).toContain("chrome (Skipped)"); +// await expect(await items[9].getAriaLabelAttr()).toContain("test without suite (Passed)"); +// await expect(await items[10].getAriaLabelAttr()).toContain("chrome (Passed)"); +// }); +// }); +// }); diff --git a/tests/e2e/skip-specs/run-tests-2.ts b/tests/e2e/skip-specs/run-tests-2.ts new file mode 100644 index 0000000..9788ab8 --- /dev/null +++ b/tests/e2e/skip-specs/run-tests-2.ts @@ -0,0 +1,27 @@ +// import { expect } from "@wdio/globals"; +// import { VSCodePO } from "../page-objects"; + +// describe("Testing view in sidebar", () => { +// describe("run tests", () => { +// it("should run only child tests by click on suite item", async () => { +// const vscodePO = await VSCodePO.create(); +// const testingViewControl = vscodePO.getTestingViewControl(); +// await testingViewControl.open(); + +// const sidebar = vscodePO.getTestingSideBar(); +// await sidebar.waitTestsRead(); + +// const [firstSection] = await sidebar.getSections(); +// const [mainTreeItem] = await firstSection.getVisibleItems(); + +// await mainTreeItem.expandAll(); +// const suiteTreeItem = await firstSection.getVisibleItemByLabel("suite"); + +// const runTestButton = await suiteTreeItem!.getActionButton("Run Test"); +// await runTestButton?.elem.click(); +// await sidebar.waitTestsRunComplete(); + +// await expect(await sidebar.getTestsRunStats()).toBe("1/2"); +// }); +// }); +// }); diff --git a/tests/e2e/skip-specs/run-tests-3.ts b/tests/e2e/skip-specs/run-tests-3.ts new file mode 100644 index 0000000..2252344 --- /dev/null +++ b/tests/e2e/skip-specs/run-tests-3.ts @@ -0,0 +1,27 @@ +// import { expect } from "@wdio/globals"; +// import { VSCodePO } from "../page-objects"; + +// describe("Testing view in sidebar", () => { +// describe("run tests", () => { +// it("should run only one test by click on test item", async () => { +// const vscodePO = await VSCodePO.create(); +// const testingViewControl = vscodePO.getTestingViewControl(); +// await testingViewControl.open(); + +// const sidebar = vscodePO.getTestingSideBar(); +// await sidebar.waitTestsRead(); + +// const [firstSection] = await sidebar.getSections(); +// const [mainTreeItem] = await firstSection.getVisibleItems(); + +// await mainTreeItem.expandAll(); +// const testTreeItem = await firstSection.getVisibleItemByLabel("test without suite"); + +// const runTestButton = await testTreeItem!.getActionButton("Run Test"); +// await runTestButton?.elem.click(); +// await sidebar.waitTestsRunComplete(); + +// await expect(await sidebar.getTestsRunStats()).toBe("1/1"); +// }); +// }); +// }); diff --git a/tests/e2e/specs/read-tests-2.ts b/tests/e2e/specs/read-tests-2.ts deleted file mode 100644 index 66d4e42..0000000 --- a/tests/e2e/specs/read-tests-2.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { expect } from "@wdio/globals"; -import { VSCodePO } from "../page-objects"; - -describe("Testing view in sidebar", () => { - describe("after read tests", () => { - it("should replace loader item on main folder item in tree", async () => { - const vscodePO = await VSCodePO.create(); - const testingViewControl = vscodePO.getTestingViewControl(); - await testingViewControl.open(); - - const sidebar = vscodePO.getTestingSideBar(); - await sidebar.waitTestsRead(); - - const [firstSection] = await sidebar.getSections(); - const firstItemLabel = await firstSection.getLabel(); - - expect(firstItemLabel).toBe("tests"); - }); - }); -}); diff --git a/tests/e2e/specs/read-tests-3.ts b/tests/e2e/specs/read-tests-3.ts deleted file mode 100644 index cf03024..0000000 --- a/tests/e2e/specs/read-tests-3.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { expect } from "@wdio/globals"; -import { VSCodePO } from "../page-objects"; - -describe("Testing view in sidebar", () => { - describe("after read tests", () => { - it("should correctly render tests tree", async () => { - const vscodePO = await VSCodePO.create(); - const testingViewControl = vscodePO.getTestingViewControl(); - await testingViewControl.open(); - - const sidebar = vscodePO.getTestingSideBar(); - await sidebar.waitTestsRead(); - - const [firstSection] = await sidebar.getSections(); - const [mainTreeItem] = await firstSection.getVisibleItems(); - - await mainTreeItem.expandAll(); - const testsFullTitle = await mainTreeItem.getTestsFullTitle(); - - expect(testsFullTitle).toEqual([ - "tests test.testplane.ts suite success chrome", - "tests test.testplane.ts suite fail chrome", - "tests test.testplane.ts suite skipped chrome", - "tests test.testplane.ts test without suite chrome", - ]); - }); - }); -}); diff --git a/tests/e2e/specs/run-tests-1.ts b/tests/e2e/specs/run-tests-1.ts deleted file mode 100644 index bd9f313..0000000 --- a/tests/e2e/specs/run-tests-1.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { expect } from "@wdio/globals"; -import { VSCodePO } from "../page-objects"; - -describe("Testing view in sidebar", () => { - describe("run tests", () => { - it("should correctly show test statistics after run all tests", async () => { - const vscodePO = await VSCodePO.create(); - const testingViewControl = vscodePO.getTestingViewControl(); - await testingViewControl.open(); - - const sidebar = vscodePO.getTestingSideBar(); - await sidebar.waitTestsRead(); - await sidebar.runAllTests(); - await sidebar.waitTestsRunComplete(); - - await expect(await sidebar.getTestsRunStats()).toBe("2/3"); - - const [firstSection] = await sidebar.getSections(); - const [mainTreeItem] = await firstSection.getVisibleItems(); - await mainTreeItem.expandAll(); - - const items = await firstSection.getVisibleItems(); - - await expect(items).toHaveLength(11); - await expect(await items[0].getAriaLabelAttr()).toContain("tests (Failed)"); - await expect(await items[1].getAriaLabelAttr()).toContain("test.testplane.ts (Failed)"); - await expect(await items[2].getAriaLabelAttr()).toContain("suite (Failed)"); - await expect(await items[3].getAriaLabelAttr()).toContain("success (Passed)"); - await expect(await items[4].getAriaLabelAttr()).toContain("chrome (Passed)"); - await expect(await items[5].getAriaLabelAttr()).toContain("fail (Failed)"); - await expect(await items[6].getAriaLabelAttr()).toContain("chrome (Failed)"); - await expect(await items[7].getAriaLabelAttr()).toContain("skipped (Skipped)"); - await expect(await items[8].getAriaLabelAttr()).toContain("chrome (Skipped)"); - await expect(await items[9].getAriaLabelAttr()).toContain("test without suite (Passed)"); - await expect(await items[10].getAriaLabelAttr()).toContain("chrome (Passed)"); - }); - }); -}); diff --git a/tests/e2e/specs/run-tests-2.ts b/tests/e2e/specs/run-tests-2.ts deleted file mode 100644 index 7a27e22..0000000 --- a/tests/e2e/specs/run-tests-2.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { expect } from "@wdio/globals"; -import { VSCodePO } from "../page-objects"; - -describe("Testing view in sidebar", () => { - describe("run tests", () => { - it("should run only child tests by click on suite item", async () => { - const vscodePO = await VSCodePO.create(); - const testingViewControl = vscodePO.getTestingViewControl(); - await testingViewControl.open(); - - const sidebar = vscodePO.getTestingSideBar(); - await sidebar.waitTestsRead(); - - const [firstSection] = await sidebar.getSections(); - const [mainTreeItem] = await firstSection.getVisibleItems(); - - await mainTreeItem.expandAll(); - const suiteTreeItem = await firstSection.getVisibleItemByLabel("suite"); - - const runTestButton = await suiteTreeItem!.getActionButton("Run Test"); - await runTestButton?.elem.click(); - await sidebar.waitTestsRunComplete(); - - await expect(await sidebar.getTestsRunStats()).toBe("1/2"); - }); - }); -}); diff --git a/tests/e2e/specs/run-tests-3.ts b/tests/e2e/specs/run-tests-3.ts deleted file mode 100644 index 8671235..0000000 --- a/tests/e2e/specs/run-tests-3.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { expect } from "@wdio/globals"; -import { VSCodePO } from "../page-objects"; - -describe("Testing view in sidebar", () => { - describe("run tests", () => { - it("should run only one test by click on test item", async () => { - const vscodePO = await VSCodePO.create(); - const testingViewControl = vscodePO.getTestingViewControl(); - await testingViewControl.open(); - - const sidebar = vscodePO.getTestingSideBar(); - await sidebar.waitTestsRead(); - - const [firstSection] = await sidebar.getSections(); - const [mainTreeItem] = await firstSection.getVisibleItems(); - - await mainTreeItem.expandAll(); - const testTreeItem = await firstSection.getVisibleItemByLabel("test without suite"); - - const runTestButton = await testTreeItem!.getActionButton("Run Test"); - await runTestButton?.elem.click(); - await sidebar.waitTestsRunComplete(); - - await expect(await sidebar.getTestsRunStats()).toBe("1/1"); - }); - }); -}); diff --git a/tests/e2e/wdio.conf.ts b/tests/e2e/wdio.conf.ts index 180adac..c2a24f2 100644 --- a/tests/e2e/wdio.conf.ts +++ b/tests/e2e/wdio.conf.ts @@ -1,13 +1,15 @@ import path from "node:path"; import type { Options } from "@wdio/types"; -const extensionPath = process.cwd(); -const workspacePath = path.resolve(process.cwd(), process.env.VSCODE_E2E_EXTENSION_PATH || "samples/basic"); +// TODO: VSCODE_E2E_EXTENSION_PATH - support ??? + +const extensionPath = path.join(process.cwd(), process.env.VSCODE_E2E_EXTENSION_PATH || "out"); +const workspacePath = path.resolve(process.cwd(), process.env.VSCODE_E2E_WORKSPACE_PATH || "samples/basic"); export const config: Options.Testrunner = { runner: "local", specs: ["./specs/**/*.ts"], - maxInstances: 10, + maxInstances: 1, capabilities: [ { browserName: "vscode",