Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
uziab committed Oct 27, 2024
1 parent 9d56d25 commit bc3a3ca
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
4 changes: 3 additions & 1 deletion packages/testing-kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
"url": "git+https://github.com/mondaycom/vibe.git"
},
"scripts": {
"test": "node ./__tests__/testing-kit.test.js"
"test": "npx playwright test",
"build": "tsc",
"start-server": "cd .. && cd core && yarn storybook"
},
"bugs": {
"url": "https://github.com/mondaycom/vibe/issues"
Expand Down
9 changes: 9 additions & 0 deletions packages/testing-kit/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ module.exports = 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: 'ignore',
},
use: {
headless: true,
baseURL: "http://127.0.0.1:7008",
Expand Down
11 changes: 9 additions & 2 deletions packages/testing-kit/src/__TESTS__/button.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,18 @@ import { Button } from '../buttons/Button'; // Assuming you have this Button cl
test('should fire a click event and log to console', async ({ page }) => {
// Navigate to the Storybook page with the component
await page.goto('/?path=/story/buttons-button--overview');

// Locate the iframe where the button is rendered
const frame = page.frameLocator("[id='storybook-preview-iframe']");
const button = new Button(page, frame.locator('button[data-testid="button"]'), 'Button');


//TODO - find a better way to wait for the storybook to load
while (await button.locator.isVisible() === false) {
await page.waitForTimeout(30000);
await page.reload();
if (await button.locator.isVisible() === true) {
break;
}
}
// Add a listener to capture console logs
let consoleMessage = '';
page.on('console', async (msg) => {
Expand Down
1 change: 0 additions & 1 deletion packages/testing-kit/src/__TESTS__/textfield.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { test, expect } from "@playwright/test";
import { TextField } from "../inputs/TextField";

test.use({ headless: false });
test.describe("textArea Class with Storybook", () => {
let textField;
let textfieldLocator
Expand Down

0 comments on commit bc3a3ca

Please sign in to comment.