1
0
mirror of https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git synced 2025-02-16 20:44:31 +00:00
os-autoinst-distri-fedora/tests/hello_world.pm
2021-07-02 13:33:40 +02:00

224 lines
4.2 KiB
Perl

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;