Add hello_world test case and needles.
15
needles/autococonut/hello_world/step1-needle.json
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"area": [
|
||||
{
|
||||
"height": 30,
|
||||
"width": 40,
|
||||
"type": "match",
|
||||
"xpos": 796,
|
||||
"ypos": 337
|
||||
}
|
||||
],
|
||||
"properties": [],
|
||||
"tags": [
|
||||
"step1-needle.png"
|
||||
]
|
||||
}
|
BIN
needles/autococonut/hello_world/step1-needle.png
Normal file
After Width: | Height: | Size: 71 KiB |
15
needles/autococonut/hello_world/step10-needle.json
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"area": [
|
||||
{
|
||||
"height": 30,
|
||||
"width": 40,
|
||||
"type": "match",
|
||||
"xpos": 0,
|
||||
"ypos": 0
|
||||
}
|
||||
],
|
||||
"properties": [],
|
||||
"tags": [
|
||||
"step10-needle.png"
|
||||
]
|
||||
}
|
BIN
needles/autococonut/hello_world/step10-needle.png
Normal file
After Width: | Height: | Size: 73 KiB |
15
needles/autococonut/hello_world/step11-needle.json
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"area": [
|
||||
{
|
||||
"height": 30,
|
||||
"width": 40,
|
||||
"type": "match",
|
||||
"xpos": 0,
|
||||
"ypos": 0
|
||||
}
|
||||
],
|
||||
"properties": [],
|
||||
"tags": [
|
||||
"step11-needle.png"
|
||||
]
|
||||
}
|
BIN
needles/autococonut/hello_world/step11-needle.png
Normal file
After Width: | Height: | Size: 73 KiB |
15
needles/autococonut/hello_world/step13-needle.json
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"area": [
|
||||
{
|
||||
"height": 30,
|
||||
"width": 40,
|
||||
"type": "match",
|
||||
"xpos": 0,
|
||||
"ypos": 0
|
||||
}
|
||||
],
|
||||
"properties": [],
|
||||
"tags": [
|
||||
"step13-needle.png"
|
||||
]
|
||||
}
|
BIN
needles/autococonut/hello_world/step13-needle.png
Normal file
After Width: | Height: | Size: 74 KiB |
15
needles/autococonut/hello_world/step14-needle.json
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"area": [
|
||||
{
|
||||
"height": 30,
|
||||
"width": 40,
|
||||
"type": "match",
|
||||
"xpos": 0,
|
||||
"ypos": 0
|
||||
}
|
||||
],
|
||||
"properties": [],
|
||||
"tags": [
|
||||
"step14-needle.png"
|
||||
]
|
||||
}
|
BIN
needles/autococonut/hello_world/step14-needle.png
Normal file
After Width: | Height: | Size: 74 KiB |
15
needles/autococonut/hello_world/step16-needle.json
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"area": [
|
||||
{
|
||||
"height": 30,
|
||||
"width": 40,
|
||||
"type": "match",
|
||||
"xpos": 0,
|
||||
"ypos": 0
|
||||
}
|
||||
],
|
||||
"properties": [],
|
||||
"tags": [
|
||||
"step16-needle.png"
|
||||
]
|
||||
}
|
BIN
needles/autococonut/hello_world/step16-needle.png
Normal file
After Width: | Height: | Size: 75 KiB |
15
needles/autococonut/hello_world/step18-needle.json
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"area": [
|
||||
{
|
||||
"height": 30,
|
||||
"width": 40,
|
||||
"type": "match",
|
||||
"xpos": 0,
|
||||
"ypos": 0
|
||||
}
|
||||
],
|
||||
"properties": [],
|
||||
"tags": [
|
||||
"step18-needle.png"
|
||||
]
|
||||
}
|
BIN
needles/autococonut/hello_world/step18-needle.png
Normal file
After Width: | Height: | Size: 76 KiB |
15
needles/autococonut/hello_world/step19-needle.json
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"area": [
|
||||
{
|
||||
"height": 30,
|
||||
"width": 40,
|
||||
"type": "match",
|
||||
"xpos": 0,
|
||||
"ypos": 0
|
||||
}
|
||||
],
|
||||
"properties": [],
|
||||
"tags": [
|
||||
"step19-needle.png"
|
||||
]
|
||||
}
|
BIN
needles/autococonut/hello_world/step19-needle.png
Normal file
After Width: | Height: | Size: 76 KiB |
15
needles/autococonut/hello_world/step21-needle.json
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"area": [
|
||||
{
|
||||
"height": 30,
|
||||
"width": 40,
|
||||
"type": "match",
|
||||
"xpos": 0,
|
||||
"ypos": 0
|
||||
}
|
||||
],
|
||||
"properties": [],
|
||||
"tags": [
|
||||
"step21-needle.png"
|
||||
]
|
||||
}
|
BIN
needles/autococonut/hello_world/step21-needle.png
Normal file
After Width: | Height: | Size: 67 KiB |
15
needles/autococonut/hello_world/step23-needle.json
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"area": [
|
||||
{
|
||||
"height": 30,
|
||||
"width": 40,
|
||||
"type": "match",
|
||||
"xpos": 0,
|
||||
"ypos": 0
|
||||
}
|
||||
],
|
||||
"properties": [],
|
||||
"tags": [
|
||||
"step23-needle.png"
|
||||
]
|
||||
}
|
BIN
needles/autococonut/hello_world/step23-needle.png
Normal file
After Width: | Height: | Size: 69 KiB |
15
needles/autococonut/hello_world/step25-needle.json
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"area": [
|
||||
{
|
||||
"height": 30,
|
||||
"width": 40,
|
||||
"type": "match",
|
||||
"xpos": 0,
|
||||
"ypos": 0
|
||||
}
|
||||
],
|
||||
"properties": [],
|
||||
"tags": [
|
||||
"step25-needle.png"
|
||||
]
|
||||
}
|
BIN
needles/autococonut/hello_world/step25-needle.png
Normal file
After Width: | Height: | Size: 70 KiB |
15
needles/autococonut/hello_world/step26-needle.json
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"area": [
|
||||
{
|
||||
"height": 30,
|
||||
"width": 40,
|
||||
"type": "match",
|
||||
"xpos": 0,
|
||||
"ypos": 0
|
||||
}
|
||||
],
|
||||
"properties": [],
|
||||
"tags": [
|
||||
"step26-needle.png"
|
||||
]
|
||||
}
|
BIN
needles/autococonut/hello_world/step26-needle.png
Normal file
After Width: | Height: | Size: 71 KiB |
15
needles/autococonut/hello_world/step27-needle.json
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"area": [
|
||||
{
|
||||
"height": 30,
|
||||
"width": 40,
|
||||
"type": "match",
|
||||
"xpos": 0,
|
||||
"ypos": 0
|
||||
}
|
||||
],
|
||||
"properties": [],
|
||||
"tags": [
|
||||
"step27-needle.png"
|
||||
]
|
||||
}
|
BIN
needles/autococonut/hello_world/step27-needle.png
Normal file
After Width: | Height: | Size: 71 KiB |
15
needles/autococonut/hello_world/step28-needle.json
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"area": [
|
||||
{
|
||||
"height": 30,
|
||||
"width": 40,
|
||||
"type": "match",
|
||||
"xpos": 0,
|
||||
"ypos": 0
|
||||
}
|
||||
],
|
||||
"properties": [],
|
||||
"tags": [
|
||||
"step28-needle.png"
|
||||
]
|
||||
}
|
BIN
needles/autococonut/hello_world/step28-needle.png
Normal file
After Width: | Height: | Size: 72 KiB |
15
needles/autococonut/hello_world/step3-needle.json
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"area": [
|
||||
{
|
||||
"height": 30,
|
||||
"width": 40,
|
||||
"type": "match",
|
||||
"xpos": 0,
|
||||
"ypos": 0
|
||||
}
|
||||
],
|
||||
"properties": [],
|
||||
"tags": [
|
||||
"step3-needle.png"
|
||||
]
|
||||
}
|
BIN
needles/autococonut/hello_world/step3-needle.png
Normal file
After Width: | Height: | Size: 65 KiB |
15
needles/autococonut/hello_world/step5-needle.json
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"area": [
|
||||
{
|
||||
"height": 30,
|
||||
"width": 40,
|
||||
"type": "match",
|
||||
"xpos": 0,
|
||||
"ypos": 0
|
||||
}
|
||||
],
|
||||
"properties": [],
|
||||
"tags": [
|
||||
"step5-needle.png"
|
||||
]
|
||||
}
|
BIN
needles/autococonut/hello_world/step5-needle.png
Normal file
After Width: | Height: | Size: 71 KiB |
15
needles/autococonut/hello_world/step7-needle.json
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"area": [
|
||||
{
|
||||
"height": 30,
|
||||
"width": 40,
|
||||
"type": "match",
|
||||
"xpos": 0,
|
||||
"ypos": 0
|
||||
}
|
||||
],
|
||||
"properties": [],
|
||||
"tags": [
|
||||
"step7-needle.png"
|
||||
]
|
||||
}
|
BIN
needles/autococonut/hello_world/step7-needle.png
Normal file
After Width: | Height: | Size: 72 KiB |
15
needles/autococonut/hello_world/step8-needle.json
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"area": [
|
||||
{
|
||||
"height": 30,
|
||||
"width": 40,
|
||||
"type": "match",
|
||||
"xpos": 0,
|
||||
"ypos": 0
|
||||
}
|
||||
],
|
||||
"properties": [],
|
||||
"tags": [
|
||||
"step8-needle.png"
|
||||
]
|
||||
}
|
BIN
needles/autococonut/hello_world/step8-needle.png
Normal file
After Width: | Height: | Size: 72 KiB |
223
tests/hello_world.pm
Normal file
@ -0,0 +1,223 @@
|
||||
use base "installedtest";
|
||||
use strict;
|
||||
use testapi;
|
||||
use utils;
|
||||
|
||||
# This is the AutoCoconut - workflow report test created by the AutoCoconut Tool.
|
||||
|
||||
sub run {
|
||||
my $self = shift;
|
||||
|
||||
# Here starts the autogenerated part.
|
||||
|
||||
# IMPORTANT NOTICE:
|
||||
# 1. You should manually check that the assertion needles for post action assertions, such as key presses, etc.
|
||||
# point to correct locations. Be default they only check the upper left corner which may lead to false
|
||||
# positives. You can also delete them, if you do not require such assertions.
|
||||
# 2. If you were creating tests for terminal commands, you might want to switch some of the
|
||||
# `type_very_safely` routines for something like `assert_script_run` or `script_run` to get some more terminal
|
||||
# functionality.
|
||||
|
||||
|
||||
|
||||
|
||||
# Click with the *left* button (needle click area might need some correction)
|
||||
assert_and_click("step1-needle.png", button => "left", timeout => 30);
|
||||
|
||||
|
||||
|
||||
# Type *clear*.
|
||||
type_very_safely("clear");
|
||||
|
||||
|
||||
|
||||
|
||||
# Press *ret*.
|
||||
send_key("ret");
|
||||
# Check the needle for the result of the action
|
||||
assert_screen("step3-needle.png", timeout => 30);
|
||||
|
||||
|
||||
|
||||
# Type *nano hello_world.py*.
|
||||
type_very_safely("nano hello_world.py");
|
||||
|
||||
|
||||
|
||||
|
||||
# Press *ret*.
|
||||
send_key("ret");
|
||||
# Check the needle for the result of the action
|
||||
assert_screen("step5-needle.png", timeout => 30);
|
||||
|
||||
|
||||
|
||||
# Type *#!/usr/bin/python*.
|
||||
type_very_safely("#!/usr/bin/python");
|
||||
|
||||
|
||||
|
||||
|
||||
# Press *ret*.
|
||||
send_key("ret");
|
||||
# Check the needle for the result of the action
|
||||
assert_screen("step7-needle.png", timeout => 30);
|
||||
|
||||
|
||||
|
||||
|
||||
# Press *ret*.
|
||||
send_key("ret");
|
||||
# Check the needle for the result of the action
|
||||
assert_screen("step8-needle.png", timeout => 30);
|
||||
|
||||
|
||||
|
||||
# Type *def say_hello():*.
|
||||
type_very_safely("def say_hello():");
|
||||
|
||||
|
||||
|
||||
|
||||
# Press *ret*.
|
||||
send_key("ret");
|
||||
# Check the needle for the result of the action
|
||||
assert_screen("step10-needle.png", timeout => 30);
|
||||
|
||||
|
||||
|
||||
# Press *tab*.
|
||||
send_key("tab");
|
||||
# Check the needle for the result of the action
|
||||
assert_screen("step11-needle.png", timeout => 30);
|
||||
|
||||
|
||||
|
||||
# Type *print("Hello, world!")*.
|
||||
type_very_safely("print("Hello, world!")");
|
||||
|
||||
|
||||
|
||||
|
||||
# Press *ret*.
|
||||
send_key("ret");
|
||||
# Check the needle for the result of the action
|
||||
assert_screen("step13-needle.png", timeout => 30);
|
||||
|
||||
|
||||
|
||||
|
||||
# Press *ret*.
|
||||
send_key("ret");
|
||||
# Check the needle for the result of the action
|
||||
assert_screen("step14-needle.png", timeout => 30);
|
||||
|
||||
|
||||
|
||||
# Type *say_hello()*.
|
||||
type_very_safely("say_hello()");
|
||||
|
||||
|
||||
|
||||
|
||||
# Press *ret*.
|
||||
send_key("ret");
|
||||
# Check the needle for the result of the action
|
||||
assert_screen("step16-needle.png", timeout => 30);
|
||||
|
||||
|
||||
|
||||
|
||||
# Press and hold a ctrl modifier.
|
||||
hold_key("ctrl");
|
||||
|
||||
# Press *o*.
|
||||
send_key("o");
|
||||
|
||||
|
||||
|
||||
# Release modifier. Note that if there were more modifiers pressed, only the last one is marked for release.
|
||||
# Fix this according to your needs.
|
||||
release_key("ctrl");
|
||||
# Check the needle to see the result of the action.
|
||||
assert_screen("step18-needle.png", timeout => 30);
|
||||
|
||||
|
||||
|
||||
|
||||
# Press *ret*.
|
||||
send_key("ret");
|
||||
# Check the needle for the result of the action
|
||||
assert_screen("step19-needle.png", timeout => 30);
|
||||
|
||||
|
||||
|
||||
|
||||
# Press and hold a ctrl modifier.
|
||||
hold_key("ctrl");
|
||||
|
||||
# Press *x*.
|
||||
send_key("x");
|
||||
|
||||
|
||||
|
||||
# Release modifier. Note that if there were more modifiers pressed, only the last one is marked for release.
|
||||
# Fix this according to your needs.
|
||||
release_key("ctrl");
|
||||
# Check the needle to see the result of the action.
|
||||
assert_screen("step21-needle.png", timeout => 30);
|
||||
|
||||
|
||||
|
||||
# Type *chmod 755 hello_world.py*.
|
||||
type_very_safely("chmod 755 hello_world.py");
|
||||
|
||||
|
||||
|
||||
|
||||
# Press *ret*.
|
||||
send_key("ret");
|
||||
# Check the needle for the result of the action
|
||||
assert_screen("step23-needle.png", timeout => 30);
|
||||
|
||||
|
||||
|
||||
# Type *./hello*.
|
||||
type_very_safely("./hello");
|
||||
|
||||
|
||||
|
||||
# Press *tab*.
|
||||
send_key("tab");
|
||||
# Check the needle for the result of the action
|
||||
assert_screen("step25-needle.png", timeout => 30);
|
||||
|
||||
|
||||
|
||||
|
||||
# Press *ret*.
|
||||
send_key("ret");
|
||||
# Check the needle for the result of the action
|
||||
assert_screen("step26-needle.png", timeout => 30);
|
||||
|
||||
|
||||
|
||||
# This is the end of the recording. See the screenshot that shows the situation at the end of the recording.
|
||||
assert_screen("step27-needle.png", timeout => 30);
|
||||
|
||||
|
||||
|
||||
# This is the end of the recording. See the screenshot that shows the situation at the end of the recording.
|
||||
assert_screen("step28-needle.png", timeout => 30);
|
||||
|
||||
|
||||
|
||||
# Here ends the autogenerated part.
|
||||
|
||||
}
|
||||
|
||||
sub test_flags {
|
||||
return {always_rollback => 1};
|
||||
}
|
||||
|
||||
1;
|