From d7e08a96861c90186dc89f9098d00a47804e7f7e Mon Sep 17 00:00:00 2001 From: Uzeyir Abdullayev Date: Tue, 29 Oct 2024 11:02:27 +0200 Subject: [PATCH] changed directories --- .gitignore | 4 +- package.json | 5 +- packages/testkit/{src => }/BaseElement.ts | 0 .../{src => }/__TESTS__/button.spec.js | 2 +- .../{src => }/__TESTS__/buttonGroup.spec.js | 2 +- .../{src => }/__TESTS__/checkbox.spec.js | 0 .../{src => }/__TESTS__/dropdown.spec.js | 10 +-- .../{src => }/__TESTS__/menuButton.spec.js | 0 .../{src => }/__TESTS__/textArea.spec.js | 0 .../{src => }/__TESTS__/textfield.spec.js | 0 packages/testkit/{src => }/buttons/Button.ts | 0 .../testkit/{src => }/buttons/ButtonGroup.ts | 0 .../testkit/{src => }/buttons/IconButton.ts | 0 .../testkit/{src => }/buttons/MenuButton.ts | 0 .../testkit/{src => }/buttons/SplitButton.ts | 0 packages/testkit/{src => }/buttons/index.ts | 0 packages/testkit/{src => }/index.ts | 0 packages/testkit/{src => }/inputs/Checkbox.ts | 0 .../inputs/DropDown.ts => inputs/Dropdown.ts} | 2 +- packages/testkit/{src => }/inputs/Search.ts | 0 packages/testkit/{src => }/inputs/TextArea.ts | 0 .../testkit/{src => }/inputs/TextField.ts | 0 packages/testkit/{src => }/inputs/Toggle.ts | 0 packages/testkit/{src => }/inputs/index.ts | 2 +- packages/testkit/{src => }/navigation/List.ts | 0 .../testkit/{src => }/navigation/ListItem.ts | 0 packages/testkit/{src => }/navigation/Tab.ts | 0 .../testkit/{src => }/navigation/TabList.ts | 0 .../testkit/{src => }/navigation/index.ts | 0 packages/testkit/package.json | 2 +- .../testkit/{src => }/pickers/ColorPicker.ts | 0 packages/testkit/{src => }/pickers/index.ts | 0 packages/testkit/playwright.config.ts | 30 ++++---- packages/testkit/{src => }/popover/Dialog.ts | 0 packages/testkit/{src => }/popover/index.ts | 0 packages/testkit/reports/index.html | 68 ------------------- packages/testkit/{src => }/text/Text.ts | 0 packages/testkit/{src => }/text/index.ts | 0 packages/testkit/tsconfig.json | 4 +- .../testkit/{src => }/utils/common-actions.ts | 0 40 files changed, 31 insertions(+), 100 deletions(-) rename packages/testkit/{src => }/BaseElement.ts (100%) rename packages/testkit/{src => }/__TESTS__/button.spec.js (94%) rename packages/testkit/{src => }/__TESTS__/buttonGroup.spec.js (97%) rename packages/testkit/{src => }/__TESTS__/checkbox.spec.js (100%) rename packages/testkit/{src => }/__TESTS__/dropdown.spec.js (67%) rename packages/testkit/{src => }/__TESTS__/menuButton.spec.js (100%) rename packages/testkit/{src => }/__TESTS__/textArea.spec.js (100%) rename packages/testkit/{src => }/__TESTS__/textfield.spec.js (100%) rename packages/testkit/{src => }/buttons/Button.ts (100%) rename packages/testkit/{src => }/buttons/ButtonGroup.ts (100%) rename packages/testkit/{src => }/buttons/IconButton.ts (100%) rename packages/testkit/{src => }/buttons/MenuButton.ts (100%) rename packages/testkit/{src => }/buttons/SplitButton.ts (100%) rename packages/testkit/{src => }/buttons/index.ts (100%) rename packages/testkit/{src => }/index.ts (100%) rename packages/testkit/{src => }/inputs/Checkbox.ts (100%) rename packages/testkit/{src/inputs/DropDown.ts => inputs/Dropdown.ts} (96%) rename packages/testkit/{src => }/inputs/Search.ts (100%) rename packages/testkit/{src => }/inputs/TextArea.ts (100%) rename packages/testkit/{src => }/inputs/TextField.ts (100%) rename packages/testkit/{src => }/inputs/Toggle.ts (100%) rename packages/testkit/{src => }/inputs/index.ts (79%) rename packages/testkit/{src => }/navigation/List.ts (100%) rename packages/testkit/{src => }/navigation/ListItem.ts (100%) rename packages/testkit/{src => }/navigation/Tab.ts (100%) rename packages/testkit/{src => }/navigation/TabList.ts (100%) rename packages/testkit/{src => }/navigation/index.ts (100%) rename packages/testkit/{src => }/pickers/ColorPicker.ts (100%) rename packages/testkit/{src => }/pickers/index.ts (100%) rename packages/testkit/{src => }/popover/Dialog.ts (100%) rename packages/testkit/{src => }/popover/index.ts (100%) delete mode 100644 packages/testkit/reports/index.html rename packages/testkit/{src => }/text/Text.ts (100%) rename packages/testkit/{src => }/text/index.ts (100%) rename packages/testkit/{src => }/utils/common-actions.ts (100%) diff --git a/.gitignore b/.gitignore index a4c00cbdcf..9acb65d743 100644 --- a/.gitignore +++ b/.gitignore @@ -13,5 +13,5 @@ coverage .scannerwork *.env .DS_Store -packages/testing-kit/test-results -packages/testing-kit/reports \ No newline at end of file +packages/testkit/test-results +packages/testkit/reports \ No newline at end of file diff --git a/package.json b/package.json index 5bf910172f..9739aa0c92 100644 --- a/package.json +++ b/package.json @@ -12,9 +12,8 @@ }, "devDependencies": { "lerna": "^8.1.2", - "typescript": "^4.7.3", - "@playwright/test": "1.45.3" - }, + "typescript": "^4.7.3" + }, "workspaces": [ "packages/*" ] diff --git a/packages/testkit/src/BaseElement.ts b/packages/testkit/BaseElement.ts similarity index 100% rename from packages/testkit/src/BaseElement.ts rename to packages/testkit/BaseElement.ts diff --git a/packages/testkit/src/__TESTS__/button.spec.js b/packages/testkit/__TESTS__/button.spec.js similarity index 94% rename from packages/testkit/src/__TESTS__/button.spec.js rename to packages/testkit/__TESTS__/button.spec.js index b75e4c0912..c7c6facf2d 100644 --- a/packages/testkit/src/__TESTS__/button.spec.js +++ b/packages/testkit/__TESTS__/button.spec.js @@ -1,5 +1,5 @@ import { test, expect } from '@playwright/test'; -import { Button } from '../buttons/Button'; // Assuming you have this Button class +import { Button } from '../buttons/Button'; test('should fire a click event and log to console', async ({ page }) => { // Navigate to the Storybook page with the component diff --git a/packages/testkit/src/__TESTS__/buttonGroup.spec.js b/packages/testkit/__TESTS__/buttonGroup.spec.js similarity index 97% rename from packages/testkit/src/__TESTS__/buttonGroup.spec.js rename to packages/testkit/__TESTS__/buttonGroup.spec.js index 0bb6dcc238..e8d714c872 100644 --- a/packages/testkit/src/__TESTS__/buttonGroup.spec.js +++ b/packages/testkit/__TESTS__/buttonGroup.spec.js @@ -8,7 +8,7 @@ test.describe("ButtonGroup Class with Storybook", () => { test.beforeEach(async ({ page }) => { // Navigate to the Storybook story where the ButtonGroup component is rendered await page.goto("/?path=/story/buttons-buttongroup--default"); - //TODO - find a better way to wait for the storybook to load + //TODO - find a better way to wait for the storybook to load // Locate the iframe where the Storybook component is rendered const frame = page.frameLocator("[id='storybook-preview-iframe']"); diff --git a/packages/testkit/src/__TESTS__/checkbox.spec.js b/packages/testkit/__TESTS__/checkbox.spec.js similarity index 100% rename from packages/testkit/src/__TESTS__/checkbox.spec.js rename to packages/testkit/__TESTS__/checkbox.spec.js diff --git a/packages/testkit/src/__TESTS__/dropdown.spec.js b/packages/testkit/__TESTS__/dropdown.spec.js similarity index 67% rename from packages/testkit/src/__TESTS__/dropdown.spec.js rename to packages/testkit/__TESTS__/dropdown.spec.js index 69c7e371d4..3d72d02928 100644 --- a/packages/testkit/src/__TESTS__/dropdown.spec.js +++ b/packages/testkit/__TESTS__/dropdown.spec.js @@ -1,20 +1,20 @@ import { test, expect } from "@playwright/test"; -import { DropDown } from "../inputs/DropDown"; +import { Dropdown } from "../inputs/Dropdown"; test.describe("dropdown Class with Storybook", () => { - let Dropdown; + let DropDown; test.beforeEach(async ({ page }) => { await page.goto("/?path=/story/inputs-dropdown--overview"); const frame = page.frameLocator("[id='storybook-preview-iframe']"); const DropDownLocator = frame.locator('[id="dropdown-menu-id"]'); - Dropdown = new DropDown(page, DropDownLocator, "Test DropDown"); + DropDown = new Dropdown(page, DropDownLocator, "Test DropDown"); }); test("set dropdown value", async ({page}) => { - await Dropdown.selectItem("2"); + await DropDown.selectItem("2"); await page.waitForTimeout(500); - expect(await Dropdown.getText()).toContain("Option 2"); + expect(await DropDown.getText()).toContain("Option 2"); }); }); \ No newline at end of file diff --git a/packages/testkit/src/__TESTS__/menuButton.spec.js b/packages/testkit/__TESTS__/menuButton.spec.js similarity index 100% rename from packages/testkit/src/__TESTS__/menuButton.spec.js rename to packages/testkit/__TESTS__/menuButton.spec.js diff --git a/packages/testkit/src/__TESTS__/textArea.spec.js b/packages/testkit/__TESTS__/textArea.spec.js similarity index 100% rename from packages/testkit/src/__TESTS__/textArea.spec.js rename to packages/testkit/__TESTS__/textArea.spec.js diff --git a/packages/testkit/src/__TESTS__/textfield.spec.js b/packages/testkit/__TESTS__/textfield.spec.js similarity index 100% rename from packages/testkit/src/__TESTS__/textfield.spec.js rename to packages/testkit/__TESTS__/textfield.spec.js diff --git a/packages/testkit/src/buttons/Button.ts b/packages/testkit/buttons/Button.ts similarity index 100% rename from packages/testkit/src/buttons/Button.ts rename to packages/testkit/buttons/Button.ts diff --git a/packages/testkit/src/buttons/ButtonGroup.ts b/packages/testkit/buttons/ButtonGroup.ts similarity index 100% rename from packages/testkit/src/buttons/ButtonGroup.ts rename to packages/testkit/buttons/ButtonGroup.ts diff --git a/packages/testkit/src/buttons/IconButton.ts b/packages/testkit/buttons/IconButton.ts similarity index 100% rename from packages/testkit/src/buttons/IconButton.ts rename to packages/testkit/buttons/IconButton.ts diff --git a/packages/testkit/src/buttons/MenuButton.ts b/packages/testkit/buttons/MenuButton.ts similarity index 100% rename from packages/testkit/src/buttons/MenuButton.ts rename to packages/testkit/buttons/MenuButton.ts diff --git a/packages/testkit/src/buttons/SplitButton.ts b/packages/testkit/buttons/SplitButton.ts similarity index 100% rename from packages/testkit/src/buttons/SplitButton.ts rename to packages/testkit/buttons/SplitButton.ts diff --git a/packages/testkit/src/buttons/index.ts b/packages/testkit/buttons/index.ts similarity index 100% rename from packages/testkit/src/buttons/index.ts rename to packages/testkit/buttons/index.ts diff --git a/packages/testkit/src/index.ts b/packages/testkit/index.ts similarity index 100% rename from packages/testkit/src/index.ts rename to packages/testkit/index.ts diff --git a/packages/testkit/src/inputs/Checkbox.ts b/packages/testkit/inputs/Checkbox.ts similarity index 100% rename from packages/testkit/src/inputs/Checkbox.ts rename to packages/testkit/inputs/Checkbox.ts diff --git a/packages/testkit/src/inputs/DropDown.ts b/packages/testkit/inputs/Dropdown.ts similarity index 96% rename from packages/testkit/src/inputs/DropDown.ts rename to packages/testkit/inputs/Dropdown.ts index 17654d57ba..29edabadb5 100644 --- a/packages/testkit/src/inputs/DropDown.ts +++ b/packages/testkit/inputs/Dropdown.ts @@ -6,7 +6,7 @@ import { BaseElement } from "../BaseElement"; * Class representing a DropDown element. * Extends the BaseElement class. */ -export class DropDown extends BaseElement { +export class Dropdown extends BaseElement { inputField: TextField; override page: Page; override locator: Locator; diff --git a/packages/testkit/src/inputs/Search.ts b/packages/testkit/inputs/Search.ts similarity index 100% rename from packages/testkit/src/inputs/Search.ts rename to packages/testkit/inputs/Search.ts diff --git a/packages/testkit/src/inputs/TextArea.ts b/packages/testkit/inputs/TextArea.ts similarity index 100% rename from packages/testkit/src/inputs/TextArea.ts rename to packages/testkit/inputs/TextArea.ts diff --git a/packages/testkit/src/inputs/TextField.ts b/packages/testkit/inputs/TextField.ts similarity index 100% rename from packages/testkit/src/inputs/TextField.ts rename to packages/testkit/inputs/TextField.ts diff --git a/packages/testkit/src/inputs/Toggle.ts b/packages/testkit/inputs/Toggle.ts similarity index 100% rename from packages/testkit/src/inputs/Toggle.ts rename to packages/testkit/inputs/Toggle.ts diff --git a/packages/testkit/src/inputs/index.ts b/packages/testkit/inputs/index.ts similarity index 79% rename from packages/testkit/src/inputs/index.ts rename to packages/testkit/inputs/index.ts index fc73bb0547..5eba5bf100 100644 --- a/packages/testkit/src/inputs/index.ts +++ b/packages/testkit/inputs/index.ts @@ -1,5 +1,5 @@ export { TextField } from "./TextField"; -export { DropDown } from "./DropDown"; +export { Dropdown } from "./Dropdown"; export { Checkbox } from "./Checkbox"; export { TextArea } from "./TextArea"; export { Toggle } from "./Toggle"; diff --git a/packages/testkit/src/navigation/List.ts b/packages/testkit/navigation/List.ts similarity index 100% rename from packages/testkit/src/navigation/List.ts rename to packages/testkit/navigation/List.ts diff --git a/packages/testkit/src/navigation/ListItem.ts b/packages/testkit/navigation/ListItem.ts similarity index 100% rename from packages/testkit/src/navigation/ListItem.ts rename to packages/testkit/navigation/ListItem.ts diff --git a/packages/testkit/src/navigation/Tab.ts b/packages/testkit/navigation/Tab.ts similarity index 100% rename from packages/testkit/src/navigation/Tab.ts rename to packages/testkit/navigation/Tab.ts diff --git a/packages/testkit/src/navigation/TabList.ts b/packages/testkit/navigation/TabList.ts similarity index 100% rename from packages/testkit/src/navigation/TabList.ts rename to packages/testkit/navigation/TabList.ts diff --git a/packages/testkit/src/navigation/index.ts b/packages/testkit/navigation/index.ts similarity index 100% rename from packages/testkit/src/navigation/index.ts rename to packages/testkit/navigation/index.ts diff --git a/packages/testkit/package.json b/packages/testkit/package.json index 2976865d18..dfcd285833 100644 --- a/packages/testkit/package.json +++ b/packages/testkit/package.json @@ -19,7 +19,7 @@ "scripts": { "test:e2e": "npx playwright test", "build": "tsc", - "start-server": "cd .. && cd core && yarn storybook" + "start-server": "yarn lerna run storybook --scope=monday-ui-react-core" }, "bugs": { "url": "https://github.com/mondaycom/vibe/issues" diff --git a/packages/testkit/src/pickers/ColorPicker.ts b/packages/testkit/pickers/ColorPicker.ts similarity index 100% rename from packages/testkit/src/pickers/ColorPicker.ts rename to packages/testkit/pickers/ColorPicker.ts diff --git a/packages/testkit/src/pickers/index.ts b/packages/testkit/pickers/index.ts similarity index 100% rename from packages/testkit/src/pickers/index.ts rename to packages/testkit/pickers/index.ts diff --git a/packages/testkit/playwright.config.ts b/packages/testkit/playwright.config.ts index 2430b9206f..2fbc9db00c 100644 --- a/packages/testkit/playwright.config.ts +++ b/packages/testkit/playwright.config.ts @@ -1,24 +1,24 @@ - - import { defineConfig } from '@playwright/test'; import path from "path"; + /** * @see https://playwright.dev/docs/test-configuration */ -module.exports = defineConfig({ - +export default defineConfig({ fullyParallel: false, workers: 1, - reporter: [["html", { open: "never", outputFolder: path.join(__dirname, "/reports") }]], - // Run your local dev server before starting the tests - webServer: { - command: 'yarn start-server', - url: 'http://127.0.0.1:7008', - reuseExistingServer: !process.env.CI, - timeout: 120 * 1000, - stdout: 'ignore', - stderr: 'pipe', - }, + reporter: [["html", { open: "never", outputFolder: path.join(process.cwd(), "/reports") }]], + + // Run your local dev server before starting the tests + webServer: { + command: 'yarn start-server', + url: 'http://127.0.0.1:7008', + reuseExistingServer: !process.env.CI, + timeout: 120 * 1000, + stdout: 'ignore', + stderr: 'pipe', + }, + use: { headless: true, baseURL: "http://127.0.0.1:7008", @@ -31,4 +31,4 @@ module.exports = defineConfig({ } }, timeout: 180 * 1000, -}); \ No newline at end of file +}); diff --git a/packages/testkit/src/popover/Dialog.ts b/packages/testkit/popover/Dialog.ts similarity index 100% rename from packages/testkit/src/popover/Dialog.ts rename to packages/testkit/popover/Dialog.ts diff --git a/packages/testkit/src/popover/index.ts b/packages/testkit/popover/index.ts similarity index 100% rename from packages/testkit/src/popover/index.ts rename to packages/testkit/popover/index.ts diff --git a/packages/testkit/reports/index.html b/packages/testkit/reports/index.html deleted file mode 100644 index fedd480657..0000000000 --- a/packages/testkit/reports/index.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - Playwright Test Report - - - - -
- - - \ No newline at end of file diff --git a/packages/testkit/src/text/Text.ts b/packages/testkit/text/Text.ts similarity index 100% rename from packages/testkit/src/text/Text.ts rename to packages/testkit/text/Text.ts diff --git a/packages/testkit/src/text/index.ts b/packages/testkit/text/index.ts similarity index 100% rename from packages/testkit/src/text/index.ts rename to packages/testkit/text/index.ts diff --git a/packages/testkit/tsconfig.json b/packages/testkit/tsconfig.json index fa7d02ea7d..198d44ed7c 100644 --- a/packages/testkit/tsconfig.json +++ b/packages/testkit/tsconfig.json @@ -17,12 +17,12 @@ "strictBindCallApply": true, "strictFunctionTypes": true, "strictPropertyInitialization": true, - "rootDir": "src/", + "rootDir": ".", "declaration": false, "downlevelIteration": true, "experimentalDecorators": true, "noImplicitOverride": true, "noImplicitReturns": true, }, - "include": ["src/**/*"] + "include": [ "buttons", "inputs", "navigation", "pickers", "popover", "text", "utils", "BaseElement.ts", "index.ts"] } diff --git a/packages/testkit/src/utils/common-actions.ts b/packages/testkit/utils/common-actions.ts similarity index 100% rename from packages/testkit/src/utils/common-actions.ts rename to packages/testkit/utils/common-actions.ts