{"id":15170494,"url":"https://github.com/erelsop/obrowse","last_synced_at":"2026-01-25T17:03:55.433Z","repository":{"id":223081889,"uuid":"759273479","full_name":"erelsop/obrowse","owner":"erelsop","description":"A comprehensive CLI tool for WSL/Unix-like environments, leveraging Playwright for web automation, PDF generation, and integrated testing with Jest and Mocha, tailored for developers and testers seeking streamlined web development and testing workflows.","archived":false,"fork":false,"pushed_at":"2025-06-28T03:31:57.000Z","size":218,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-14T08:51:44.268Z","etag":null,"topics":["browser","cli","jest","mocha","nodejs","testing","typescript","unix-like","wsl2"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/erelsop.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-02-18T05:52:55.000Z","updated_at":"2025-06-28T03:32:00.000Z","dependencies_parsed_at":"2025-05-14T07:12:39.118Z","dependency_job_id":"f3722a76-e063-4000-b1d5-f05ad4a0410f","html_url":"https://github.com/erelsop/obrowse","commit_stats":null,"previous_names":["erelsop/obrowse"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/erelsop/obrowse","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erelsop%2Fobrowse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erelsop%2Fobrowse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erelsop%2Fobrowse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erelsop%2Fobrowse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erelsop","download_url":"https://codeload.github.com/erelsop/obrowse/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erelsop%2Fobrowse/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28755561,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T16:32:25.380Z","status":"ssl_error","status_checked_at":"2026-01-25T16:32:09.189Z","response_time":113,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["browser","cli","jest","mocha","nodejs","testing","typescript","unix-like","wsl2"],"created_at":"2024-09-27T08:03:22.916Z","updated_at":"2026-01-25T17:03:55.426Z","avatar_url":"https://github.com/erelsop.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenBrowse (obrowse)\n\n## Introduction\n\nOpenBrowse, or `obrowse`, is a command-line interface (CLI) tool designed to simplify web browsing tasks directly from your terminal. Whether you need to open specific URLs, generate PDFs of webpages, simulate different browsing environments, or record browser sessions, `obrowse` provides a convenient solution. Built for Linux environments with cross-browser support including WebKit/Safari testing capabilities.\n\n## Installation\n\n### Prerequisites\n\nBefore installing `obrowse`, ensure you have the following prerequisites:\n\n- **Linux Environment:** `obrowse` is designed for Linux environments. It may work in other Unix-like systems including WSL2, but Linux is the primary target platform.\n- **Node.js:** Node.js is required to run the `obrowse` CLI tool. If you haven't already installed Node.js, you can download and install it from the [Node.js official website](https://nodejs.org/).\n\n### Installation Steps\n\n1. **Clone the Repository:**\n\n   Begin by cloning the `obrowse` repository to your local machine:\n\n   ```bash\n   git clone https://github.com/erelsop/obrowse.git ~/src/obrowse\n   cd ~/src/obrowse\n   ```\n\n2. **Install Dependencies:**\n\n   Install all project dependencies and build the distributable version:\n\n   ```bash\n   npm install\n   npm run build\n   npm run install-browsers\n   ```\n\n   To install system dependencies required for Playwright, run:\n\n   ```bash\n   npm run install-deps\n   ```\n\n3. **Global Access via Symlink or Bash Function:**\n\n   **Option A: Symlink (Recommended)**\n   ```bash\n   sudo ln -s $(pwd)/dist/obrowse.js /usr/local/bin/obrowse\n   chmod +x dist/obrowse.js\n   ```\n\n   **Option B: Bash Function**\n   For convenient access to `obrowse` from anywhere in your terminal, you can define a Bash function in your `.bashrc` or `.zshrc` file:\n\n   ```bash\n   echo \"obrowse() { node ~/src/obrowse/dist/obrowse.js \\\"\\$@\\\" }\" \u003e\u003e ~/.bashrc\n   source ~/.bashrc\n   ```\n\n## Usage\n\n### Basic Commands\n\nUse `obrowse` followed by the desired command-line arguments to perform various tasks. Here are some basic commands:\n\n- **Open a URL:**\n\n  ```bash\n  obrowse --browser chrome --url \"https://example.com\"\n  ```\n\n- **Generate PDF:**\n\n  ```bash\n  obrowse --browser chrome --url \"https://example.com\" --headless --pdf \"webpage.pdf\"\n  ```\n\n### Advanced Options\n\n`obrowse` supports advanced options for customizing your browsing experience, including:\n\n- **PDF Generation:** Generate PDFs of web pages with custom format and orientation.\n- **Custom Resolution and User-Agent:** Simulate different devices by specifying custom resolutions and user-agent strings.\n- **Browser Session Recording:** Record browser sessions into video files, useful for bug reporting and tutorials.\n- **Proxy Support:** Specify a proxy server for the browser session, aiding in testing geo-specific content or privacy-focused browsing.\n- **Configuration File Support:** Use a configuration file to save commonly used settings, streamlining the process of initiating browser sessions.\n- **Headless Mode:** Run browsers in headless mode without a visible UI, useful for CI/CD environments and automated testing.\n- **Integrated Testing:** Run automated browser tests using Jest or Mocha directly through the CLI. This feature allows users to specify a testing framework and test files for automated testing alongside their web browsing tasks.\n- **Cross-Browser Testing:** Test your applications in Chrome, Firefox, and WebKit/Safari environments on Linux.\n\nFor detailed usage instructions and available options, refer to the command-line help accessible via `obrowse --help`.\n\n### Integrated Testing with Jest and Mocha\n\n`obrowse` now supports integrated testing, allowing users to run automated tests for their web applications using Jest and Mocha directly through the CLI. This feature simplifies the process of setting up and executing browser-based tests, making it easier to incorporate into your development workflow.\n\n#### Setting Up Tests\n\nTo utilize the testing functionality, ensure your tests are prepared in either Jest or Mocha. Specify the testing framework and the test file path using the `--testFrame` and `--testFile` command-line arguments, respectively.\n\n##### For Jest:\n\nEnsure Jest is installed in your project, and write your tests as you normally would. For example:\n\n```javascript\nconst { chromium } = require('playwright');\n\ndescribe('Google Page Test with Jest', () =\u003e {\n  it('should open google.com and check the title', async () =\u003e {\n    const browser = await chromium.launch();\n    const page = await browser.newPage();\n    await page.goto('https://google.com');\n    expect(await page.title()).toBe('Google');\n    await browser.close();\n  });\n});\n```\n\n##### For Mocha:\n\nFor Mocha users, ensure Mocha and Chai are included in your project for testing and assertions. When writing Mocha tests, it's important to note that tests using ES Module syntax should use the `.mjs` extension or configure Mocha to work with ES Module syntax in `.js` files:\n\n```javascript\nimport { expect } from 'chai';\nimport { chromium } from 'playwright';\n\ndescribe('Google Page Test with Mocha', function() {\n  it('should open google.com and check the title', async function() {\n    const browser = await chromium.launch();\n    const page = await browser.newPage();\n    await page.goto('https://google.com');\n    const title = await page.title();\n    expect(title).to.equal('Google');\n    await browser.close();\n  });\n});\n```\n\n#### Running Tests\n\nTo run your tests through `obrowse`, use the following command, replacing `\u003cframework\u003e` with either `jest` or `mocha`, and `\u003cpath_to_test_file\u003e` with the path to your test file:\n\n```bash\nobrowse --testFrame \u003cframework\u003e --testFile \u003cpath_to_test_file\u003e\n```\n\nExample using Jest:\n\n```bash\nobrowse --testFrame jest --testFile \"./tests/googleJest.test.js\"\n```\n\nExample using Mocha:\n\n```bash\nobrowse --testFrame mocha --testFile \"./tests/googleMocha.test.mjs\"\n```\n\n### Running Tests\n\nThe project includes a comprehensive test suite to verify functionality. To run the tests:\n\n```bash\n# Build the project first\nnpm run build\n\n# Run all tests\nnpm test\n\n# Run only unit tests\nnpm run test:unit\n\n# Run only integration tests\nnpm run test:integration\n\n# Run only end-to-end tests\nnpm run test:e2e\n\n# Generate test coverage report\nnpm run test:coverage\n```\n\n#### Test Coverage\n\nThe test suite includes:\n\n1. **Unit Tests**:\n   - Configuration file handling and validation\n   - Case conversion functionality\n   - Argument parsing\n   - Configuration loading and verification\n\n2. **Integration Tests**: \n   - Browser functionality validation (launching, headless mode, proxy)\n   - PDF generation capabilities\n   - Test framework integration (Jest and Mocha adapters)\n\n3. **End-to-End Tests**:\n   - CLI functionality validation\n   - Configuration file handling\n   - Error reporting\n\nAll tests are written using Jest with TypeScript, following the naming convention `*.test.ts`.\n\n## Contributing\n\nContributions to `obrowse` are welcome! If you're interested in adding features, fixing bugs, or improving the tool, please feel free to fork the repository, make your changes, and submit a pull request.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferelsop%2Fobrowse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferelsop%2Fobrowse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferelsop%2Fobrowse/lists"}