1
0
mirror of https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git synced 2025-02-16 12:34:32 +00:00

Add hello_world test case and needles.

This commit is contained in:
Lukáš Růžička 2021-07-02 13:33:40 +02:00
parent 6d1d549941
commit bcc8597118
37 changed files with 493 additions and 0 deletions

View File

@ -0,0 +1,15 @@
{
"area": [
{
"height": 30,
"width": 40,
"type": "match",
"xpos": 796,
"ypos": 337
}
],
"properties": [],
"tags": [
"step1-needle.png"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"height": 30,
"width": 40,
"type": "match",
"xpos": 0,
"ypos": 0
}
],
"properties": [],
"tags": [
"step10-needle.png"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"height": 30,
"width": 40,
"type": "match",
"xpos": 0,
"ypos": 0
}
],
"properties": [],
"tags": [
"step11-needle.png"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"height": 30,
"width": 40,
"type": "match",
"xpos": 0,
"ypos": 0
}
],
"properties": [],
"tags": [
"step13-needle.png"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"height": 30,
"width": 40,
"type": "match",
"xpos": 0,
"ypos": 0
}
],
"properties": [],
"tags": [
"step14-needle.png"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"height": 30,
"width": 40,
"type": "match",
"xpos": 0,
"ypos": 0
}
],
"properties": [],
"tags": [
"step16-needle.png"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"height": 30,
"width": 40,
"type": "match",
"xpos": 0,
"ypos": 0
}
],
"properties": [],
"tags": [
"step18-needle.png"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"height": 30,
"width": 40,
"type": "match",
"xpos": 0,
"ypos": 0
}
],
"properties": [],
"tags": [
"step19-needle.png"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"height": 30,
"width": 40,
"type": "match",
"xpos": 0,
"ypos": 0
}
],
"properties": [],
"tags": [
"step21-needle.png"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"height": 30,
"width": 40,
"type": "match",
"xpos": 0,
"ypos": 0
}
],
"properties": [],
"tags": [
"step23-needle.png"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"height": 30,
"width": 40,
"type": "match",
"xpos": 0,
"ypos": 0
}
],
"properties": [],
"tags": [
"step25-needle.png"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"height": 30,
"width": 40,
"type": "match",
"xpos": 0,
"ypos": 0
}
],
"properties": [],
"tags": [
"step26-needle.png"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"height": 30,
"width": 40,
"type": "match",
"xpos": 0,
"ypos": 0
}
],
"properties": [],
"tags": [
"step27-needle.png"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"height": 30,
"width": 40,
"type": "match",
"xpos": 0,
"ypos": 0
}
],
"properties": [],
"tags": [
"step28-needle.png"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"height": 30,
"width": 40,
"type": "match",
"xpos": 0,
"ypos": 0
}
],
"properties": [],
"tags": [
"step3-needle.png"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"height": 30,
"width": 40,
"type": "match",
"xpos": 0,
"ypos": 0
}
],
"properties": [],
"tags": [
"step5-needle.png"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"height": 30,
"width": 40,
"type": "match",
"xpos": 0,
"ypos": 0
}
],
"properties": [],
"tags": [
"step7-needle.png"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"height": 30,
"width": 40,
"type": "match",
"xpos": 0,
"ypos": 0
}
],
"properties": [],
"tags": [
"step8-needle.png"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

223
tests/hello_world.pm Normal file
View 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;