Kasaya – A “WYSIWYG” scripting language for browser automation

栏目: IT技术 · 发布时间: 4年前

内容简介:First, you need:

Kasaya – A “WYSIWYG” scripting language for browser automation

Kasaya (beta)

A "WYSIWYG" scripting language and runtime for browser automation

  • Write test scripts using English-like statements.
  • NO coding required to implement those statements.
  • Not dependent on HTML IDs or XPaths.
  • Write the same way you would instruct another human being sitting in front of the browser.
  • NOT like Cucumber.
  • NOT like Selenium IDE.
  • You can:
    • Do your initial dev test in REPL mode.
    • Save the statements as a script.
    • Share with QA to expand the scenarios.
    • Even share with the product manager.

What You See Is What You Write:

Kasaya – A “WYSIWYG” scripting language for browser automation

Table of Contents

Installation

First, you need:

  1. Java JDK ( download )
  2. Google Chrome version 66 or higher ( download )
  3. Node.js version 12 or higher ( download )

Run on a terminal window (on Linux, you may need sudo )

$ npm install -g kasaya

( Installation might take a few minutes )

Found a bug? Please let us know . Kasaya is still early beta, but we want to improve.

Getting started

Interactive mode

$ kasaya                     # browser window will open
Kasāya> open "google.com"    # executed in browser as you type
Kasāya> type "cat"
Kasāya> press enter
Kasāya> read "Lifespan: ${min} – ${max} years" near "Family"
Kasāya> check if $max is "20"

Script mode

$ vi cat.kasaya
~~~~
  start
    # verify that the maximum lifespan of a cat according to google is 20 years
    open "google.com"
    type "cat"
    press enter
    read "Lifespan: ${min} – ${max} years" near "Family"
    check if $max is "20"
 end
~~~
:wq
$ kasaya cat.kasaya

Grammar

TODO: Improve this section

Kasaya's grammar is based on JARVIS , which is a rudimentary natural lanugage tool based on pattern matching. Targeted for test automation, it currently lacks certain basic programming language features such as conditionals and loops.

Phrases

Kasaya's statements are made up of phrases rather than keywords and functions. Phrases can either be built in, or macro-based. Arguments can be placed anywhere within the phrase.

Blocks

Kasaya supports the following block level structures:

in this context
how to <macro phrase>
start <run block>

Variables

"Hello ${name}"
$name
set $name to "Something else"

Constants

  • Constant declaration within context block: NAME is "World"

Command reference

Here are some examples of the most commonly used commands:

open "foo.com"
click "Sign In"
click "Username"
type "johnsmith@gmail.com"
press tab
type "12345"
click "Confirm"
read "You are logged in as ${username}" near "Success"
check if $username is "johnsmith@google.com"
read ${sender} from row "Test email" column "Sender"
print $sender

TODO: Improve this section

More commands

VS Code Extension

Get Visual Studio Code extension for Kasāya scripting from here

FAQ

Where does the name "Kasaya" come from?

We noticed that many a test tool is named after brewed drinks ("Mocha", "Chai", "Espresso"). "Kasaya" (pronounced Kuh-SAA-yuh) is also a brewed drink -- it is an Ayurvedic medicinal drink popular is Sri Lanka (better known in India as https://en.wikipedia.org/wiki/Kashayam ).

What's different about Kasaya?

The idea behind Kasaya is that, if we're able to verbally instruct a human being to run a UI test without referring to DOM elements, XPATHs or HTML IDs, it should be able to do the same with a machine. Unlike in some natural language test automation tools, you don't have to write any functions to help resolve statements to HTML IDs or XPATHs. Kasaya works out-of-the-box.

Is it based on machine learning?

No. It's based on clever but simple heuristics that attempt to mimic how human beings look at a screen and identify visual elements.

Who developed this?

Kasaya was envisioned and developed entirely by the folks at Sysco LABS, Sri Lanka.

What is the current status of Kasaya?

As of this writing (Jan 2020), Kasaya is in public beta, which means while all the basics work, there's a lot to be ironed out before we can get to version 1.0.

Can I contribute?

Eventually, yes! For now, please be patient with us -- we don't yet have a dedicated developer who can work with the community. But we're trying to get there, stay tuned!

But if you find bugs, or have great ideas, let us know!

I found a bug.

Great! Please report it on our issue tracker, with reproduction steps: https://github.com/syscolabs/kasaya/issues


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

深入理解C#(第3版)

深入理解C#(第3版)

斯基特 (Jon Skeet) / 姚琪琳 / 人民邮电出版社 / 2014-4-1 / 99.00元

本书是世界顶级技术专家“十年磨一剑”的经典之作,在C#和.NET领域享有盛誉。与其他泛泛介绍C#的书籍不同,本书深度探究C#的特性,并结合技术发展,引领读者深入C#的时空。作者从语言设计的动机出发,介绍支持这些特性的核心概念。作者将新的语言特性放在C#语言发展的背景之上,用极富实际意义的示例,向读者展示编写代码和设计解决方案的最佳方式。同时作者将多年的C#开发经验与读者分享,读者可咀其精华、免走弯......一起来看看 《深入理解C#(第3版)》 这本书的介绍吧!

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具