{"id":13601679,"url":"https://github.com/totorojs/totoro","last_synced_at":"2025-04-11T04:31:26.837Z","repository":{"id":6382757,"uuid":"7620376","full_name":"totorojs/totoro","owner":"totorojs","description":"A simple and stable cross-browser testing tool. 简单稳定的跨浏览器测试工具。","archived":false,"fork":false,"pushed_at":"2022-02-12T05:57:24.000Z","size":7995,"stargazers_count":564,"open_issues_count":4,"forks_count":101,"subscribers_count":50,"default_branch":"master","last_synced_at":"2024-04-15T11:09:59.973Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://totorojs.org","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/totorojs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-01-15T07:15:31.000Z","updated_at":"2024-03-13T12:04:24.000Z","dependencies_parsed_at":"2022-07-28T22:39:04.082Z","dependency_job_id":null,"html_url":"https://github.com/totorojs/totoro","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/totorojs%2Ftotoro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/totorojs%2Ftotoro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/totorojs%2Ftotoro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/totorojs%2Ftotoro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/totorojs","download_url":"https://codeload.github.com/totorojs/totoro/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223458518,"owners_count":17148479,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-08-01T18:01:06.195Z","updated_at":"2024-11-07T04:31:25.789Z","avatar_url":"https://github.com/totorojs.png","language":"JavaScript","funding_links":[],"categories":["Web 前端","Testing Frameworks","NodeJS","JavaScript","Testing Frameworks [🔝](#readme)","测试框架","Unit Testing"],"sub_categories":["Runner","运行器","Browser-based Testing Tools","运行器e2e测试"],"readme":"![totoro](https://f.cloud.github.com/assets/340282/891339/657d9018-fa54-11e2-9760-6955388fd8fc.jpg)\n\n# totoro\n\nA simple and stable cross-browser testing tool.\n\nLatest stable version: v2.0 [Change Log](https://github.com/totorojs/totoro/releases)\n\n[中文版使用文档](README.zh.md)\n\n---\n\n## 0. Features\n\n- Run in real browsers\n- Support all test frameworks\n- Auto testing coverage\n- **Robust enough for actual combat**\n\n## 1. Installation\n\n### Node requirement\n\n\\\u003e= 0.10.12\n\n### Install from npm\n\n```\n$ npm install totoro -g\n```\n\nIf it not works, you may add `sudo` before the command, as follows.\n\n### Install from github\n\nTo get the latest function (may not be stable)\n\n```\n$ git clone https://github.com/totorojs/totoro \u0026\u0026 cd totoro\n$ npm install -g\n```\n\n## 2. Quick Start\n\nFor simplicity, we have already prepared an example for you:\n\n### Important: please specify a server first !\n\n```\n$ totoro config --host={{totoroServerHost}}\n```\n\nFor now the default test server is internal for Alibaba group only, you can [launch your own server](https://github.com/totorojs/totoro-server).\n\nWe are planning to supply a public service, hmm...\n\n```\n$ git clone https://github.com/totorojs/totoro \u0026\u0026 cd totoro/examples/simple\n$ totoro\n```\n\nThen you should see a output as shown below:\n\n![totoro-result](https://f.cloud.github.com/assets/340282/891944/7c099544-fa71-11e2-828b-5da8c0566834.png)\n\n- If all test cases passed, will report in green color, or will report in red color with detailed error message.\n- Every browser supplies it's own run time and testing coverage (if your test has source code, and `totoro` can recognize).\n\n#### Recommended directory structure\n\nGenerally, if your test is a local file and the directory structure of your project is as bellow, you can run `totoro` without any config.\n\n```\nproject-dir/\n  dist/\n  src/ or lib/\n  tests/ or test/\n    runner.html or index.html\n```\n\n## 3. Cli Options\n\nAll options are optional.\n\n### 3.1 totoro\n\n#### -R, --runner\n\nTest runner. Accept local file and URL.\n\nDefault: auto search in the CWD, `runner.html` or `index.html` in subdirectory `test/` or `tests/` could be recognized.\n\n#### -C, --code\n\nA convenient way to debug. Accept **single** JS expression, local file or URL. totoro will return the calculated value of expression or all output of console.log() in JS file. For example:\n\n```\n$ totoro --code document.body\n$ totoro --code \"console.log(document.body)\"\n$ totoro --code examples/code/code.js  // this file already exists, try it!\n```\n\nBe mind that `--code` and `--runner` are mutually exclusive!\n\n#### -l, --labors\n\nSpecify a comman-delimited list of app names, typically be browsers. For example:\n\n```\nchrome,firefox,safari,ie  //just specify browser names\nie/6,ie/7,ie/8,ie/9  //specify browser names and versions\n```\n\nDefault: all available desktop browsers.\n\n#### -a, --adapter\n\nTest framework's adapter, used to send report to server. Accept built-in keywords, local file and URL.\n\nBuilt-in keywords: `mocha`, `jasmine`.\n\nIf specifies `no`, totoro won\\'t try to detect and insert any adapter, it\\'s thought that user handle it by themself.\n\nIt is very easy to write an adapter for custom test framework, you could refer to [static/adapters/mocha.js](https://github.com/totorojs/totoro/blob/master/static/adapters/mocha.js).\n\nDefault: if `--runner` is local file, `totoro` will see if there is `totoro-adapter.js` in the same directory , if not found or `--runner` is URL, [totoro-server](https://github.com/totorojs/totoro-server) will try to find out matched keyword according to `--runner` content.\n\n#### -c, --charset\n\nSpecifies charset.\n\nDefault: 'utf8'\n\n#### -t, --timeout\n\nSpecifies the client timeout in minutes.\n\nDefault: 5\n\n#### -O, --root\n\nIf assign a local file to `--runner`, `totoro` need to launch a temporary HTTP server for testing, `--root` is the root of this server.\n\n[See more detail](https://github.com/totorojs/totoro/wiki/root-option)\n\nDefault: if necessary, guess a path according to `--runner` and `--adapter`.\n\n#### -H, --host\n\ntotoro-server host.\n\nDefault: internal server host for Alibaba group.\n\n#### -P, --port\n\ntotoro-server port.\n\nDefault: 9999\n\n#### --no-proxy\n\nWon't convert the runner if it is a URL\n\nDefault: false\n\n#### --no-coverage\n\nNo need testing coverage.\n\nDefault: false\n\n### 3.2 totoro list\n\nShow all available browsers of specified server.\n\n![totoro list](https://cloud.githubusercontent.com/assets/340282/4914476/157003d2-64c3-11e4-9f4c-33fc2ec495a7.png)\n\n### 3.3 totoro config\n\nRead or write global config.\n\n#### Read global config\n\n```\n$ totoro config\n```\n\n#### Write global config\n\n```\n$ totoro config --host=10.15.52.87 --port=''\n```\n\nAbove command clear the `--port` value.\n\n## 4. Config File\n\nIf you need a config file, just place `totoro-config.json` in the CWD.\n\nThe priority level of all config ways are: `command line \u003e config file \u003e totoro config \u003e default config`\n\nBelow is an example for config file:\n\n```\n{\n  \"browsers\": [\"chrome\", \"ie/10.0\"],\n  \"host\": \"127.0.0.1\",\n  \"port\": 9999\n}\n```\n\n## 5. About\n\ntotoro takes it's name from animated fantasy film \"My Neighbor Totoro\" directed by [Hayao Miyazaki](http://en.wikipedia.org/wiki/Hayao_Miyazaki).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftotorojs%2Ftotoro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftotorojs%2Ftotoro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftotorojs%2Ftotoro/lists"}