All Projects → getgauge → Taiko

getgauge / Taiko

Licence: mit
A node.js library for testing modern web applications

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects
HTML
75241 projects

Projects that are alternatives of or similar to Taiko

CrawlerSamples
This is a Puppeteer+AngleSharp crawler console app samples, used C# 7.1 coding and dotnet core build.
Stars: ✭ 36 (-98.79%)
Mutual labels:  headless, headless-browsers, headless-chrome, headless-chromium
headless-chrome-alpine
A Docker container running headless Chrome
Stars: ✭ 26 (-99.12%)
Mutual labels:  headless, headless-browsers, headless-chrome
Chrome Devtools Protocol
Chrome Devtools Protocol client for PHP
Stars: ✭ 112 (-96.22%)
Mutual labels:  automation, headless, headless-chrome
Playwright Go
Playwright for Go a browser automation library to control Chromium, Firefox and WebKit with a single API.
Stars: ✭ 272 (-90.82%)
Mutual labels:  automation, headless, headless-chrome
Cuprite
Headless Chrome/Chromium driver for Capybara
Stars: ✭ 743 (-74.93%)
Mutual labels:  testing-tools, headless, headless-chrome
Ferrum
Headless Chrome Ruby API
Stars: ✭ 1,009 (-65.96%)
Mutual labels:  automation, headless, headless-chrome
Navalia
A bullet-proof, fast, and reliable headless browser API
Stars: ✭ 950 (-67.95%)
Mutual labels:  automation, headless, headless-chrome
Pdf Bot
🤖 A Node queue API for generating PDFs using headless Chrome. Comes with a CLI, S3 storage and webhooks for notifying subscribers about generated PDFs
Stars: ✭ 2,551 (-13.93%)
Mutual labels:  headless, headless-chrome, headless-chromium
Rod
A Devtools driver for web automation and scraping
Stars: ✭ 1,392 (-53.04%)
Mutual labels:  automation, headless
Cli
Get a programmable email address. Automate what happens when you receive emails. It's like Zapier for devs who hate emails.
Stars: ✭ 105 (-96.46%)
Mutual labels:  automation, headless
Ayakashi
⚡️ Ayakashi.io - The next generation web scraping framework
Stars: ✭ 117 (-96.05%)
Mutual labels:  automation, headless-chrome
Reportportal
Main Repository. Report Portal starts here - see readme below.
Stars: ✭ 1,175 (-60.36%)
Mutual labels:  automation, testing-tools
Api Store
Contains all the public APIs listed in Phantombuster's API store. Pull requests welcome!
Stars: ✭ 69 (-97.67%)
Mutual labels:  automation, headless-chrome
Deno Puppeteer
A port of puppeteer running on Deno
Stars: ✭ 128 (-95.68%)
Mutual labels:  automation, headless-chrome
Mocha Chrome
☕️ Run Mocha tests using headless Google Chrome
Stars: ✭ 66 (-97.77%)
Mutual labels:  headless, headless-chrome
Phpchrometopdf
A slim PHP wrapper around google-chrome to convert url to pdf or to take screenshots , easy to use and clean OOP interface
Stars: ✭ 127 (-95.72%)
Mutual labels:  headless, headless-chrome
Golang Chrome Automation
Automate Chrome tasks with Golang and ChromeDP
Stars: ✭ 58 (-98.04%)
Mutual labels:  automation, headless-chrome
Awesome Puppeteer
A curated list of awesome puppeteer resources.
Stars: ✭ 1,728 (-41.7%)
Mutual labels:  automation, headless-chrome
Api
API that uncovers the technologies used on websites and generates thumbnail from screenshot of website
Stars: ✭ 189 (-93.62%)
Mutual labels:  automation, headless-chrome
Allure Docker Service
This docker container allows you to see up to date reports simply mounting your "allure-results" directory in the container (for a Single Project) or your "projects" directory (for Multiple Projects). Every time appears new results (generated for your tests), Allure Docker Service will detect those changes and it will generate a new report automatically (optional: send results / generate report through API), what you will see refreshing your browser.
Stars: ✭ 194 (-93.45%)
Mutual labels:  automation, testing-tools

Taiko

Docs | API reference

A Node.js library for testing modern web applications

Actions Status License MIT npm version dependencies Status devDependencies Status contributions welcome Contributor Covenant

Taiko REPL

What’s Taiko?

Taiko is a free and open source browser automation tool built by the team behind Gauge from ThoughtWorks. Taiko is a Node.js library with a clear and concise API to automate Chromium based browsers(Chrome, Microsoft Edge, Opera) and Firefox. Tests written in Taiko are highly readable and maintainable.

With Taiko it’s easy to

  • Get Started
  • Record/Write/Run tests

Taiko’s smart selectors make tests reliable by adapting to changes in the structure of your web application. With Taiko there’s no need for id/css/xpath selectors or adding explicit waits (for XHR requests) in test scripts.

Features

Taiko is built ground up to test modern web applications. Here’s a list of a few unique features that sets it apart from other browser automation tools.

  • Easy Installation
  • Interactive Recorder
  • Smart Selectors
  • Handle XHR and dynamic content
  • Request/Response stubbing and mocking

Getting Started

Easy Installation

Taiko works on Windows, MacOS and Linux. You only need Node.js installed in your system to start writing Taiko scripts in JavaScript. After you’ve installed Node.js open a terminal application (or powershell in the case of Windows) and install Taiko using npm with the command

$ npm install -g taiko

This installs Taiko and the latest version of Chromium browser. We are all set to do some testing!

Interactive Recorder

Taiko comes with a Recorder that’s a REPL for writing test scripts. You can use Taiko’s JavaScript API to control the browser from the REPL. To launch the REPL type taiko in your favorite terminal application

$ taiko
Version: 0.8.0 (Chromium:76.0.3803.0)
Type .api for help and .exit to quit
>

This launches the Taiko prompt. You can now use Taiko’s API as commands in this prompt. For example, launch a Chromium browser instance using

> openBrowser()

You can now automate this Chromium browser instance with commands, for example, make the browser search google for something.

> goto("google.com/?hl=en")
> write("taiko test automation")
> click("Google Search")

These commands make the browser go to google’s home page, type the text "taiko test automation" and click on the "Google Search" button. You can see the browser performing these actions as you type and press enter for each command.

Taiko’s REPL keeps a history of all successful commands. Once you finish a flow of execution, you can generate a test script using the special command .code

> .code
const { openBrowser, goto, write, click, closeBrowser } = require('taiko');

(async () => {
    try {
        await openBrowser();
        await goto("google.com");
        await write("taiko test automation");
        await click("Google Search");
    } catch (error) {
            console.error(error);
    } finally {
            closeBrowser();
    }
})();

Taiko generates readable and maintainable JavaScript code. Copy and modify this code or save it directly to a file using

> .code googlesearch.js

You can choose to continue automating or finish the recording using

> .exit

To run a Taiko script pass the file as an argument to taiko

$ taiko googlesearch.js
✔ Browser opened
✔ Navigated to url "http://google.com"
✔ Wrote taiko test automation into the focused element.
✔ Clicked element containing text "Google Search"
✔ Browser closed

By default Taiko runs the script in headless mode, that means it does not launch a browser window. This makes it easy to run Taiko in containers (ex. Docker). To view the browser when the script executes use

$ taiko googlesearch.js --observe

Taiko’s REPL also documents all the API’s. To view all available API’s use the special command .api

$ taiko
Version: 0.8.0 (Chromium:76.0.3803.0)
Type .api for help and .exit to quit
> .api
Browser actions
    openBrowser, closeBrowser, client, switchTo, setViewPort, openTab, closeTab
...

To see more details of an API along with examples use

>.api openBrowser

Launches a browser with a tab. The browser will be closed when the parent node.js process is closed.

Example:
    openBrowser()
    openBrowser({ headless: false })
    openBrowser({args:['--window-size=1440,900']})

Smart Selectors

Taiko’s API treats the browser as a black box. With Taiko we can write scripts by looking at a web page and without inspecting it’s source code For example on google.com the command

> click("Google Search")

clicks on any element with the text Google Search (a button on the page at https://google.com). Taiko’s API mimics user interactions with the browser. For example if you want to write into an element that’s currently in focus use

> write("something")

Or if you want to write into a specific text field

> write("something", into(textBox({placeholder: "Username"})))

With Taiko’s API we can avoid using ids/css/xpath selectors to create reliable tests that don’t break with changes in the web page’s structure.

You can also use Taiko’s proximity selectors to visually locate elements. For example

> click(checkBox(near("Username")))

Will click the checkbox that is nearest to any element with the text Username.

Taiko also supports XPath and CSS selectors

> click($("#button_id")) // Using CSS selector
> click($("//input[@name='button_name']")) // XPath selector

Handle XHR and dynamic content

Taiko’s API listens to actions that trigger XHR request or fetch dynamic content and automatically waits for them to complete before moving on to the next action. Taiko implicitly waits for elements to load on the page before performing executing the command. Scripts written in Taiko are free of explicit local or global waits and the flakiness.

Request/Response stubbing and mocking

Setting up test infrastructure and test data is hard. Taiko makes this easy with the intercept API. For example, block requests on a page (like Google Analytics or any other resource)

> intercept("https://www.google-analytics.com/analytics.js");

Or redirect an XHR request on the page to a test instance

> intercept("https://fetchdata.com", "http://fetchtestdata.com")

Or stub an XHR request to return custom data

> intercept("https://fetchdata.com", {"test": data})

Or even modify data sent by XHR requests

> intercept("https://fetchdata.com", (request) => {request.continue({"custom": "data"})})

This simplifies our test setups as we don’t have to set up mock servers, or replace url’s in tests to point to test instances.

Integrating with Gauge

We recommend using Taiko with Gauge. Gauge is a framework for writing readable and reusable acceptance tests. With features like markdown specifications, data driven execution, parallel execution and reporting Gauge makes test maintenance easy. Gauge is easy to install and well integrated with Taiko. With Gauge and Taiko we can write reliable acceptance tests.

Install Gauge using npm and initialize an initialize and sample Taiko project using

$ npm install @getgauge/cli
$ gauge init js

Learn more about Gauge!

Experimental Firefox Support

To launch taiko with firefox:

  • Download and install firefox nightly
  • Set TAIKO_BROWSER_PATH to firefox nightly's executable.

Example: TAIKO_BROWSER_PATH="/Applications/Firefoxnightly.app/Contents/MacOS/firefox" taiko

Known Issues for now:

  • Highlighting element on action is set to false as overlay domain is not supported
  • openTab/closeTab does not work as expected since New is not available in firefox yet
  • Autofocus on first input field does not happen
  • file:// protocol does not emit events
  • waitFoNavigation does not wait for network calls and frame loads

Experimental TypeScript Support

When using Gauge together with Taiko with gauge-ts using

$ npm install @getgauge/cli
$ gauge init ts

Documentation

Branding

Inspired by

Talk to us

Copyright

Copyright 2019 ThoughtWorks, Inc

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].