Taiko - Simplify your browser automation
Agenda
-
Introduction
-
Why Taiko?
-
Limitations
-
Taiko plugins
-
Workshop
What is Taiko?
Free and open source browser automation tool
Node library automate the chrome browser
Uses the Chrome DevTools API
Why Taiko?
Simplicity
No Jars. No servers.
Simple APIs
Why Taiko?
Smart, Reliable, Maintainable
Smart selectors (wyswyg)
Proximity selectors (toLeftOf, to RightOf)
No more inspection
No sleeps, no waits (implicit waits, XHR handling)
REPL - Generate code
Other cool Taiko features
- Request/Response stubbing and mocking
- Upload files (fileField, attach)
- Set delay between keyups and keydowns
- Highlight elements on the page (for debugging)
- mouseAction
- Gauge can be used for parallel execution, reporting, CD workflows, etc
- Can be integrated with any test JS framework
How does Taiko work?
Taiko
CRI
CDP
DEMO
So how does it perform when compared to..?
Drawbacks
- Language support - Only JS (Or any language that can be transpiled to JS like typescript, coffeescript etc)
- Cross browser support - Supports browsers that support CDP (Chrome, Chromium powered Edge, Opera etc)
Taiko Plugins
Taiko features can be extended via plugins which can allow users to take more advantage of CDP when core Taiko concentrating on functionalities around UI automation tests.
Taiko-paypal, taiko-diagnostics, taiko-screencast etc
Why do we need plugins?
They help simplify workflow so users can focus on writing the the main UI automation
What taiko plugins do for us
- Combine a set of taiko actions and provide APIs for it
- Expose more of ChromeDevtoolsProtocols
- Provide selectors based on frameworks
- Override taiko APIs
Examples of existing plugins
- Taiko-paypal: perform paypal payment
- Taiko-diagnostics: run diagnostics over a website
- Taiko-screencast: record a video of the script running
- Taiko-react: interact with React components in a webpage
-
Taiko-android: run taiko using a browser on android devices
Conventions
-
Plugins should have the prefix taiko-
-
Plugins should not have taiko as their dependency
-
Should implement the init() method on load which passes the taiko and event handler instances
-
Taiko can communicate with plugins via events. Eg: sessionCreated, firstMeaningfulPaint
Running taiko with plugins
Running taiko with plugins
DEMO
Steps
- Step #1: Install node and npm
- Step #2: Install taiko
- Step #3: Clone repo
- Step #4: Install dependencies
... And the preliminary setup is done!
deck
By Fathima Harris
deck
- 558